From ef17fdc11e1ef5e30a76c5570966b779b8576626 Mon Sep 17 00:00:00 2001 From: Sam Sudar Date: Wed, 5 Oct 2016 20:14:54 -0700 Subject: [PATCH 1/2] Simplify gradle files Try to remove some of the ODK team's specific workflow from Collect. Many of the power user features the core ODK team relies on aren't necessary for Collect. In the interest of keeping the setup as simple as possible, this removes all remote configs and removes signing parameters from the gradle files. --- build.gradle | 18 ----------- collect_app/build.gradle | 69 +++++++++++----------------------------- settings.gradle | 35 +------------------- 3 files changed, 20 insertions(+), 102 deletions(-) diff --git a/build.gradle b/build.gradle index ca078e56be5..7c14a506d41 100644 --- a/build.gradle +++ b/build.gradle @@ -11,24 +11,6 @@ buildscript { allprojects { repositories { jcenter() - ivy { - url 'http://cwe.cs.washington.edu:8082/artifactory/libs-release' - } - } -} - -allprojects { - repositories { - jcenter() - ivy { - url 'http://cwe.cs.washington.edu:8082/artifactory/libs-demo/' - } - ivy { - url 'http://cwe.cs.washington.edu:8082/artifactory/libs-master/' - } - ivy { - url 'http://cwe.cs.washington.edu:8082/artifactory/libs-snapshot/' - } } } diff --git a/collect_app/build.gradle b/collect_app/build.gradle index 06b7fba5b05..02dacba1ead 100644 --- a/collect_app/build.gradle +++ b/collect_app/build.gradle @@ -2,24 +2,13 @@ GRADLE CONFIG *************************************************************************************************/ -if ((new File(gradle.local)).exists()) { - apply from: gradle.local -} else { - apply from: gradle.remote -} - -applicationScripts.each { - apply from: it -} - apply plugin: 'com.android.application' com.android.ddmlib.DdmPreferences.setTimeOut(60000) android { - // The following are set in the common.gradle file - compileSdkVersion(compileVersion) - buildToolsVersion(buildTools) + compileSdkVersion(22) + buildToolsVersion("23.0.3") defaultConfig { applicationId("org.odk.collect.android") @@ -29,55 +18,35 @@ android { versionName("1.4.10") } - productFlavors { - demo { - } - - master { - } - - snapshot { - } - - uitest { - } - } - - signingConfigs { - release { - if (shouldSign) { - storeFile file(signStoreFilePath) - storePassword signStorePass - keyAlias signKeyAlias - keyPassword signKeyPass - } - } - } - buildTypes { release { - minifyEnabled(minify) + minifyEnabled(true) proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' - - if (shouldSign) { - signingConfig signingConfigs.release - } } debug { debuggable(true) - testCoverageEnabled(testCoverage) // Allows AndroidTest JaCoCo reports to be generated + // Allows AndroidTest JaCoCo reports to be generated + testCoverageEnabled(true) } } - packagingOptions { // Pick first occurrence of any files that cause conflicts, as defined in common.gradle - packageList.each { - pickFirst it - } + packagingOptions { + // Pick first occurrence of any files that cause conflicts, as defined + // in common.gradle + pickFirst 'META-INF/DEPENDENCIES' + pickFirst 'META-INF/LICENSE' + pickFirst 'META-INF/LICENSE.txt' + pickFirst 'META-INF/NOTICE' + pickFirst 'META-INF/NOTICE.txt' + pickFirst 'META-INF/services/com.fasterxml.jackson.core.JsonFactory' + pickFirst 'META-INF/services/com.fasterxml.jackson.core.ObjectCodec' + pickFirst 'META-INF/services/javax.ws.rs.ext.MessageBodyReader' + pickFirst 'META-INF/services/javax.ws.rs.ext.MessageBodyWriter' } compileOptions { - sourceCompatibility javaVersion - targetCompatibility javaVersion + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 } } diff --git a/settings.gradle b/settings.gradle index c57213900f8..27f0136645c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,34 +1 @@ -gradle.ext.gradleConfigVersion = 40 - -if ( !gradle.ext.has('workspacePath') ) { - def env = System.getProperties(); - logger.warn("collect/settings.gradle System.getProperties().stringPropertyNames(): " + env.stringPropertyNames()); - def path = System.getProperty('com.android.studio.gradle.project.path'); - if ( path != null ) { - logger.warn("collect/settings.gradle Found value for System.getProperty('com.android.studio.gradle.project.path')"); - gradle.ext.workspacePath = (new File(path)).getParentFile().getAbsolutePath(); - } else { - logger.warn("collect/settings.gradle No value found for System.getProperty('com.android.studio.gradle.project.path')"); - gradle.ext.workspacePath = new File("..").getAbsolutePath(); - } -} - -logger.warn('collect/settings.gradle -- gradle.ext.workspacePath: ' + gradle.ext.workspacePath) - -gradle.ext.local = gradle.ext.workspacePath + '/gradle-config/remote.gradle' -gradle.ext.remote = 'https://raw.githubusercontent.com/opendatakit/gradle-config/' + gradle.ext.gradleConfigVersion + '/remote.gradle' -gradle.ext.useLocal = true // set to false to always build against remote artifacts - -if ((new File(gradle.ext.local)).exists()) { - gradle.ext.useLocalPaths = true - apply from: gradle.ext.local -} else { - gradle.ext.useLocalPaths = false - apply from: gradle.ext.remote -} - -settingsScripts.each { - apply from: it -} - -include(collectProjectChild) \ No newline at end of file +include ':collect_app' \ No newline at end of file From fe9ecaee94e4724a7ad7e091198015ce717b207a Mon Sep 17 00:00:00 2001 From: Sam Sudar Date: Wed, 2 Nov 2016 09:14:34 -0700 Subject: [PATCH 2/2] Rev gradle version and android plugin This updates the gradle plugin for the wrapper to 2.14.1, as this was the value auto-suggested by Android Studio. It also updates the Android gradle plugin to 2.2.2, enabling instant run. --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 7c14a506d41..47c2d4c7469 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.0' + classpath 'com.android.tools.build:gradle:2.2.2' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fa957883275..cb4c305885e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Aug 31 19:13:22 PDT 2016 +#Wed Nov 02 08:59:15 PDT 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip