The generated plugin class in buildSrc/build/generated-sources/kotlin-dsl-plugins is not deleted when the corresponding *.gradle.kts source file is removed by the user. This generated plugin is still compiled and packaged and as a result causes a different build cache key compared to a build from a clean checkout after the script plugin removal was commited.
Expected Behavior
If I delete a precompiled script plugin (the *.gradle.kts file in the buildSrc/src/kotlin folder) then the corresponding automatically generated plugin class should be removed on the next build.
Current Behavior
The generated plugin class remains in the generated-sources/kotlin-dsl-plugins folder and is part of the build cache key (as it is on the classpath)
Context
our project gets built on developer machines and CI servers that push to a central build cache.
A script plugin was deleted by a developer and this change was commited.
Builds on developer machines still contained the generated plugin class while the ci machines did not contain them. This resulted in build cache misses for developers untill they cleaned their buildSrc/build folder.
verify that buildSrc\build\generated-sources\kotlin-dsl-plugins\kotlin\MyPluginPlugin.kt still exists -> should have been removed (but isn't) as the corresponding script plugin was deleted
Your Environment
------------------------------------------------------------
Gradle 5.0
------------------------------------------------------------
Build time: 2018-11-26 11:48:43 UTC
Revision: 7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987
Kotlin DSL: 1.0.4
Kotlin: 1.3.10
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 1.8.0_171 (Oracle Corporation 25.171-b11)
OS: Windows 10 10.0 amd64
The generated plugin class in
buildSrc/build/generated-sources/kotlin-dsl-plugins
is not deleted when the corresponding*.gradle.kts
source file is removed by the user. This generated plugin is still compiled and packaged and as a result causes a different build cache key compared to a build from a clean checkout after the script plugin removal was commited.Expected Behavior
If I delete a precompiled script plugin (the
*.gradle.kts
file in thebuildSrc/src/kotlin
folder) then the corresponding automatically generated plugin class should be removed on the next build.Current Behavior
The generated plugin class remains in the generated-sources/kotlin-dsl-plugins folder and is part of the build cache key (as it is on the classpath)
Context
Steps to Reproduce (for bugs)
gradlew build
buildSrc\build\generated-sources\kotlin-dsl-plugins\kotlin\MyPluginPlugin.kt
exists (expected, as the script plugin still exists)kotlin-dsl/samples/project-with-buildSrc/buildSrc/src/main/kotlin/my-plugin.gradle.kts
gradlew build
buildSrc\build\generated-sources\kotlin-dsl-plugins\kotlin\MyPluginPlugin.kt
still exists -> should have been removed (but isn't) as the corresponding script plugin was deletedYour Environment