Skip to content

Commit

Permalink
Simplify gradle files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
srsudar committed Oct 6, 2016
1 parent 017c258 commit ef17fdc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 102 deletions.
18 changes: 0 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
}
}
}

Expand Down
69 changes: 19 additions & 50 deletions collect_app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
}
}

Expand Down
35 changes: 1 addition & 34 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -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)
include ':collect_app'

0 comments on commit ef17fdc

Please sign in to comment.