@@ -46,18 +46,19 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
46
46
}
47
47
48
48
task makeJar (type : Jar , dependsOn : classes) {
49
- from(' build/classes/main' )
49
+ from(' build/classes/java/ main' )
50
50
}
51
51
52
- task copyVersion << {
52
+ task copyVersion {
53
+ doLast {
54
+ def versionFile = new File (project. rootDir, versionFile)
55
+ versionFile. write(targetVersionName)
53
56
54
- def versionFile = new File (project. rootDir, versionFile)
55
- versionFile. write(targetVersionName)
56
-
57
- [publishDir, publishMavenDir]. each { dest ->
58
- copy {
59
- from versionFile
60
- into dest
57
+ [publishDir, publishMavenDir]. each { dest ->
58
+ copy {
59
+ from versionFile
60
+ into dest
61
+ }
61
62
}
62
63
}
63
64
}
@@ -122,105 +123,106 @@ def getBasePom(String libName) {
122
123
123
124
}
124
125
125
- task copyJars << {
126
-
127
- def buildDir = ' build/libs/'
128
- copy {
129
- from buildDir
130
- into publishMavenDir
131
- }
126
+ task copyJars {
127
+ doLast {
128
+ def buildDir = ' build/libs/'
129
+ copy {
130
+ from buildDir
131
+ into publishMavenDir
132
+ }
132
133
133
- copy {
134
- from(buildDir)
135
- {
136
- rename targetArtefactId + ' (.*)' , targetArtefactIdDev + ' $1'
137
- }
138
- into publishDir
134
+ copy {
135
+ from(buildDir)
136
+ {
137
+ rename targetArtefactId + ' (.*)' , targetArtefactIdDev + ' $1'
138
+ }
139
+ into publishDir
140
+ }
139
141
}
140
142
}
141
143
142
144
143
145
144
146
145
- task createPomXml << {
146
-
147
- // creating local pom
147
+ task createPomXml {
148
+ doLast {
149
+ // creating local pom
148
150
149
- getBasePom(' moxy-dev' ). withXml {
150
- asNode(). appendNode(' build' ). appendNode(' plugins' ). with {
151
- appendNode(' plugin' ). with {
152
- appendNode(' groupId' , ' org.apache.maven.plugins' )
153
- appendNode(' artifactId' , ' maven-gpg-plugin' )
154
- appendNode(' version' , ' 1.5' )
155
- appendNode(' executions' ). with {
156
- appendNode(' execution' ). with {
157
- appendNode(' id' , ' sign-artifacts' )
158
- appendNode(' phase' , ' verify' )
159
- appendNode(' goals' ). with {
160
- appendNode(' goal' , ' sign' )
151
+ getBasePom(' moxy-dev' ). withXml {
152
+ asNode(). appendNode(' build' ). appendNode(' plugins' ). with {
153
+ appendNode(' plugin' ). with {
154
+ appendNode(' groupId' , ' org.apache.maven.plugins' )
155
+ appendNode(' artifactId' , ' maven-gpg-plugin' )
156
+ appendNode(' version' , ' 1.5' )
157
+ appendNode(' executions' ). with {
158
+ appendNode(' execution' ). with {
159
+ appendNode(' id' , ' sign-artifacts' )
160
+ appendNode(' phase' , ' verify' )
161
+ appendNode(' goals' ). with {
162
+ appendNode(' goal' , ' sign' )
163
+ }
161
164
}
162
165
}
166
+ appendNode(' configuration' ). appendNode(' gpgArguments' ). appendNode(' arg' , ' --no-tty' )
163
167
}
164
- appendNode(' configuration' ). appendNode(' gpgArguments' ). appendNode(' arg' , ' --no-tty' )
165
168
}
166
- }
167
169
168
- asNode(). artifactId* . value = targetArtefactIdDev
170
+ asNode(). artifactId* . value = targetArtefactIdDev
169
171
170
- asNode(). dependencies. ' *' . findAll() {
171
- it. version. text() == ' 4.0.+' && project. configurations. compile. allDependencies. find { dep ->
172
- dep. name == it. artifactId. text()
172
+ asNode(). dependencies. ' *' . findAll() {
173
+ it. version. text() == ' 4.0.+' && project. configurations. compile. allDependencies. find { dep ->
174
+ dep. name == it. artifactId. text()
175
+ }
176
+ }. each() {
177
+ it. version* . value = ' [4.0,)'
173
178
}
174
- }. each() {
175
- it. version* . value = ' [4.0,)'
176
- }
177
179
178
180
179
- }. writeTo(publishDir + " /" + targetArtefactIdDev + " .pom" )
181
+ }. writeTo(publishDir + " /" + targetArtefactIdDev + " .pom" )
180
182
181
- // creating global pom
183
+ // creating global pom
182
184
183
- getBasePom(' moxy' ). withXml {
185
+ getBasePom(' moxy' ). withXml {
184
186
185
- asNode(). appendNode(' build' )
186
- .appendNode(' plugins' )
187
+ asNode(). appendNode(' build' )
188
+ .appendNode(' plugins' )
187
189
188
190
189
- }. writeTo(publishMavenDir + " /" + targetArtefactId + " .pom" )
191
+ }. writeTo(publishMavenDir + " /" + targetArtefactId + " .pom" )
190
192
191
- getBasePom(' moxy' ). withXml {
193
+ getBasePom(' moxy' ). withXml {
192
194
193
- asNode(). appendNode(' build' )
194
- .appendNode(' plugins' )
195
- .appendNode(' plugin' )
196
- .with {
197
- appendNode(' groupId' , ' org.sonatype.plugins' )
198
- appendNode(' artifactId' , ' nexus-staging-maven-plugin' )
199
- appendNode(' version' , ' 1.6.4' )
200
- appendNode(' extensions' , ' true' )
201
- appendNode(' configuration' ). with {
202
- appendNode(' serverId' , ' ossrh' )
203
- appendNode(' nexusUrl' , ' https://oss.sonatype.org/' )
204
- appendNode(' autoReleaseAfterClose' , ' false' )
205
- }
206
- }
207
-
208
- asNode(). appendNode(' distributionManagement' ). with {
209
- appendNode(' snapshotRepository' )
210
- .with {
211
- appendNode(' id' , ' ossrh' )
212
- appendNode(' url' , ' https://oss.sonatype.org/content/repositories/snapshots' )
213
- }
214
- appendNode(' repository' )
195
+ asNode(). appendNode(' build' )
196
+ .appendNode(' plugins' )
197
+ .appendNode(' plugin' )
215
198
.with {
216
- appendNode(' id' , ' ossrh' )
217
- appendNode(' url' , ' https://oss.sonatype.org/service/local/staging/deploy/maven2/' )
199
+ appendNode(' groupId' , ' org.sonatype.plugins' )
200
+ appendNode(' artifactId' , ' nexus-staging-maven-plugin' )
201
+ appendNode(' version' , ' 1.6.4' )
202
+ appendNode(' extensions' , ' true' )
203
+ appendNode(' configuration' ). with {
204
+ appendNode(' serverId' , ' ossrh' )
205
+ appendNode(' nexusUrl' , ' https://oss.sonatype.org/' )
206
+ appendNode(' autoReleaseAfterClose' , ' false' )
207
+ }
218
208
}
219
- }
220
209
221
- }. writeTo(publishMavenDir + " /pom.xml" )
210
+ asNode(). appendNode(' distributionManagement' ). with {
211
+ appendNode(' snapshotRepository' )
212
+ .with {
213
+ appendNode(' id' , ' ossrh' )
214
+ appendNode(' url' , ' https://oss.sonatype.org/content/repositories/snapshots' )
215
+ }
216
+ appendNode(' repository' )
217
+ .with {
218
+ appendNode(' id' , ' ossrh' )
219
+ appendNode(' url' , ' https://oss.sonatype.org/service/local/staging/deploy/maven2/' )
220
+ }
221
+ }
222
222
223
+ }. writeTo(publishMavenDir + " /pom.xml" )
223
224
225
+ }
224
226
}
225
227
226
228
compileJava. dependsOn clearPublishDir
0 commit comments