@@ -25,22 +25,19 @@ plugins {
25
25
id ' idea'
26
26
27
27
// intershop test plugin
28
- id ' com.intershop.gradle.test' version ' 2.1.0'
29
-
30
- // plugin for documentation
31
- id ' org.asciidoctor.convert' version ' 1.5.3'
28
+ id ' com.intershop.gradle.test' version ' 2.2.0'
32
29
33
30
// publish plugin
34
31
id ' maven-publish'
35
32
33
+ // artifact signing - necessary on Maven Central
34
+ id ' signing'
35
+
36
36
// intershop version plugin
37
- id ' com.intershop.gradle.scmversion' version ' 2.1.0 '
37
+ id ' com.intershop.gradle.scmversion' version ' 2.7.4 '
38
38
39
39
// plugin for publishing to Gradle Portal
40
- id ' com.gradle.plugin-publish' version ' 0.9.5'
41
-
42
- // plugin for publishing to jcenter
43
- id ' com.jfrog.bintray' version ' 1.7.1'
40
+ id ' com.gradle.plugin-publish' version ' 0.20.0'
44
41
}
45
42
46
43
scm {
@@ -66,49 +63,6 @@ test {
66
63
systemProperty ' intershop.gradle.versions' , ' 2.11, 3.1'
67
64
}
68
65
69
- task copyAsciiDoc {
70
- def outputDir = file(" $buildDir /tmp/asciidoctorSrc" )
71
- def inputFiles = fileTree(dir : rootDir, include : ' **/*.asciidoc' )
72
-
73
- inputs. files inputFiles
74
- outputs. dir outputDir
75
-
76
- doLast {
77
- outputDir. mkdirs()
78
-
79
- copy {
80
- from inputFiles
81
- into outputDir
82
- }
83
- }
84
- }
85
-
86
- asciidoctorj {
87
- noDefaultRepositories = true
88
- }
89
-
90
- asciidoctor {
91
- sourceDir " ${ buildDir} /tmp/asciidoctorSrc"
92
- sources {
93
- include ' README.asciidoc'
94
- }
95
-
96
- backends ' html5' , ' docbook'
97
- options doctype : ' article' ,
98
- ruby : ' erubis'
99
- attributes ' latestRevision' : project. version,
100
- ' toc' :' left' ,
101
- ' toclevels' :' 2' ,
102
- ' source-highlighter' : ' coderay' ,
103
- ' icons' : ' font' ,
104
- ' setanchors' :' true' ,
105
- ' idprefix' :' asciidoc_' ,
106
- ' idseparator' :' -' ,
107
- ' docinfo1' :' true'
108
- }
109
-
110
- asciidoctor. dependsOn copyAsciiDoc
111
-
112
66
jacocoTestReport {
113
67
reports {
114
68
xml. enabled = true // coveralls plugin depends on xml format report
@@ -127,6 +81,13 @@ task sourceJar(type: Jar) {
127
81
from sourceSets. main. allSource
128
82
}
129
83
84
+
85
+ artifacts {
86
+ archives jar
87
+ archives sourceJar
88
+ archives groovydocJar
89
+ }
90
+
130
91
publishing {
131
92
publications {
132
93
intershopMvn(MavenPublication ) {
@@ -140,75 +101,89 @@ publishing {
140
101
classifier " javadoc"
141
102
}
142
103
143
- artifact(new File (buildDir, ' asciidoc/html5/README.html' )) {
144
- classifier ' reference'
145
- }
146
-
147
- artifact(new File (buildDir, ' asciidoc/docbook/README.xml' )) {
148
- classifier = ' docbook'
149
- }
150
-
151
104
pom. withXml {
152
- def Node root = asNode();
105
+ def root = asNode();
153
106
root. appendNode(' name' , project. name)
154
107
root. appendNode(' description' , project. description)
155
108
root. appendNode(' url' , " https:/gitlab.intershop.de/IntershopGradlePlugins/${ project.name} " )
156
109
157
- def scm = root. appendNode( ' scm ' )
158
- scm . appendNode( ' url ' , " https://gitlab.intershop.de/IntershopGradlePlugins/ ${ project.name } " )
159
- scm . appendNode( ' connection ' , " scm:git:https://gitlab. intershop.de/IntershopGradlePlugins/ ${ project.name } .git " )
110
+ def organisation = root. appendNode( ' organization ' )
111
+ organisation . appendNode(" name " , " Intershop Communications AG " )
112
+ organisation . appendNode(" url " , " http:// intershop.com " )
160
113
161
- def org = root. appendNode( ' organization' )
162
- org. appendNode( ' name' , ' Intershop Communications' )
163
- org. appendNode( ' url' , ' http://intershop.com' )
114
+ def scm = root. appendNode( ' scm' )
115
+ scm. appendNode( ' url' , " https://github.com/IntershopCommunicationsAG/${ project.name} " )
116
+ scm
. appendNode(
' connection' ,
" [email protected] :IntershopCommunicationsAG/${ project.name} .git" )
117
+ scm
. appendNode(
' developerConnection' ,
" [email protected] :IntershopCommunicationsAG/${ project.name} .git" )
164
118
165
- def license = root. appendNode( ' licenses' ). appendNode( ' license' );
119
+ def license = root. appendNode( ' licenses' ). appendNode( ' license' )
166
120
license. appendNode( ' name' , ' Apache License, Version 2.0' )
167
- license. appendNode( ' url' , ' http://www.apache.org/licenses/LICENSE-2.0' )
121
+ license. appendNode( ' url' , ' http://www.apache.org/licenses/LICENSE-2.0.txt ' )
168
122
license. appendNode( ' distribution' , ' repo' )
123
+
124
+ def developer = root. appendNode(' developers' ). appendNode( ' developer' )
125
+ developer. appendNode( ' id' , ' m-raab' )
126
+ developer. appendNode( ' name' , ' M. Raab' )
127
+ developer
. appendNode(
' email' ,
' [email protected] ' )
128
+
129
+ def pomFile = file(" ${ project.buildDir} /generated-pom.xml" )
130
+ writeTo(pomFile)
131
+ def pomAscFile = signing. sign(pomFile). signatureFiles[0 ]
132
+ artifact(pomAscFile) {
133
+ classifier = null
134
+ extension = ' pom.asc'
135
+ }
136
+ }
137
+
138
+ // create the signed artifacts
139
+ project. tasks. signArchives. signatureFiles. each {
140
+ artifact(it) {
141
+ def matcher = it. file =~ / -(sources|javadoc)\. (jar)\. asc$/
142
+ def ref_matcher = it. file =~ / \. html\. asc$/
143
+ def doc_matcher = it. file =~ / \. xml\. asc$/
144
+ if (matcher. find()) {
145
+ classifier = matcher. group(1 )
146
+ extension = " jar.asc"
147
+ } else {
148
+ if (ref_matcher. find()) {
149
+ classifier = ' reference'
150
+ extension = ' html.asc'
151
+ }
152
+ else if (doc_matcher. find()) {
153
+ classifier = ' docbook'
154
+ extension = ' xml.asc'
155
+ } else {
156
+ classifier = null
157
+ extension = ' jar.asc'
158
+ }
159
+ }
160
+
161
+ }
169
162
}
170
163
}
171
164
}
172
- }
173
-
174
- publish. dependsOn asciidoctor
175
-
176
- bintray {
177
- user = System . getenv(' BINTRAY_USER' )
178
- key = System . getenv(' BINTRAY_KEY' )
179
- pkg {
180
- repo = ' maven'
181
- name = project. name
182
- userOrg = ' intershopcommunicationsag'
183
-
184
- licenses = [' Apache-2.0' ]
185
- vcsUrl = " https://github.com/IntershopCommunicationsAG/${ project.name} "
186
-
187
- desc = project. description
188
- websiteUrl = " https://github.com/IntershopCommunicationsAG/${ project.name} "
189
- issueTrackerUrl = " https://github.com/IntershopCommunicationsAG/${ project.name} /issues"
190
-
191
- labels = [' intershop' , ' gradle' , ' plugin' , ' build' , ' javacc' ]
192
- publicDownloadNumbers = true
193
-
194
- version {
195
- name = project. version
196
- desc = " ${ project.description} ${ project.version} "
197
- released = new Date ()
198
- vcsTag = project. version
165
+ repositories {
166
+ maven {
167
+ def releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2"
168
+ def snapshotsRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots"
169
+ url = uri(version. toString(). endsWith(" SNAPSHOT" ) ? snapshotsRepoUrl : releasesRepoUrl)
170
+ credentials {
171
+ username = sonatypeUsername
172
+ password = sonatypePassword
173
+ }
199
174
}
200
-
201
- publications = [' intershopMvn' ]
202
175
}
203
176
}
204
177
205
- bintrayUpload. dependsOn asciidoctor
178
+ signing {
179
+ sign configurations. archives
180
+ }
206
181
207
182
pluginBundle {
208
183
website = " https://github.com/IntershopCommunicationsAG/${ project.name} "
209
184
vcsUrl = " https://github.com/IntershopCommunicationsAG/${ project.name} "
210
185
description = project. description
211
- tags = [' intershop' , ' gradle ' , ' plugin ' , ' build' , ' javacc' ]
186
+ tags = [' intershop' , ' build' , ' javacc' ]
212
187
213
188
plugins {
214
189
escrowPlugin {
@@ -226,5 +201,5 @@ dependencies {
226
201
}
227
202
228
203
repositories {
229
- jcenter ()
204
+ mavenCentral ()
230
205
}
0 commit comments