KT-43686: Make kapt Gradle task cacheable across machines

Use `@Classpath` for kotlin stdlib input property. This is to
allow cache hits when builds are running on different machines
and path to kotlin stdlib differs.

Test: BuildCacheRelocationIT
This commit is contained in:
Ivan Gavrilovic
2021-01-18 18:08:56 +00:00
committed by nataliya.valtman
parent 771600077c
commit 509ed64917
2 changed files with 3 additions and 2 deletions
@@ -128,7 +128,8 @@ class BuildCacheRelocationIT : BaseGradleIT() {
cacheableTaskNames = listOf(
"kaptKotlin", "kaptGenerateStubsKotlin", "compileKotlin", "compileTestKotlin", "compileJava"
),
initProject = { File(projectDir, "build.gradle").appendText("\nkapt.useBuildCache = true") }
initProject = { File(projectDir, "build.gradle").appendText("\nkapt.useBuildCache = true") },
withAnotherGradleHome = true
),
TestCase("kotlin2JsDceProject",
taskToExecute = arrayOf("assemble", "runDceKotlinJs"),
@@ -50,7 +50,7 @@ abstract class KaptWithoutKotlincTask @Inject constructor(private val workerExec
@get:Input
internal val kotlinAndroidPluginWrapperPluginDoesNotExist = project.plugins.none { it is KotlinAndroidPluginWrapper }
@get:Input
@get:Classpath
internal val kotlinStdlibClasspath = findKotlinStdlibClasspath(project)
@get:Internal