Skip to content

Commit 5c3a30b

Browse files
committed
Modernized build file.
1 parent 8a37104 commit 5c3a30b

7 files changed

+69
-57
lines changed

META-INF/MANIFEST.MF

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
Manifest-Version: 1.0
2-
Bundle-Description: DurianSwt - Reactive utilities and fluent builders f
3-
or SWT
42
Bundle-DocURL: https://github.com/diffplug/durian-swt
5-
Bundle-License: https://github.com/diffplug/durian-swt/blob/v1.8.0-SNAPS
6-
HOT/LICENSE
3+
Bundle-License: https://github.com/diffplug/durian-swt/blob/v2.0.0-SNA
4+
PSHOT/LICENSE
75
Bundle-ManifestVersion: 2
86
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
97
Bundle-SymbolicName: com.diffplug.durian.swt
108
Bundle-Vendor: DiffPlug
11-
Bundle-Version: 1.8.0.SNAPSHOT
12-
Export-Package: com.diffplug.common.swt;uses:="com.diffplug.common.base,
13-
com.diffplug.common.rx,com.google.common.collect,com.google.common.util
14-
.concurrent,org.eclipse.jface.viewers,org.eclipse.swt.graphics,org.ecli
15-
pse.swt.layout,org.eclipse.swt.widgets,rx";version="1.8.0",com.diffplug
16-
.common.swt.jface;uses:="com.diffplug.common.base,com.diffplug.common.r
17-
x,com.diffplug.common.swt,com.google.common.collect,org.eclipse.jface.a
18-
ction,org.eclipse.jface.resource,org.eclipse.jface.viewers,org.eclipse.
19-
swt.graphics,org.eclipse.swt.widgets";version="1.8.0",com.diffplug.comm
20-
on.swt.os;version="1.8.0"
21-
Import-Package: com.diffplug.common.base;version="[3.5,4)",com.diffplug.
22-
common.rx;version="[1.3,2)",com.diffplug.common.swt,com.diffplug.common
23-
.swt.os,com.google.common.base;version="[19.0,20)",com.google.common.co
24-
llect;version="[19.0,20)",com.google.common.primitives;version="[19.0,2
25-
0)",com.google.common.util.concurrent;version="[19.0,20)",org.eclipse.j
26-
face.action,org.eclipse.jface.layout,org.eclipse.jface.resource,org.ecl
27-
ipse.jface.util,org.eclipse.jface.viewers,org.eclipse.swt.custom,org.ec
28-
lipse.swt.graphics,org.eclipse.swt.layout,org.eclipse.swt.widgets,rx;ve
29-
rsion="[1.0,2)",rx.functions;version="[1.0,2)",rx.subjects;version="[1.
30-
0,2)",rx.subscriptions;version="[1.0,2)"
9+
Bundle-Version: 2.0.0.SNAPSHOT
10+
Export-Package: com.diffplug.common.swt;uses:="com.diffplug.common.bas
11+
e,com.diffplug.common.collect,com.diffplug.common.rx,com.diffplug.com
12+
mon.tree,com.diffplug.common.util.concurrent,org.eclipse.jface.viewer
13+
s,org.eclipse.swt.graphics,org.eclipse.swt.layout,org.eclipse.swt.wid
14+
gets,rx";version="2.0.0",com.diffplug.common.swt.jface;uses:="com.dif
15+
fplug.common.base,com.diffplug.common.collect,com.diffplug.common.rx,
16+
com.diffplug.common.swt,com.diffplug.common.tree,org.eclipse.jface.ac
17+
tion,org.eclipse.jface.resource,org.eclipse.jface.viewers,org.eclipse
18+
.swt.graphics,org.eclipse.swt.widgets";version="2.0.0",com.diffplug.c
19+
ommon.swt.os;version="2.0.0"
20+
Import-Package: com.diffplug.common.base;version="[1.2,2)",com.diffplu
21+
g.common.collect;version="[1.2,2)",com.diffplug.common.debug;version=
22+
"[1.0,2)",com.diffplug.common.primitives;version="[1.2,2)",com.diffpl
23+
ug.common.rx;version="[2.0,3)",com.diffplug.common.swt,com.diffplug.c
24+
ommon.swt.os,com.diffplug.common.tree;version="[1.2,2)",com.diffplug.
25+
common.util.concurrent;version="[1.2,2)",org.eclipse.jface.action,org
26+
.eclipse.jface.layout,org.eclipse.jface.resource,org.eclipse.jface.ut
27+
il,org.eclipse.jface.viewers,org.eclipse.swt.custom,org.eclipse.swt.g
28+
raphics,org.eclipse.swt.layout,org.eclipse.swt.widgets,rx;version="[1
29+
.1,2)",rx.functions;version="[1.1,2)",rx.subjects;version="[1.1,2)",r
30+
x.subscriptions;version="[1.1,2)"
3131
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ output = [
1717
[![Javadoc](https://img.shields.io/badge/javadoc-OK-blue.svg)](https://diffplug.github.io/durian-swt/javadoc/1.7.0/)
1818
[![License Apache](https://img.shields.io/badge/license-Apache-blue.svg)](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0))
1919

20-
[![Changelog](https://img.shields.io/badge/changelog-1.8.0--SNAPSHOT-brightgreen.svg)](CHANGES.md)
20+
[![Changelog](https://img.shields.io/badge/changelog-2.0.0--SNAPSHOT-brightgreen.svg)](CHANGES.md)
2121
[![Travis CI](https://travis-ci.org/diffplug/durian-swt.svg?branch=master)](https://travis-ci.org/diffplug/durian-swt)
2222
[![Live chat](https://img.shields.io/badge/gitter-live_chat-brightgreen.svg)](https://gitter.im/diffplug/durian)
2323
<!---freshmark /shields -->

build.gradle

+42-30
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
plugins {
22
// osgi
3-
id "org.jruyi.osgibnd" version "0.4.0"
3+
id "com.diffplug.gradle.osgi.bndmanifest" version "2.1.1"
44
// code formatting
55
id "com.diffplug.gradle.spotless" version "1.3.3"
66
// bintray uploading
77
id "com.jfrog.bintray" version "1.3.1"
8+
// github pages
9+
id "org.ajoberstar.github-pages" version "1.4.2"
810
}
911

1012
repositories {
1113
mavenCentral()
12-
// while we're testing this new guava/durian thing
13-
maven {
14-
url "https://dl.bintray.com/diffplug/opensource/"
15-
}
1614
ivy {
1715
// There isn't a reliable way to get eclipse artifacts except through p2 repositories,
1816
// which gradle does not yet support. For now we're forcing it with ivy.
@@ -48,9 +46,11 @@ sourceCompatibility = VER_JAVA
4846
targetCompatibility = VER_JAVA
4947

5048
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}"
5153
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}"
5454
compile "io.reactivex:rxjava:${VER_RXJAVA}"
5555

5656
compile "p2:org.eclipse.swt:${VER_SWT}"
@@ -65,23 +65,18 @@ dependencies {
6565
//////////
6666
// OSGI //
6767
//////////
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+
)
7977
// 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'
8580
}
8681

8782
/////////////////////////
@@ -141,12 +136,11 @@ tasks.eclipse.dependsOn(cleanEclipse)
141136
////////////
142137
// FORMAT //
143138
////////////
144-
apply plugin: 'com.diffplug.gradle.spotless'
145139
spotless {
146140
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
150144
}
151145
format 'misc', {
152146
target '**/.gitignore', '**/*.gradle', '**/*.md', '**/*.sh'
@@ -193,6 +187,7 @@ task sourcesJar(type: Jar) {
193187
from sourceSets.main.allJava
194188
}
195189

190+
def verSnapshot = { it -> it.endsWith('-SNAPSHOT') ? 'snapshot' : VER_DURIAN }
196191
// Where it's possible to name parameters and methods clearly enough
197192
// that javadoc is not necessary, why make the code bigger?
198193
//
@@ -204,11 +199,12 @@ javadoc {
204199
options.addStringOption('Xdoclint:none', '-quiet')
205200
options.header javadocInfo
206201
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) + '/')
209206
options.links('https://docs.oracle.com/javase/8/docs/api/')
210207
options.links('http://reactivex.io/RxJava/javadoc/')
211-
options.links('http://docs.guava-libraries.googlecode.com/git-history/v18.0/javadoc/')
212208
options.links('http://help.eclipse.org/luna/nftopic/org.eclipse.platform.doc.isv/reference/api/')
213209
}
214210

@@ -313,6 +309,22 @@ if (!isSnapshot) {
313309
bintrayUpload.dependsOn(['generatePomFileForMavenJavaPublication', jar, sourcesJar, javadocJar])
314310
}
315311

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+
316328
// helps external scripts detect version
317329
task printVersion << {
318330
println version

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ VER_JAVA=1.8
1010
VER_FINDBUGS=3.0.1
1111

1212
# Dependencies
13-
VER_DURIAN=4.0.0-SNAPSHOT
13+
VER_DURIAN=1.2.0-SNAPSHOT
1414
VER_DURIAN_RX=2.0.0-SNAPSHOT
15-
VER_GUAVA=19.0.0
15+
VER_DURIAN_DEBUG=1.0.0-SNAPSHOT
1616
VER_RXJAVA=1.1.0
1717
# P2 Dependencies
1818
UPDATE_SITE=http://download.eclipse.org/eclipse/updates/4.5/R-4.5.2-201602121500/
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)