1
1
plugins {
2
2
// osgi
3
- id " org.jruyi.osgibnd " version " 0.4.0 "
3
+ id " com.diffplug.gradle.osgi.bndmanifest " version " 2.1.1 "
4
4
// code formatting
5
5
id " com.diffplug.gradle.spotless" version " 1.3.3"
6
6
// bintray uploading
7
7
id " com.jfrog.bintray" version " 1.3.1"
8
+ // github pages
9
+ id " org.ajoberstar.github-pages" version " 1.4.2"
8
10
}
9
11
10
12
repositories {
11
13
mavenCentral()
12
- // while we're testing this new guava/durian thing
13
- maven {
14
- url " https://dl.bintray.com/diffplug/opensource/"
15
- }
16
14
ivy {
17
15
// There isn't a reliable way to get eclipse artifacts except through p2 repositories,
18
16
// which gradle does not yet support. For now we're forcing it with ivy.
@@ -48,9 +46,11 @@ sourceCompatibility = VER_JAVA
48
46
targetCompatibility = VER_JAVA
49
47
50
48
dependencies {
49
+ compile " com.diffplug.durian:durian-core:${ VER_DURIAN} "
50
+ compile " com.diffplug.durian:durian-collect:${ VER_DURIAN} "
51
+ compile " com.diffplug.durian:durian-concurrent:${ VER_DURIAN} "
52
+ compile " com.diffplug.durian:durian-debug:${ VER_DURIAN_DEBUG} "
51
53
compile " com.diffplug.durian:durian-rx:${ VER_DURIAN_RX} "
52
- compile " com.diffplug.durian:durian:${ VER_DURIAN} "
53
- compile " com.diffplug.guava:guava-concurrent:${ VER_GUAVA} "
54
54
compile " io.reactivex:rxjava:${ VER_RXJAVA} "
55
55
56
56
compile " p2:org.eclipse.swt:${ VER_SWT} "
@@ -65,23 +65,18 @@ dependencies {
65
65
// ////////
66
66
// OSGI //
67
67
// ////////
68
- jar. manifest {
69
- attributes (
70
- ' Export-Package' : ' com.diffplug.common.swt.*' ,
71
- ' Bundle-SymbolicName' : ' com.diffplug.durian.swt' ,
72
- ' Bundle-RequiredExecutionEnvironment' : ' JavaSE-1.8' ,
73
- ' Bundle-Vendor' : ' DiffPlug' ,
74
- ' Bundle-DocURL' : " https://github.com/${ project.org} /${ project.name} " ,
75
- ' Bundle-License' : " https://github.com/${ project.org} /${ project.name} /blob/v${ project.version} /LICENSE" ,
76
- ' -removeheaders' : ' Bnd-LastModified,Bundle-Name,Created-By,Tool' ,
77
- )
78
- }
68
+ jar. manifest. attributes (
69
+ ' Export-Package' : ' com.diffplug.common.swt.*' ,
70
+ ' Bundle-SymbolicName' : ' com.diffplug.durian.swt' ,
71
+ ' Bundle-RequiredExecutionEnvironment' : ' JavaSE-1.8' ,
72
+ ' Bundle-Vendor' : ' DiffPlug' ,
73
+ ' Bundle-DocURL' : " https://github.com/${ project.org} /${ project.name} " ,
74
+ ' Bundle-License' : " https://github.com/${ project.org} /${ project.name} /blob/v${ project.version} /LICENSE" ,
75
+ ' -removeheaders' : ' Bnd-LastModified,Bundle-Name,Created-By,Tool' ,
76
+ )
79
77
// copy the manifest into the WC
80
- jar << {
81
- def jarContent = java.nio.file.FileSystems . newFileSystem(jar. archivePath. toPath(), null );
82
- def outputFile = project. file(' META-INF/MANIFEST.MF' )
83
- def source = jarContent. getPath(' META-INF/MANIFEST.MF' )
84
- java.nio.file.Files . copy(source, outputFile. toPath(), java.nio.file.StandardCopyOption . REPLACE_EXISTING );
78
+ osgiBndManifest {
79
+ copyTo ' META-INF/MANIFEST.MF'
85
80
}
86
81
87
82
// ///////////////////////
@@ -141,12 +136,11 @@ tasks.eclipse.dependsOn(cleanEclipse)
141
136
// //////////
142
137
// FORMAT //
143
138
// //////////
144
- apply plugin : ' com.diffplug.gradle.spotless'
145
139
spotless {
146
140
java {
147
- licenseHeaderFile ' spotless.license.java' // License header file
148
- importOrderFile ' spotless.importorder' // An import ordering file, exported from Eclipse
149
- eclipseFormatFile ' spotless.eclipseformat.xml' // XML file dumped out by the Eclipse formatter
141
+ licenseHeaderFile ' gradle/ spotless.license.java' // License header file
142
+ importOrderFile ' gradle/ spotless.importorder' // An import ordering file, exported from Eclipse
143
+ eclipseFormatFile ' gradle/ spotless.eclipseformat.xml' // XML file dumped out by the Eclipse formatter
150
144
}
151
145
format ' misc' , {
152
146
target ' **/.gitignore' , ' **/*.gradle' , ' **/*.md' , ' **/*.sh'
@@ -193,6 +187,7 @@ task sourcesJar(type: Jar) {
193
187
from sourceSets. main. allJava
194
188
}
195
189
190
+ def verSnapshot = { it -> it. endsWith(' -SNAPSHOT' ) ? ' snapshot' : VER_DURIAN }
196
191
// Where it's possible to name parameters and methods clearly enough
197
192
// that javadoc is not necessary, why make the code bigger?
198
193
//
@@ -204,11 +199,12 @@ javadoc {
204
199
options. addStringOption(' Xdoclint:none' , ' -quiet' )
205
200
options. header javadocInfo
206
201
options. footer javadocInfo
207
- options. links(' https://diffplug.github.io/durian/javadoc/' + (VER_DURIAN . endsWith(' -SNAPSHOT' ) ? ' snapshot' : VER_DURIAN ) + ' /' )
208
- options. links(' https://diffplug.github.io/durian-rx/javadoc/' + (VER_DURIAN_RX . endsWith(' -SNAPSHOT' ) ? ' snapshot' : VER_DURIAN_RX ) + ' /' )
202
+ options. links(' https://diffplug.github.io/durian/javadoc/durian-core/' + verSnapshot(VER_DURIAN ) + ' /' )
203
+ options. links(' https://diffplug.github.io/durian/javadoc/durian-collect/' + verSnapshot(VER_DURIAN ) + ' /' )
204
+ options. links(' https://diffplug.github.io/durian/javadoc/durian-concurrent/' + verSnapshot(VER_DURIAN ) + ' /' )
205
+ options. links(' https://diffplug.github.io/durian-debug/javadoc/' + verSnapshot(VER_DURIAN_DEBUG ) + ' /' )
209
206
options. links(' https://docs.oracle.com/javase/8/docs/api/' )
210
207
options. links(' http://reactivex.io/RxJava/javadoc/' )
211
- options. links(' http://docs.guava-libraries.googlecode.com/git-history/v18.0/javadoc/' )
212
208
options. links(' http://help.eclipse.org/luna/nftopic/org.eclipse.platform.doc.isv/reference/api/' )
213
209
}
214
210
@@ -313,6 +309,22 @@ if (!isSnapshot) {
313
309
bintrayUpload. dependsOn([' generatePomFileForMavenJavaPublication' , jar, sourcesJar, javadocJar])
314
310
}
315
311
312
+ // ////////////////
313
+ // GITHUB PAGES //
314
+ // ////////////////
315
+ githubPages {
316
+ repoUri = " https://github.com/${ project.org} /${ project.name} "
317
+ deleteExistingFiles = false
318
+ pages {
319
+ from ' build/docs'
320
+ }
321
+ credentials {
322
+ username = cred(' gh_token' )
323
+ password = ' '
324
+ }
325
+ }
326
+ tasks. prepareGhPages. dependsOn(" :javadoc" )
327
+
316
328
// helps external scripts detect version
317
329
task printVersion << {
318
330
println version
0 commit comments