@@ -61,15 +61,28 @@ build.doLast {
6161 // Copying ar jar to library folder
6262 File arJar = file(" library/ar.jar" )
6363 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+ }
6673 // 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+ }
7386}
7487
7588ext {
8194 libDependencies = [[group : ' org.p5android' , name : ' processing-core' , version : modeVersion],
8295 [group : ' com.google.ar' , name : ' core' , version : garVersion]]
8396}
84- apply from : " ${ rootProject.projectDir} /scripts/publish-module.gradle"
97+ apply from : " ${ rootProject.projectDir} /scripts/publish-module.gradle"
0 commit comments