Skip to content

Commit

Permalink
Tweak Gradle flgas for speeding up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Jul 19, 2024
1 parent 9259fcd commit af2ed18
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ allprojects {
}
}
}

tasks.withType<Test>().configureEach {
// https://docs.gradle.org/8.8/userguide/performance.html#execute_tests_in_parallel
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
}
}

apiValidation {
Expand Down
8 changes: 7 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
org.gradle.jvmargs=-Xmx1536m
android.defaults.buildfeatures.resvalues=false
android.defaults.buildfeatures.shaders=false
android.useAndroidX=true

kotlin.code.style=official

org.gradle.caching=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx4g
org.gradle.parallel=true

SONATYPE_HOST=S01
RELEASE_SIGNING_ENABLED=true

Expand Down
18 changes: 15 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
pluginManagement {
repositories {
google()
gradlePluginPortal()
google {
content {
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
includeGroupByRegex("androidx.*")
}
}
mavenCentral()
gradlePluginPortal()
}
}
@Suppress("UnstableApiUsage")
dependencyResolutionManagement {
// repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
google {
content {
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
includeGroupByRegex("androidx.*")
}
}
mavenCentral()
}
}
Expand Down

0 comments on commit af2ed18

Please sign in to comment.