diff --git a/annotation/compiler/test/build.gradle b/annotation/compiler/test/build.gradle index 63c8404e33..5bb534de3d 100644 --- a/annotation/compiler/test/build.gradle +++ b/annotation/compiler/test/build.gradle @@ -46,3 +46,6 @@ task regenerateTestResources { } } regenerateTestResources.finalizedBy(test) + +test.maxParallelForks = 2 + diff --git a/build.gradle b/build.gradle index 58f0505ac2..5b33833fdf 100644 --- a/build.gradle +++ b/build.gradle @@ -32,6 +32,7 @@ if (JavaVersion.current().isJava8Compatible()) { subprojects { project -> tasks.withType(JavaCompile) { + options.fork = true sourceCompatibility = 1.7 targetCompatibility = 1.7 diff --git a/gradle.properties b/gradle.properties index 54dbc42c25..1d1f415af0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/library/build.gradle b/library/build.gradle index fc9dfe2ccb..ddd3a7b208 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -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 {