Slackbot
03/03/2023, 2:16 PMephemient
03/03/2023, 2:20 PMtasks.test {
// Re-use downloaded artifacts to speed up test times
environment("GRADLE_RO_DEP_CACHE", File(gradle.gradleUserHomeDir, "caches"))
}
which is not entirely what you asked for, but sharing the parent's dependency cache with the child does help with build timesAdam
03/03/2023, 2:32 PMAdam
03/03/2023, 2:33 PMAdam
03/03/2023, 2:34 PM./gradlew clean
2. ./gradlew check
- 2 minutes
3. add
tasks.withType<Test>().configureEach {
// Help speed up TestKit tests by re-using dependencies cache (this really helps GitHub Workflows)
// <https://docs.gradle.org/current/userguide/dependency_resolution.html#sub:shared-readonly-cache>
environment("GRADLE_RO_DEP_CACHE", gradle.gradleUserHomeDir.resolve("caches"))
}
4) ./gradlew clean
5) ./gradlew check
- 2 minutes
6) ./gradlew check
- 30 seconds