Skip to content

Commit 7a8b8af

Browse files
Update build.gradle
1 parent 3a30dc4 commit 7a8b8af

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

core/build.gradle

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,29 @@ compileJava.doFirst {
5858
}
5959

6060
build.doLast {
61-
// Copying core jar as zip inside the mode folder
62-
Files.copy(file("${buildDir}/libs/core.jar").toPath(),
61+
62+
// Need to check the existance of the files before using as the files
63+
// will get generated only if Task :core:jar is not being skipped
64+
// Task :core:jar will be skipped if source files are unchanged or jar task is UP-TO-DATE
65+
66+
if(file("${buildDir}/libs/core.jar").exists()){
67+
// Copying core jar as zip inside the mode folder
68+
Files.copy(file("${buildDir}/libs/core.jar").toPath(),
6369
file("${coreZipPath}").toPath(), REPLACE_EXISTING)
70+
}
6471
// Renaming artifacts for maven publishing
65-
Files.move(file("${buildDir}/libs/core.jar").toPath(),
66-
file("$buildDir/libs/processing-core-${modeVersion}.jar").toPath(), REPLACE_EXISTING);
67-
Files.move(file("${buildDir}/libs/core-sources.jar").toPath(),
68-
file("$buildDir/libs/processing-core-${modeVersion}-sources.jar").toPath(), REPLACE_EXISTING);
69-
Files.move(file("${buildDir}/libs/core.jar.MD5").toPath(),
70-
file("$buildDir/libs/processing-core-${modeVersion}.jar.md5").toPath(), REPLACE_EXISTING);
72+
if(file("${buildDir}/libs/core.jar").exists()){
73+
Files.move(file("${buildDir}/libs/core.jar").toPath(),
74+
file("$buildDir/libs/processing-core-${modeVersion}.jar").toPath(), REPLACE_EXISTING);
75+
}
76+
if(file("${buildDir}/libs/core-sources.jar").exists()){
77+
Files.move(file("${buildDir}/libs/core-sources.jar").toPath(),
78+
file("$buildDir/libs/processing-core-${modeVersion}-sources.jar").toPath(), REPLACE_EXISTING);
79+
}
80+
if(file("${buildDir}/libs/core.jar.MD5").exists()){
81+
Files.move(file("${buildDir}/libs/core.jar.MD5").toPath(),
82+
file("$buildDir/libs/processing-core-${modeVersion}.jar.md5").toPath(), REPLACE_EXISTING);
83+
}
7184
}
7285

7386
ext {

0 commit comments

Comments
 (0)