This repository was archived by the owner on Dec 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 432
This repository was archived by the owner on Dec 3, 2025. It is now read-only.
Generated Plugin source is not removed if precompiled script plugin is deleted #1306
Copy link
Copy link
Closed
Description
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.
Steps to Reproduce (for bugs)
- use https://github.com/gradle/kotlin-dsl/blob/master/samples/project-with-buildSrc as a base
- delete build.gradle.kts
- build the project:
gradlew build - verify that
buildSrc\build\generated-sources\kotlin-dsl-plugins\kotlin\MyPluginPlugin.ktexists (expected, as the script plugin still exists) - delete
kotlin-dsl/samples/project-with-buildSrc/buildSrc/src/main/kotlin/my-plugin.gradle.kts - build the project
gradlew build - verify that
buildSrc\build\generated-sources\kotlin-dsl-plugins\kotlin\MyPluginPlugin.ktstill 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
JLLeitschuh, eskatos, mkobit and CloseFile