@@ -3,14 +3,11 @@ import static java.nio.file.StandardCopyOption.REPLACE_EXISTING
3
3
4
4
plugins {
5
5
id ' aar'
6
- id ' maven-publish'
7
6
}
8
7
9
8
dependencies {
10
9
compileOnly name : " android"
11
-
12
10
compileOnly " org.p5android:processing-core:${ modeVersion} "
13
-
14
11
implementationAar " com.google.vr:sdk-audio:${ gvrVersion} "
15
12
implementationAar " com.google.vr:sdk-base:${ gvrVersion} "
16
13
}
@@ -20,51 +17,6 @@ task sourceJar(type: Jar, dependsOn: classes) {
20
17
from sourceSets. main. allSource
21
18
}
22
19
23
- publishing {
24
- publications {
25
- vrPublication(MavenPublication ) {
26
- from components. java
27
- artifact sourceJar
28
- pom {
29
- groupId = " org.p5android"
30
- artifactId = " processing-vr"
31
- version = " ${ vrLibVersion} "
32
- packaging = " jar"
33
- licenses {
34
- license {
35
- name = " GNU Lesser General Public License, version 2.1"
36
- url = " https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt"
37
- distribution = " repo"
38
- }
39
- }
40
- }
41
-
42
- pom. withXml {
43
- // inserting the dependencies node
44
- def dependenciesNode = asNode(). appendNode(' dependencies' )
45
- // start adding dependency nodes inside dependencies node
46
- def processingCoreDependencyNode = dependenciesNode. appendNode(' dependency' )
47
- processingCoreDependencyNode. appendNode(' groupId' , ' org.p5android' )
48
- processingCoreDependencyNode. appendNode(' artifactId' , ' processing-core' )
49
- processingCoreDependencyNode. appendNode(' version' , " ${ modeVersion} " )
50
- processingCoreDependencyNode. appendNode(' scope' , ' implementation' )
51
-
52
- def googleVRDependencyNode = dependenciesNode. appendNode(' dependency' )
53
- googleVRDependencyNode. appendNode(' groupId' , ' com.google.vr' )
54
- googleVRDependencyNode. appendNode(' artifactId' , ' sdk-base' )
55
- googleVRDependencyNode. appendNode(' version' , " ${ gvrVersion} " )
56
- googleVRDependencyNode. appendNode(' scope' , ' implementation' )
57
-
58
- def googleVRAudioDependencyNode = dependenciesNode. appendNode(' dependency' )
59
- googleVRAudioDependencyNode. appendNode(' groupId' , ' com.google.vr' )
60
- googleVRAudioDependencyNode. appendNode(' artifactId' , ' sdk-audio' )
61
- googleVRAudioDependencyNode. appendNode(' version' , " ${ gvrVersion} " )
62
- googleVRAudioDependencyNode. appendNode(' scope' , ' implementation' )
63
- }
64
- }
65
- }
66
- }
67
-
68
20
sourceSets {
69
21
main {
70
22
java {
@@ -73,7 +25,6 @@ sourceSets {
73
25
}
74
26
}
75
27
76
-
77
28
// Does not work because of Processing-specific tags in source code, such as @webref
78
29
task javadocJar (type : Jar , dependsOn : javadoc) {
79
30
classifier = " javadoc"
@@ -94,7 +45,6 @@ clean.doFirst {
94
45
delete " library/vr.jar"
95
46
}
96
47
97
-
98
48
compileJava. doFirst {
99
49
String [] deps = [" sdk-audio.jar" ,
100
50
" sdk-base.jar" ,
@@ -107,35 +57,29 @@ compileJava.doFirst {
107
57
}
108
58
}
109
59
110
-
111
60
build. doLast {
112
- // If xml doesn't exist
113
- def pomfile = file(" ${ buildDir} /publications/vrPublication/pom-default.xml" )
114
- if (! pomfile. exists()) {
115
- println (" ************************************************************************************************\n " +
116
- " * *\n " +
117
- " * File not found: root/mode/libraries/vr/build/publications/corePublication/pom-default.xml *\n " +
118
- " * First execute the following command to generate the file: *\n " +
119
- " * gradle generatePomFileForvrPublicationPublication *\n " +
120
- " * *\n " +
121
- " ************************************************************************************************"
122
- )
123
- }
124
- // // Copying vr jar to library folder
61
+ // Copying vr jar to library folder
125
62
File vrJar = file(" library/vr.jar" )
126
63
vrJar. mkdirs();
127
64
Files . copy(file(" $buildDir /libs/vr.jar" ). toPath(),
128
- vrJar. toPath(), REPLACE_EXISTING );
129
-
130
- // // Copying the files for release on JCentral
131
- File distFolder = file(" dist" );
132
- distFolder. mkdirs();
65
+ vrJar. toPath(), REPLACE_EXISTING );
66
+ // Renaming artifacts for maven publishing
133
67
Files . copy(file(" $buildDir /libs/vr.jar" ). toPath(),
134
- file(" dist /processing-vr-${ vrLibVersion} .jar" ). toPath(), REPLACE_EXISTING );
68
+ file(" $b uildDir /libs /processing-vr-${ vrLibVersion} .jar" ). toPath(), REPLACE_EXISTING );
135
69
Files . copy(file(" $buildDir /libs/vr-sources.jar" ). toPath(),
136
- file(" dist /processing-vr-${ vrLibVersion} -sources.jar" ). toPath(), REPLACE_EXISTING );
70
+ file(" $b uildDir /libs /processing-vr-${ vrLibVersion} -sources.jar" ). toPath(), REPLACE_EXISTING );
137
71
Files . copy(file(" $buildDir /libs/vr.jar.MD5" ). toPath(),
138
- file(" dist/processing-vr-${ vrLibVersion} .jar.md5" ). toPath(), REPLACE_EXISTING );
139
- Files . copy(file(" $buildDir /publications/vrPublication/pom-default.xml" ). toPath(),
140
- file(" dist/processing-vr-${ vrLibVersion} .pom" ). toPath(), REPLACE_EXISTING );
72
+ file(" $buildDir /libs/processing-vr-${ vrLibVersion} .jar.md5" ). toPath(), REPLACE_EXISTING );
73
+ }
74
+
75
+ ext {
76
+ libName = ' processing-vr'
77
+ libVersion = vrLibVersion
78
+ libJar = " ${ buildDir} /libs/${ libName} -${ libVersion} .jar"
79
+ libSrc = " ${ buildDir} /libs/${ libName} -${ libVersion} -sources.jar"
80
+ libMd5 = " ${ buildDir} /libs/${ libName} -${ libVersion} -sources.jar.md5"
81
+ libDependencies = [[group : ' org.p5android' , name : ' processing-core' , version : modeVersion],
82
+ [group : ' com.google.vr' , name : ' sdk-base' , version : gvrVersion],
83
+ [group : ' com.google.vr' , name : ' sdk-audio' , version : gvrVersion]]
141
84
}
85
+ apply from : " ${ rootProject.projectDir} /scripts/publish-module.gradle"
0 commit comments