Skip to content

Commit f01c829

Browse files
committed
Fix missing dependencies between preprocessResources tasks (fixes #1)
Technically also between the other types of preprocess tasks but those generally had a dependency via their classpath requirement anyway.
1 parent b744ea7 commit f01c829

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/kotlin/com/replaymod/gradle/preprocess/PreprocessPlugin.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class PreprocessPlugin : Plugin<Project> {
5858
val preprocessedResources = File(project.buildDir, "preprocessed/$name/resources")
5959

6060
val preprocessJava = project.tasks.register<PreprocessTask>("preprocess${cName}Java") {
61+
inherited.tasks.findByPath("preprocess${cName}Java")?.let { dependsOn(it) }
6162
source = inherited.file(inheritedSourceSet.java.srcDirs.first())
6263
generated = preprocessedJava
6364
compileTask(inherited.tasks["compile${cName}Java"] as AbstractCompile)
@@ -75,6 +76,7 @@ class PreprocessPlugin : Plugin<Project> {
7576

7677
if (kotlin) {
7778
val preprocessKotlin = project.tasks.register<PreprocessTask>("preprocess${cName}Kotlin") {
79+
inherited.tasks.findByPath("preprocess${cName}Kotlin")?.let { dependsOn(it) }
7880
source = inherited.file(inheritedSourceSet.withGroovyBuilder { getProperty("kotlin") as SourceDirectorySet }.srcDirs.first())
7981
generated = preprocessedKotlin
8082
compileTask(inherited.tasks["compile${cName}Kotlin"] as AbstractCompile)
@@ -91,6 +93,7 @@ class PreprocessPlugin : Plugin<Project> {
9193
}
9294

9395
val preprocessResources = project.tasks.register<PreprocessTask>("preprocess${cName}Resources") {
96+
inherited.tasks.findByPath("preprocess${cName}Resources")?.let { dependsOn(it) }
9497
source = inherited.file(inheritedSourceSet.resources.srcDirs.first())
9598
generated = preprocessedResources
9699
vars.convention(ext.vars)

0 commit comments

Comments
 (0)