@@ -61,15 +61,28 @@ build.doLast {
61
61
// Copying vr jar to library folder
62
62
File vrJar = file(" library/vr.jar" )
63
63
vrJar. mkdirs();
64
- Files . copy(file(" $buildDir /libs/vr.jar" ). toPath(),
65
- vrJar. 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:vr:jar' is not being skipped
67
+ // Task ':mode:libraries:vr:jar' will be skipped if source files are unchanged or jar task is UP-TO-DATE
68
+
69
+ if (file(" $buildDir /libs/vr.jar" ). exists()){
70
+ Files . copy(file(" $buildDir /libs/vr.jar" ). toPath(),
71
+ vrJar. toPath(), REPLACE_EXISTING );
72
+ }
66
73
// Renaming artifacts for maven publishing
67
- Files . move(file(" $buildDir /libs/vr.jar" ). toPath(),
68
- file(" $buildDir /libs/processing-vr-${ vrLibVersion} .jar" ). toPath(), REPLACE_EXISTING );
69
- Files . move(file(" $buildDir /libs/vr-sources.jar" ). toPath(),
70
- file(" $buildDir /libs/processing-vr-${ vrLibVersion} -sources.jar" ). toPath(), REPLACE_EXISTING );
71
- Files . move(file(" $buildDir /libs/vr.jar.MD5" ). toPath(),
72
- file(" $buildDir /libs/processing-vr-${ vrLibVersion} .jar.md5" ). toPath(), REPLACE_EXISTING );
74
+ if (file(" $buildDir /libs/vr.jar" ). exists()){
75
+ Files . move(file(" $buildDir /libs/vr.jar" ). toPath(),
76
+ file(" $buildDir /libs/processing-vr-${ vrLibVersion} .jar" ). toPath(), REPLACE_EXISTING );
77
+ }
78
+ if (file(" $buildDir /libs/vr-sources.jar" ). exists()){
79
+ Files . move(file(" $buildDir /libs/vr-sources.jar" ). toPath(),
80
+ file(" $buildDir /libs/processing-vr-${ vrLibVersion} -sources.jar" ). toPath(), REPLACE_EXISTING );
81
+ }
82
+ if (file(" $buildDir /libs/vr.jar.MD5" ). exists()){
83
+ Files . move(file(" $buildDir /libs/vr.jar.MD5" ). toPath(),
84
+ file(" $buildDir /libs/processing-vr-${ vrLibVersion} .jar.md5" ). toPath(), REPLACE_EXISTING );
85
+ }
73
86
}
74
87
75
88
ext {
82
95
[group : ' com.google.vr' , name : ' sdk-base' , version : gvrVersion],
83
96
[group : ' com.google.vr' , name : ' sdk-audio' , version : gvrVersion]]
84
97
}
85
- apply from : " ${ rootProject.projectDir} /scripts/publish-module.gradle"
98
+ apply from : " ${ rootProject.projectDir} /scripts/publish-module.gradle"
0 commit comments