mirror of
https://github.com/bitwarden/android.git
synced 2026-02-03 18:17:54 -06:00
Optimize build times (#6418)
This commit is contained in:
parent
66316e4bd2
commit
954571ff4a
@ -299,16 +299,16 @@ dependencies {
|
||||
testImplementation(libs.square.turbine)
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<Test> {
|
||||
useJUnitPlatform()
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = Runtime.getRuntime().availableProcessors()
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
|
||||
// Explicitly setting the user Country and Language because tests assume en-US
|
||||
"-Duser.country=US" +
|
||||
"-Duser.language=en"
|
||||
}
|
||||
tasks.withType<Test>().configureEach {
|
||||
useJUnitPlatform()
|
||||
@Suppress("MagicNumber")
|
||||
forkEvery = 100
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
|
||||
// Explicitly setting the user Country and Language because tests assume en-US
|
||||
"-Duser.country=US" +
|
||||
"-Duser.language=en"
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
|
||||
@ -260,10 +260,16 @@ protobuf {
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<Test> {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
tasks.withType<Test>().configureEach {
|
||||
useJUnitPlatform()
|
||||
@Suppress("MagicNumber")
|
||||
forkEvery = 100
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
|
||||
// Explicitly setting the user Country and Language because tests assume en-US
|
||||
"-Duser.country=US" +
|
||||
"-Duser.language=en"
|
||||
}
|
||||
|
||||
private fun renameFile(path: String, newName: String) {
|
||||
|
||||
@ -76,8 +76,14 @@ dependencies {
|
||||
testImplementation(libs.square.turbine)
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<Test> {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
tasks.withType<Test>().configureEach {
|
||||
useJUnitPlatform()
|
||||
@Suppress("MagicNumber")
|
||||
forkEvery = 100
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
|
||||
// Explicitly setting the user Country and Language because tests assume en-US
|
||||
"-Duser.country=US" +
|
||||
"-Duser.language=en"
|
||||
}
|
||||
|
||||
@ -179,6 +179,12 @@ fun Project.getGitStagedFiles(rootDir: File): Provider<List<File>> {
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.isFork = true
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.withType(Detekt::class.java).configureEach {
|
||||
val typeResolutionEnabled = !classpath.isEmpty
|
||||
|
||||
@ -69,11 +69,14 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<Test> {
|
||||
useJUnitPlatform()
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = Runtime.getRuntime().availableProcessors()
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC"
|
||||
}
|
||||
tasks.withType<Test>().configureEach {
|
||||
useJUnitPlatform()
|
||||
@Suppress("MagicNumber")
|
||||
forkEvery = 100
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
|
||||
// Explicitly setting the user Country and Language because tests assume en-US
|
||||
"-Duser.country=US" +
|
||||
"-Duser.language=en"
|
||||
}
|
||||
|
||||
@ -64,11 +64,14 @@ dependencies {
|
||||
testImplementation(libs.mockk.mockk)
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<Test> {
|
||||
useJUnitPlatform()
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = Runtime.getRuntime().availableProcessors()
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC"
|
||||
}
|
||||
tasks.withType<Test>().configureEach {
|
||||
useJUnitPlatform()
|
||||
@Suppress("MagicNumber")
|
||||
forkEvery = 100
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
|
||||
// Explicitly setting the user Country and Language because tests assume en-US
|
||||
"-Duser.country=US" +
|
||||
"-Duser.language=en"
|
||||
}
|
||||
|
||||
@ -74,11 +74,14 @@ dependencies {
|
||||
testFixturesImplementation(libs.kotlinx.coroutines.test)
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<Test> {
|
||||
useJUnitPlatform()
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = Runtime.getRuntime().availableProcessors()
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC"
|
||||
}
|
||||
tasks.withType<Test>().configureEach {
|
||||
useJUnitPlatform()
|
||||
@Suppress("MagicNumber")
|
||||
forkEvery = 100
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
|
||||
// Explicitly setting the user Country and Language because tests assume en-US
|
||||
"-Duser.country=US" +
|
||||
"-Duser.language=en"
|
||||
}
|
||||
|
||||
@ -5,5 +5,13 @@ kotlin.code.style=official
|
||||
kotlin.compilerArgs=-Xjspecify-annotations=strict, -Xtype-enhancement-improvements-strict-mode
|
||||
|
||||
org.gradle.caching=true
|
||||
org.gradle.configuration-cache=true
|
||||
org.gradle.configuration-cache.parallel=true
|
||||
org.gradle.jvmargs=-Xmx4g -XX:+UseParallelGC -Dfile.encoding=UTF-8
|
||||
org.gradle.parallel=true
|
||||
|
||||
# Disable build features that are enabled by default and we do not need
|
||||
# developer.android.com/reference/tools/gradle-api/7.4/com/android/build/api/dsl/BuildFeatures
|
||||
android.defaults.buildfeatures.renderscript=false
|
||||
android.defaults.buildfeatures.resvalues=false
|
||||
android.defaults.buildfeatures.shaders=false
|
||||
|
||||
@ -79,11 +79,14 @@ dependencies {
|
||||
testFixturesImplementation(libs.square.okhttp.mockwebserver)
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<Test> {
|
||||
useJUnitPlatform()
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = Runtime.getRuntime().availableProcessors()
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC"
|
||||
}
|
||||
tasks.withType<Test>().configureEach {
|
||||
useJUnitPlatform()
|
||||
@Suppress("MagicNumber")
|
||||
forkEvery = 100
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
|
||||
// Explicitly setting the user Country and Language because tests assume en-US
|
||||
"-Duser.country=US" +
|
||||
"-Duser.language=en"
|
||||
}
|
||||
|
||||
@ -118,10 +118,14 @@ dependencies {
|
||||
testImplementation(testFixtures(project(":ui")))
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<Test> {
|
||||
useJUnitPlatform()
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = Runtime.getRuntime().availableProcessors()
|
||||
}
|
||||
tasks.withType<Test>().configureEach {
|
||||
useJUnitPlatform()
|
||||
@Suppress("MagicNumber")
|
||||
forkEvery = 100
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
|
||||
// Explicitly setting the user Country and Language because tests assume en-US
|
||||
"-Duser.country=US" +
|
||||
"-Duser.language=en"
|
||||
}
|
||||
|
||||
@ -114,13 +114,15 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<Test> {
|
||||
useJUnitPlatform()
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = Runtime.getRuntime().availableProcessors()
|
||||
@Suppress("UselessCallOnNotNull")
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC"
|
||||
android.sourceSets["main"].res.srcDirs("src/test/res")
|
||||
}
|
||||
tasks.withType<Test>().configureEach {
|
||||
useJUnitPlatform()
|
||||
@Suppress("MagicNumber")
|
||||
forkEvery = 100
|
||||
maxHeapSize = "2g"
|
||||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
|
||||
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
|
||||
// Explicitly setting the user Country and Language because tests assume en-US
|
||||
"-Duser.country=US" +
|
||||
"-Duser.language=en"
|
||||
android.sourceSets["main"].res.srcDirs("src/test/res")
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user