@@ -61,15 +61,28 @@ build.doLast {
61
61
// Copying ar jar to library folder
62
62
File arJar = file(" library/ar.jar" )
63
63
arJar. mkdirs();
64
- Files . copy(file(" $buildDir /libs/ar.jar" ). toPath(),
65
- arJar. toPath(), REPLACE_EXISTING );
64
+
65
+ // Need to check the existance of the files before using as the files
66
+ // will get generated only if Task ':mode:libraries:ar:jar' is not being skipped
67
+ // Task ':mode:libraries:ar:jar' will be skipped if source files are unchanged or jar task is UP-TO-DATE
68
+
69
+ if (file(" $buildDir /libs/ar.jar" ). exists()){
70
+ Files . copy(file(" $buildDir /libs/ar.jar" ). toPath(),
71
+ arJar. toPath(), REPLACE_EXISTING );
72
+ }
66
73
// Renaming artifacts for maven publishing
67
- Files . move(file(" $buildDir /libs/ar.jar" ). toPath(),
68
- file(" $buildDir /libs/processing-ar-${ arLibVersion} .jar" ). toPath(), REPLACE_EXISTING );
69
- Files . move(file(" $buildDir /libs/ar-sources.jar" ). toPath(),
70
- file(" $buildDir /libs/processing-ar-${ arLibVersion} -sources.jar" ). toPath(), REPLACE_EXISTING );
71
- Files . move(file(" $buildDir /libs/ar.jar.MD5" ). toPath(),
72
- file(" $buildDir /libs/processing-ar-${ arLibVersion} .jar.md5" ). toPath(), REPLACE_EXISTING );
74
+ if (file(" $buildDir /libs/ar.jar" ). exists()){
75
+ Files . move(file(" $buildDir /libs/ar.jar" ). toPath(),
76
+ file(" $buildDir /libs/processing-ar-${ arLibVersion} .jar" ). toPath(), REPLACE_EXISTING );
77
+ }
78
+ if (file(" $buildDir /libs/ar-sources.jar" ). exists()){
79
+ Files . move(file(" $buildDir /libs/ar-sources.jar" ). toPath(),
80
+ file(" $buildDir /libs/processing-ar-${ arLibVersion} -sources.jar" ). toPath(), REPLACE_EXISTING );
81
+ }
82
+ if (file(" $buildDir /libs/ar.jar.MD5" ). exists()){
83
+ Files . move(file(" $buildDir /libs/ar.jar.MD5" ). toPath(),
84
+ file(" $buildDir /libs/processing-ar-${ arLibVersion} .jar.md5" ). toPath(), REPLACE_EXISTING );
85
+ }
73
86
}
74
87
75
88
ext {
81
94
libDependencies = [[group : ' org.p5android' , name : ' processing-core' , version : modeVersion],
82
95
[group : ' com.google.ar' , name : ' core' , version : garVersion]]
83
96
}
84
- apply from : " ${ rootProject.projectDir} /scripts/publish-module.gradle"
97
+ apply from : " ${ rootProject.projectDir} /scripts/publish-module.gradle"
0 commit comments