Skip to content

Commit

Permalink
Adjust some gradle parameters to speed up the build.
Browse files Browse the repository at this point in the history
Seems to take ~2 min 50s build down to ~20 min 30s. Not a huge gain.
  • Loading branch information
sjudd committed Jan 7, 2018
1 parent 3968ccb commit 1c7434a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions annotation/compiler/test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ task regenerateTestResources {
}
}
regenerateTestResources.finalizedBy(test)

test.maxParallelForks = 2

1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ if (JavaVersion.current().isJava8Compatible()) {

subprojects { project ->
tasks.withType(JavaCompile) {
options.fork = true
sourceCompatibility = 1.7
targetCompatibility = 1.7

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ COMPILE_SDK_VERSION=27
TARGET_SDK_VERSION=27
MIN_SDK_VERSION=14

org.gradle.jvmargs=-Xmx2048M
TEST_JVM_MEMORY_SIZE=2048M
org.gradle.jvmargs=-Xmx4096M
TEST_JVM_MEMORY_SIZE=4096M
4 changes: 4 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ android.testOptions.unitTests.all { Test testTask ->
// Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=2048m; support was removed in 8.0
testTask.jvmArgs "-XX:MaxPermSize=${TEST_JVM_MEMORY_SIZE}"
}

// Initializing Robolectric is expensive, two threads seem to be around the only level where any
// improvement is seen.
testTask.maxParallelForks = 2
}

android {
Expand Down

0 comments on commit 1c7434a

Please sign in to comment.