Skip to content

Commit 2fb5aa2

Browse files
committed
fix: use correct input and outputs for whitelist/blacklist mdg files
1 parent 4a08b91 commit 2fb5aa2

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

test-app/app/build.gradle

+10-7
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,13 @@ task 'collectAllJars' {
688688
}
689689
}
690690

691-
task copyMetadataFilters(type: Copy) {
692-
from "$rootDir/whitelist.mdg", "$rootDir/blacklist.mdg"
693-
into "$BUILD_TOOLS_PATH"
691+
task copyMetadataFilters {
692+
outputs.files("$BUILD_TOOLS_PATH/whitelist.mdg", "$BUILD_TOOLS_PATH/blacklist.mdg")
693+
// use an explicit copy task here because the copy task itselfs marks the whole built-tools as an output!
694+
copy {
695+
from file("$rootDir/whitelist.mdg"), file("$rootDir/blacklist.mdg")
696+
into "$BUILD_TOOLS_PATH"
697+
}
694698
}
695699

696700
task 'copyMetadata' {
@@ -902,7 +906,9 @@ task buildMetadata(type: BuildToolTask) {
902906
inputs.files("$MDG_JAVA_DEPENDENCIES")
903907

904908
// make MDG aware of whitelist.mdg and blacklist.mdg files
905-
inputs.files(project.fileTree(dir: "$rootDir", include: "**/*.mdg"))
909+
// inputs.files(project.fileTree(dir: "$rootDir", include: "**/*.mdg"))
910+
// use explicit inputs as the above makes the whole build-tools directory an input!
911+
inputs.files("$BUILD_TOOLS_PATH/whitelist.mdg", "$BUILD_TOOLS_PATH/blacklist.mdg")
906912

907913
def classesDir = layout.buildDirectory.dir("intermediates/javac").get().asFile
908914
if (classesDir.exists()) {
@@ -1005,9 +1011,6 @@ task buildMetadata(type: BuildToolTask) {
10051011

10061012
task generateTypescriptDefinitions(type: BuildToolTask) {
10071013
if (!findProject(':dts-generator').is(null)) {
1008-
// TODO: find out why this is needed. Running these tasks solo works fine, but when running the whole build, it fails.
1009-
tasks.findByPath(":dts-generator:compileJava").dependsOn(buildMetadata)
1010-
tasks.findByPath(":dts-generator:processResources").dependsOn(buildMetadata)
10111014
dependsOn ':dts-generator:jar'
10121015
}
10131016

0 commit comments

Comments
 (0)