-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
274 lines (238 loc) · 7.51 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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
ext.projectVersion = '1.1.0'
ext.projectLocation = "https://github.com/iamthechad/javadoc2dash"
apply plugin: 'com.github.kt3k.coveralls'
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath "com.gradle.publish:plugin-publish-plugin:0.9.5"
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
repositories {
jcenter()
}
}
subprojects {
sourceCompatibility = 1.7
version = "$projectVersion"
group = "com.megatome.javadoc2dash"
def javaApiUrl = 'http://docs.oracle.com/javase/1.7.0/docs/api/'
def groovyApiUrl = 'http://groovy-lang.org/gapi/'
tasks.withType(Javadoc) {
options.links(javaApiUrl, groovyApiUrl)
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
apply plugin: 'findbugs'
findbugs {
toolVersion = "3.0.0"
// Don't worry about test classes
sourceSets = [sourceSets.main]
}
tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
}
def publishedProjects = subprojects.findAll {
!it.path.startsWith(':j2d-cli') && !it.path.startsWith(':j2d-sample')
}
task jacocoRootReport(type: JacocoReport) {
dependsOn = subprojects.test
additionalSourceDirs = files(publishedProjects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(publishedProjects.sourceSets.main.allSource.srcDirs)
classDirectories = files(publishedProjects.sourceSets.main.output)
executionData = files(publishedProjects.jacocoTestReport.executionData)
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
onlyIf = {
true
}
doFirst {
executionData = files(executionData.findAll {
it.exists()
})
}
}
coveralls {
sourceDirs = publishedProjects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
}
project(":j2d-cli") {
apply plugin:'application'
mainClassName = "com.megatome.j2d.Main"
dependencies {
compile project(":javadoc2dash-api")
compile 'net.sf.jopt-simple:jopt-simple:4.8'
}
test {
jacoco {
excludes = ["com.megatome.j2d.Main"]
}
}
}
project(":j2d-gradle") {
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: "com.gradle.plugin-publish"
archivesBaseName = 'javadoc2dash-plugin'
dependencies {
compile gradleApi()
compile localGroovy()
compile project(":javadoc2dash-api")
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile("org.spockframework:spock-core:1.0-groovy-2.3") {
exclude group: "org.codehaus.groovy"
}
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "file://$projectDir/../../repo")
}
}
}
pluginBundle {
website = "$projectLocation"
vcsUrl = "$projectLocation"
description = 'Create Dash docsets from Javadoc'
tags = ['javadoc', 'dash']
plugins {
javadoc2dashPlugin {
id = 'com.megatome.javadoc2dash'
displayName = 'Javadoc to Dash'
}
}
}
}
project(":javadoc2dash-api") {
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
archivesBaseName = 'javadoc2dash-api'
dependencies {
compile 'commons-io:commons-io:2.4'
compile 'org.apache.commons:commons-lang3:3.3.2'
compile 'org.xerial:sqlite-jdbc:3.8.7'
compile 'org.jsoup:jsoup:1.8.2'
compile "org.slf4j:slf4j-api:1.7.12"
compile "org.slf4j:slf4j-simple:1.7.12"
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile 'com.googlecode.plist:dd-plist:1.16'
}
tasks.withType(Test) { task ->
task.dependsOn ":j2d-sample:javadoc"
task.dependsOn ":j2d-sample:javadocSplit"
def sampleProject = findProject(":j2d-sample")
systemProperties 'j2d-sample-javadoc': "${sampleProject.docsDir}/javadoc"
systemProperties 'j2d-sample-javadoc-split': "${sampleProject.docsDir}/javadocSplit"
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "file://$projectDir/../../repo")
}
}
}
def pomConfig = {
scm {
connection "scm:git:[email protected]:iamthechad/javadoc2dash.git"
developerConnection "scm:git:[email protected]:iamthechad/javadoc2dash.git"
url "$projectLocation"
}
issueManagement {
system "Github Issue Tracker"
url "$projectLocation/issues"
}
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "iamthechad"
name "Chad Johnston"
email "[email protected]"
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifactId archivesBaseName
artifact sourceJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('name', 'Javadoc to Dash API')
root.appendNode('url', "$projectLocation")
root.appendNode('description', 'API for creating Dash docsets from Javadoc')
root.children().last() + pomConfig
}
}
}
}
bintray {
user = project.hasProperty('bintray_user') ? project.bintray_user : System.getenv('bintray_user')
key = project.hasProperty('bintray_key') ? project.bintray_key : System.getenv('bintray_key')
publications = ['mavenJava']
dryRun = false
publish = false
pkg {
repo = 'maven'
name = 'javadoc2dash-api'
desc = 'API for creating Dash docsets from Javadoc'
websiteUrl = "$projectLocation"
issueTrackerUrl = "$projectLocation/issues"
vcsUrl = projectLocation + ".git"
licenses = ['Apache-2.0']
labels = ['javadoc', 'dash', 'api']
publicDownloadNumbers = true
version {
name = project.version
vcsTag = projectVersion
}
}
}
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
}
project(":j2d-sample") {
javadoc {
options.splitIndex = false
}
task javadocSplit(type: Javadoc) {
source = sourceSets.main.allJava
destinationDir = file("${project.docsDir}/javadocSplit")
options.splitIndex = true
}
}