Skip to content

Commit

Permalink
Improve build files
Browse files Browse the repository at this point in the history
- newest version of all dependencies (including gradle 3)
   This required me to do the nasty guava hack in buildSrc/build.gradle.
   This seems to be a known quirk with gradle and this was the
   recommended workaround
- Consistent format of build files
- Parallel build (cuts build time in half)
  • Loading branch information
moltmann authored and drewhannay committed Mar 16, 2018
1 parent 4946f6c commit 6290cb2
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 48 deletions.
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import com.linkedin.gradle.DistributeTask
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.0"
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.7.0"
}
}

Expand Down
9 changes: 6 additions & 3 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ dependencies {
compile gradleApi()
compile localGroovy()

compile 'org.ajoberstar:gradle-git:1.2.0'
compile group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.2'
compile('org.jfrog.buildinfo:build-info-extractor-gradle:4.4.0') {
// Force guava 22 otherwise the dependency of org.jfrog.buildinfo:build-info-extractor-gradle
// (guava 18) is loaded before com.android.tools.build:grade can force at least 22
implementation 'com.google.guava:guava:23.0'

implementation group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.5'
implementation('org.jfrog.buildinfo:build-info-extractor-gradle:4.7.0') {
exclude module: 'groovy-all'
}
}
10 changes: 5 additions & 5 deletions dexmaker-mockito-inline-dispatcher/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
compileSdkVersion 27
buildToolsVersion '27.0.3'

lintOptions {
abortOnError false
}

defaultConfig {
applicationId "com.android.dexmaker.mockito.inline.dispatcher"
minSdkVersion 25
targetSdkVersion 25
applicationId 'com.android.dexmaker.mockito.inline.dispatcher'
minSdkVersion 27
targetSdkVersion 27
versionName VERSION_NAME
}
}
14 changes: 8 additions & 6 deletions dexmaker-mockito-inline-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 'android-P'
buildToolsVersion "25.0.0"
buildToolsVersion '27.0.3'

lintOptions {
abortOnError false
}

defaultConfig {
applicationId "com.android.dexmaker.mockito.inline.tests"
minSdkVersion 25
targetSdkVersion 25
applicationId 'com.android.dexmaker.mockito.inline.tests'
minSdkVersion 27
targetSdkVersion 27
versionName VERSION_NAME

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}

externalNativeBuild {
Expand All @@ -31,6 +31,8 @@ repositories {

dependencies {
androidTestCompile project(':dexmaker-mockito-inline')

androidTestCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile 'org.mockito:mockito-core:2.16.0', { exclude group: 'net.bytebuddy' }
}
12 changes: 6 additions & 6 deletions dexmaker-mockito-inline/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 'android-P'
buildToolsVersion "25.0.0"
buildToolsVersion '27.0.3'

lintOptions {
abortOnError false
}

defaultConfig {
minSdkVersion 25
targetSdkVersion 25
minSdkVersion 27
targetSdkVersion 27
versionName VERSION_NAME
}

Expand All @@ -19,15 +19,15 @@ android {
path 'CMakeLists.txt'
}
}

}

repositories {
jcenter()
}

dependencies {
compile project(':dexmaker')
compile 'org.mockito:mockito-core:2.16.0', { exclude group: "net.bytebuddy" }
implementation project(':dexmaker')

implementation 'org.mockito:mockito-core:2.16.0', { exclude group: 'net.bytebuddy' }
}

16 changes: 8 additions & 8 deletions dexmaker-mockito-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
compileSdkVersion 27
buildToolsVersion '27.0.3'

lintOptions {
abortOnError false
}

defaultConfig {
applicationId "com.android.dexmaker.mockito.tests"
minSdkVersion 25
targetSdkVersion 25
applicationId 'com.android.dexmaker.mockito.tests'
minSdkVersion 8
targetSdkVersion 27
versionName VERSION_NAME

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
}

Expand All @@ -24,9 +24,9 @@ repositories {
}

dependencies {
compile project(':dexmaker')
compile project(':dexmaker-mockito')
androidTestCompile project(':dexmaker-mockito')

androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'org.mockito:mockito-core:2.16.0', { exclude group: 'net.bytebuddy' }
}
4 changes: 2 additions & 2 deletions dexmaker-mockito/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repositories {
}

dependencies {
compile project(":dexmaker")
implementation project(':dexmaker')

compile 'org.mockito:mockito-core:2.16.0', { exclude group: "net.bytebuddy" }
implementation 'org.mockito:mockito-core:2.16.0', { exclude group: 'net.bytebuddy' }
}
26 changes: 13 additions & 13 deletions dexmaker-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
apply plugin: 'com.android.application'

repositories {
jcenter()
google()
}

android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
compileSdkVersion 27
buildToolsVersion '27.0.3'

defaultConfig {
applicationId "com.linkedin.dexmaker"
applicationId 'com.linkedin.dexmaker'
minSdkVersion 8
targetSdkVersion 25
targetSdkVersion 27
versionCode 1
versionName VERSION_NAME

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
}

repositories {
jcenter()
google()
}

dependencies {
compile project(":dexmaker")
implementation project(":dexmaker")

androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'junit:junit:4.12'
}
2 changes: 1 addition & 1 deletion dexmaker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ repositories {
}

dependencies {
compile 'com.jakewharton.android.repackaged:dalvik-dx:7.1.0_r7'
implementation 'com.jakewharton.android.repackaged:dalvik-dx:7.1.0_r7'
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

org.gradle.jvmargs=-Djava.awt.headless=true
org.gradle.parallel=true

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down

0 comments on commit 6290cb2

Please sign in to comment.