Skip to content

Commit a469351

Browse files
committed
combine copy and rename into single task
HAving these as two separate tasks caused copy to always be out-of-date when rename is run, and rename to be out-of-date when rename is done. Gradle does not like inplace updates of any files. By combining it, the copy+rename now appear to produce a new artificat that will be up-to-date if no sources have changed. This caused lot of downstream jars to get rebuilt since this jar is always out-of-dat and rebuilt everytime.
1 parent 6b62550 commit a469351

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

metadata-events/mxe-schemas/build.gradle

+6-4
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ generateDataTemplate.dependsOn copyMetadataModels
1919
mainCopySchemas.dependsOn copyMetadataModels
2020
pegasus.main.generationModes = [PegasusGenerationMode.PEGASUS, PegasusGenerationMode.AVRO]
2121

22-
task copyOriginalAvsc(type: Copy, dependsOn: generateAvroSchema) {
22+
task renameNamespace(type: Copy, dependsOn: generateAvroSchema) {
2323
from("src/mainGeneratedAvroSchema/avro")
2424
into file("src/renamed/avro")
25-
}
2625

27-
task renameNamespace(type: Exec, dependsOn: copyOriginalAvsc) {
28-
commandLine 'bash', './rename-namespace.sh'
26+
doLast {
27+
project.exec {
28+
commandLine 'bash', './rename-namespace.sh'
29+
}
30+
}
2931
}
3032

3133
build.dependsOn renameNamespace

0 commit comments

Comments
 (0)