From 82ce049e9a84eb29fbea6e76262a595058c547d9 Mon Sep 17 00:00:00 2001 From: mib-iqbal Date: Fri, 3 Nov 2017 16:12:46 +0800 Subject: [PATCH] MI | Updating gradle and dependencies for nutritionist #6 Signed-off-by: mib-iqbal --- build.gradle | 4 +- opensrp-bidan/build.gradle | 114 +++++++++++-------------------------- 2 files changed, 36 insertions(+), 82 deletions(-) diff --git a/build.gradle b/build.gradle index a349431..81de65a 100644 --- a/build.gradle +++ b/build.gradle @@ -35,10 +35,10 @@ subprojects { maven { url "http://repo.maven.apache.org/maven2" } maven { url "http://cloudant.github.io/cloudant-sync-eap/repository" } maven { - url "${projectDir}/opensrp-bidan/../libs/" + url "${projectDir}/opensrp-gizi/../libs/" } maven { - url "${projectDir}/opensrp-bidan-it/../libs/" + url "${projectDir}/opensrp-gizi-it/../libs/" } mavenLocal() } diff --git a/opensrp-bidan/build.gradle b/opensrp-bidan/build.gradle index c25d96e..3405233 100644 --- a/opensrp-bidan/build.gradle +++ b/opensrp-bidan/build.gradle @@ -1,14 +1,11 @@ buildscript { repositories { jcenter() - maven { url 'https://maven.fabric.io/public' } } dependencies { classpath "com.android.tools.build:gradle:1.2.3" - classpath 'org.apache.commons:commons-lang3:3.3.2' classpath 'org.robolectric:robolectric-gradle-plugin:1.1.0' - classpath 'io.fabric.tools:gradle:1.+' - classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0' + classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.1' } } @@ -20,27 +17,23 @@ allprojects { } apply plugin: 'com.android.application' -apply plugin: 'io.fabric' apply plugin: 'jacoco' apply plugin: 'com.github.kt3k.coveralls' -repositories { - maven { url 'https://maven.fabric.io/public' } - maven { url 'https://jitpack.io' } - -} - android { - compileSdkVersion 22 + compileSdkVersion 23 buildToolsVersion "26.0.1" defaultConfig { - applicationId "org.smartregister.bidan" + applicationId "org.ei.opensrp.gizi" minSdkVersion 18 targetSdkVersion 21 - versionCode 10 - versionName "1.3.1" + versionCode 1 + versionName "1.0" multiDexEnabled true + buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l" + buildConfigField "boolean", "TIME_CHECK", "false" + resValue "string", 'opensrp_url', '"http://46.101.51.199:8181/opensrp"' } dexOptions { @@ -50,6 +43,7 @@ android { lintOptions { lintConfig file("lint.xml") + abortOnError false } buildTypes { @@ -57,25 +51,12 @@ android { minifyEnabled false zipAlignEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - resValue "string", 'opensrp_url', '""' - buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '250' - buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '100' - buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '1' - buildConfigField "int", "DATABASE_VERSION", '8' - buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l" - buildConfigField "boolean", "TIME_CHECK", "true" } debug { - resValue "string", 'opensrp_url', '"http://46.101.51.199:8080/opensrp"' - buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '250' - buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '100' - buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' - buildConfigField "int", "DATABASE_VERSION", '8' - buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l" - buildConfigField "boolean", "TIME_CHECK", "false" testCoverageEnabled true } + } packagingOptions { exclude 'META-INF/DEPENDENCIES.txt' @@ -91,73 +72,44 @@ android { exclude 'LICENSE.txt' } - testOptions { unitTests.returnDefaultValues = true } + + dexOptions { + incremental true + javaMaxHeapSize "4g" + } } dependencies { - compile('org.smartregister:opensrp-client-native-form:1.0.2-SNAPSHOT@aar') { - transitive = true - exclude group: 'com.android.support', module: 'recyclerview-v7' - } - compile('org.smartregister:opensrp-client-core:1.0.5-SNAPSHOT@aar') { + compile('org.smartregister:opensrp-client-core:1.0.0-SNAPSHOT@aar') { transitive = true exclude group: 'com.github.bmelnychuk', module: 'atv' - } - - compile('com.android.support:design:22.2.1') { - exclude group: 'com.android.support', module: 'recyclerview-v7' - - } - compile 'com.android.support:appcompat-v7:22.1.1' - compile 'com.android.support:cardview-v7:22.2.1' - compile 'com.android.support:leanback-v17:22.2.1' - compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') { - transitive = true; - } - compile 'com.jjoe64:graphview:4.2.1' - compile 'com.android.support:support-v4:22.2.1' - compile 'id.zelory:compressor:1.0.4' - compile 'com.twotoasters.SectionCursorAdapter:library:1.0.+' - compile 'com.github.ybq:Android-SpinKit:1.1.0' - compile 'junit:junit:4.12' - - testCompile('org.robolectric:robolectric:3.4.2') { - exclude group: 'com.google.guava', module: 'guava' - exclude group: 'org.apache.maven', module: 'maven-model' - exclude group: 'org.apache.maven', module: 'maven-ant-tasks' - exclude group: 'com.android.support' } + compile fileTree(dir: 'libs', include: ['*.jar']) + compile 'com.android.support:design:22.2.1' - testCompile("org.robolectric:shadows-multidex:3.4-rc2") { - exclude group: 'com.google.guava', module: 'guava' - } + compile 'com.jjoe64:graphview:4.0.1' + compile 'com.google.code.gson:gson:2.8.2' + compile 'com.android.support:appcompat-v7:22.2.1' +// compile project(':json2view') + compile 'com.google.guava:guava:20.0' - androidTestCompile('com.android.support.test.espresso:espresso-core:2.+') { + androidTestCompile 'junit:junit:4.12' - exclude group: 'com.android.support', module: 'support-annotations' - exclude group: 'junit', module: 'junit' - } + testCompile 'junit:junit:4.12' + testCompile 'org.apache.maven:maven-ant-tasks:2.1.3' + testCompile('com.squareup:fest-android:1.0.8') { exclude module: 'support-v4' } + testCompile 'org.robolectric:robolectric:3.4.2' + testCompile "org.robolectric:shadows-multidex:3.4-rc2" // PowerMock - def powerMockVersion = '1.7.1' + def powerMockVersion = '1.7.3' testCompile "org.powermock:powermock-module-junit4:$powerMockVersion" testCompile "org.powermock:powermock-module-junit4-rule:$powerMockVersion" testCompile "org.powermock:powermock-api-mockito2:$powerMockVersion" - testCompile("org.powermock:powermock-classloading-xstream:$powerMockVersion") { - - exclude group: 'com.thoughtworks.xstream', module: 'xstream' - } - - testCompile 'org.apache.maven:maven-ant-tasks:2.1.3' -} - -//Testing and coveralls - -coveralls { - jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/merged.xml" + testCompile("org.powermock:powermock-classloading-xstream:$powerMockVersion") } task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebug']) { @@ -181,4 +133,6 @@ task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebug']) { ]) } -//End testing and coveralls +coveralls { + jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/merged.xml" +}