-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
225 lines (178 loc) · 5.79 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
plugins {
// project plugins
id 'java-gradle-plugin'
id 'groovy'
// test coverage
id 'jacoco'
// ide plugin
id 'idea'
// publish plugin
id 'maven-publish'
// intershop version plugin
id 'com.intershop.gradle.scmversion' version '3.6.0'
// plugin for documentation
id 'org.asciidoctor.convert' version '1.5.8.1'
// plugin for publishing to Gradle Portal
id 'com.gradle.plugin-publish' version '0.9.10'
// plugin for publishing to jcenter
id 'com.jfrog.bintray' version '1.8.4'
}
scm {
version {
initialVersion = '1.0.0'
}
}
// release configuration
group 'com.intershop.gradle.dependencyanalysis'
description 'Gradle dependency analysis plugin'
version = scm.version.version
gradlePlugin {
plugins {
dependencyanalysisplugin {
id = 'com.intershop.gradle.dependencyanalysis'
implementationClass = 'com.intershop.gradle.analysis.DependencyAnalysisPlugin'
}
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
// set correct project status
if (project.version.endsWith('-SNAPSHOT')) {
status = 'snapshot'
}
test {
// Gradle versions for test
systemProperty 'intershop.gradle.versions', '4.6,4.9'
}
task copyAsciiDoc {
def outputDir = file("$buildDir/tmp/asciidoctorSrc")
def inputFiles = fileTree(dir: rootDir, include: '**/*.asciidoc')
inputs.files inputFiles
outputs.dir outputDir
doLast {
outputDir.mkdirs()
copy {
from inputFiles
into outputDir
}
}
}
asciidoctorj {
noDefaultRepositories = true
}
asciidoctor {
sourceDir "${buildDir}/tmp/asciidoctorSrc"
sources {
include 'README.asciidoc'
}
backends 'html5', 'docbook'
options doctype : 'article',
ruby : 'erubis'
attributes 'latestRevision' : project.version,
'toc':'left',
'toclevels':'2',
'source-highlighter' : 'coderay',
'icons': 'font',
'setanchors':'true',
'idprefix':'asciidoc_',
'idseparator':'-',
'docinfo1':'true'
}
asciidoctor.dependsOn copyAsciiDoc
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
task groovydocJar(type: Jar) {
dependsOn groovydoc
classifier = 'javadoc'
from groovydoc.destinationDir
}
// additional sources artifact
task sourceJar(type: Jar) {
from sourceSets.main.allSource
}
publishing {
publications {
intershopMvn(MavenPublication) {
from components.java
artifact sourceJar {
classifier 'sources'
}
artifact groovydocJar {
classifier "javadoc"
}
artifact(new File(buildDir, 'asciidoc/html5/README.html')) {
classifier 'reference'
}
artifact(new File(buildDir, 'asciidoc/docbook/README.xml')) {
classifier = 'docbook'
}
pom.withXml {
Node root = asNode()
root.appendNode('name', project.name)
root.appendNode('description', project.description)
root.appendNode('url', "https:/gitlab.intershop.de/IntershopGradlePlugins/${project.name}")
def scm = root.appendNode( 'scm' )
scm.appendNode( 'url', "https://gitlab.intershop.de/IntershopGradlePlugins/${project.name}")
scm.appendNode( 'connection', "scm:git:https://gitlab.intershop.de/IntershopGradlePlugins/${project.name}.git")
def org = root.appendNode( 'organization' )
org.appendNode( 'name', 'Intershop Communications' )
org.appendNode( 'url', 'http://intershop.com' )
def license = root.appendNode( 'licenses' ).appendNode( 'license' )
license.appendNode( 'name', 'Apache License, Version 2.0' )
license.appendNode( 'url', 'http://www.apache.org/licenses/LICENSE-2.0' )
license.appendNode( 'distribution', 'repo' )
}
}
}
}
publish.dependsOn asciidoctor
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
pkg {
repo = 'maven'
name = project.name
userOrg = 'intershopcommunicationsag'
licenses = ['Apache-2.0']
vcsUrl = "https://github.com/IntershopCommunicationsAG/${project.name}"
desc = project.description
websiteUrl = "https://github.com/IntershopCommunicationsAG/${project.name}"
issueTrackerUrl = "https://github.com/IntershopCommunicationsAG/${project.name}/issues"
labels = ['intershop', 'gradle', 'plugin', 'dependency', 'analysis']
publicDownloadNumbers = true
version {
name = project.version
desc = "${project.description} ${project.version}"
released = new Date()
vcsTag = project.version
}
publications = ['intershopMvn']
}
}
bintrayUpload.dependsOn asciidoctor
pluginBundle {
website = "https://github.com/IntershopCommunicationsAG/${project.name}"
vcsUrl = "https://github.com/IntershopCommunicationsAG/${project.name}"
description = project.description
tags = ['intershop', 'gradle', 'plugin', 'dependency', 'analysis']
plugins {
dependencyanalysisplugin {
id = gradlePlugin.plugins.dependencyanalysisplugin.id
displayName = project.description
}
}
}
dependencies {
compile 'org.ow2.asm:asm:6.2'
compile 'org.apache.commons:commons-collections4:4.1'
testCompile 'com.intershop.gradle.test:test-gradle-plugin:3.0.0'
testCompile gradleTestKit()
testCompile 'commons-io:commons-io:2.2'
}
repositories {
jcenter()
}