@@ -58,16 +58,29 @@ compileJava.doFirst {
58
58
}
59
59
60
60
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(),
63
69
file(" ${ coreZipPath} " ). toPath(), REPLACE_EXISTING )
70
+ }
64
71
// 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
+ }
71
84
}
72
85
73
86
ext {
0 commit comments