gradle / kotlin-dsl-samples

Samples builds using the Gradle Kotlin DSL
https://gradle.org/kotlin/
Other
3.71k stars 434 forks source link

Generated Plugin source is not removed if precompiled script plugin is deleted #1306

Closed cfraenkel closed 5 years ago

cfraenkel commented 5 years ago

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

Steps to Reproduce (for bugs)

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
eskatos commented 5 years ago

Thank you @cfraenkel for the very good report! Fix in #1316