Skip to content

Commit 14cf2fc

Browse files
TomasMikulaSymeon94Symeon94
authored
Upgradle to gradle version 8.8 and use JReleaser for publishing to Maven Central (#84)
* Updating out deprecated blocks in graddle file * Updating the publication for 8+ version * Including the correct version of JavaFX in the build * Issue with outdated 'runtime' and missing JavaFX dependencies for reactfx-demos * Issue with outdated 'runtime' and missing JavaFX dependencies for reactfx-demos * Javadoc fails building due to h2 title being used while parent is h3. Changing to h4 * Issue with build due to likely bug in the builder library. Upgrading to latest version supporting java 8 * Use JReleaser for releasing to Maven Central. * Version 2.0-M6 --------- Co-authored-by: Symeon94 <[email protected]> Co-authored-by: Symeon94 <[email protected]>
1 parent 537fffd commit 14cf2fc

File tree

7 files changed

+121
-83
lines changed

7 files changed

+121
-83
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.gradle/
22
build/
3-
gradle.properties
43
.classpath
54
.project
65
.settings/
6+
.idea/

build.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
subprojects {
2-
version = '2.0-SNAPSHOT'
1+
plugins {
2+
id 'biz.aQute.bnd.builder' version '6.4.0'
3+
}
34

5+
subprojects {
46
apply plugin: 'java'
57
apply plugin: 'eclipse'
6-
apply plugin: 'osgi'
8+
apply plugin: 'biz.aQute.bnd.builder' // replaces 'osgi'
79

810
repositories {
911
mavenCentral()
12+
gradlePluginPortal()
1013
}
1114

1215
sourceCompatibility = '1.8'

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version=2.0-M6

gradle.properties.example

Lines changed: 0 additions & 6 deletions
This file was deleted.

reactfx-demos/build.gradle

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,34 @@
1+
plugins {
2+
id 'org.openjfx.javafxplugin' version '0.1.0'
3+
}
4+
15
dependencies {
2-
compile project(":reactfx")
6+
implementation project(":reactfx")
37
}
48

5-
task fatJar(type: Jar, dependsOn: classes) {
6-
appendix = 'fat'
9+
tasks.register('fatJar', Jar) {
10+
archiveClassifier = 'fat'
711
from sourceSets.main.output
8-
from { configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } }
12+
dependsOn configurations.runtimeClasspath
13+
from { configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) } }
14+
duplicatesStrategy = 'warn'
15+
}
16+
17+
javafx {
18+
version = "18"
19+
modules = ['javafx.controls', 'javafx.swing', 'javafx.base', 'javafx.web']
920
}
1021

1122
assemble.dependsOn fatJar
1223

13-
task AndGateDemo(type: JavaExec, dependsOn: classes) {
14-
main = 'org.reactfx.inhibeans.demo.AndGateDemo'
15-
classpath = files(sourceSets.main.output, configurations.runtime)
24+
tasks.register('AndGateDemo', JavaExec) {
25+
dependsOn tasks.named('classes')
26+
mainClass.set('org.reactfx.inhibeans.demo.AndGateDemo')
27+
classpath = files(sourceSets.main.output, configurations.runtimeClasspath)
1628
}
1729

18-
task FibTest(type: JavaExec, dependsOn: classes) {
19-
main = 'org.reactfx.inhibeans.demo.FibTest'
20-
classpath = files(sourceSets.main.output, configurations.runtime)
30+
tasks.register('FibTest', JavaExec) {
31+
dependsOn tasks.named('classes')
32+
mainClass.set('org.reactfx.inhibeans.demo.FibTest')
33+
classpath = files(sourceSets.main.output, configurations.runtimeClasspath)
2134
}

reactfx/build.gradle

Lines changed: 86 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
apply plugin: 'maven'
2-
apply plugin: 'signing'
1+
plugins {
2+
id 'java-library'
3+
id 'maven-publish'
4+
id 'org.jreleaser' version '1.19.0'
5+
id 'org.openjfx.javafxplugin' version '0.1.0'
6+
}
37

48
group = 'org.reactfx'
59

610
dependencies {
7-
testCompile group: 'junit', name: 'junit', version: '4.12'
8-
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3'
9-
testCompile group: 'org.junit.contrib', name: 'junit-theories', version: '4.12'
10-
testCompile group: 'com.pholser', name: 'junit-quickcheck-core', version: '0.4'
11-
testCompile group: 'com.pholser', name: 'junit-quickcheck-generators', version: '0.4'
11+
// Test dependencies
12+
testImplementation group: 'junit', name: 'junit', version: '4.12'
13+
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3'
14+
testImplementation group: 'org.junit.contrib', name: 'junit-theories', version: '4.12'
15+
testImplementation group: 'com.pholser', name: 'junit-quickcheck-core', version: '0.4'
16+
testImplementation group: 'com.pholser', name: 'junit-quickcheck-generators', version: '0.4'
17+
}
18+
19+
javafx {
20+
version = "18"
21+
modules = ['javafx.controls', 'javafx.swing']
1222
}
1323

1424
javadoc {
@@ -22,73 +32,90 @@ javadoc {
2232
]
2333
}
2434

25-
task javadocJar(type: Jar, dependsOn: javadoc) {
26-
classifier = 'javadoc'
27-
from 'build/docs/javadoc'
35+
java {
36+
withJavadocJar()
37+
withSourcesJar()
2838
}
2939

30-
task sourcesJar(type: Jar) {
31-
from sourceSets.main.allSource
32-
classifier = 'sources'
33-
}
34-
35-
artifacts {
36-
archives jar
37-
38-
archives javadocJar
39-
archives sourcesJar
40-
}
41-
42-
signing {
43-
sign configurations.archives
44-
}
45-
46-
signArchives.onlyIf {
47-
project.hasProperty('signing.keyId') && project.hasProperty('signing.password') && project.hasProperty('signing.secretKeyRingFile')
48-
}
49-
50-
def doUploadArchives = project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
51-
if(doUploadArchives) {
52-
uploadArchives {
53-
repositories.mavenDeployer {
54-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
55-
56-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
57-
authentication(userName: sonatypeUsername, password: sonatypePassword)
58-
}
40+
publishing {
41+
publications {
42+
maven(MavenPublication) {
43+
from components.java
5944

60-
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') {
61-
authentication(userName: sonatypeUsername, password: sonatypePassword)
62-
}
45+
groupId = 'org.reactfx'
46+
artifactId = 'reactfx'
6347

64-
pom.project {
65-
name 'ReactFX'
48+
pom {
49+
name = 'ReactFX'
50+
description = 'Reactive event streams for JavaFX'
51+
url = 'http://www.reactfx.org/'
52+
inceptionYear = '2013'
6653
packaging 'jar'
67-
description 'Reactive event streams for JavaFX'
68-
url 'http://www.reactfx.org/'
69-
70-
scm {
71-
url 'scm:[email protected]:TomasMikula/ReactFX.git'
72-
connection 'scm:[email protected]:TomasMikula/ReactFX.git'
73-
developerConnection 'scm:[email protected]:TomasMikula/ReactFX.git'
74-
}
75-
7654
licenses {
7755
license {
78-
name 'The BSD 2-Clause License'
79-
url 'http://opensource.org/licenses/BSD-2-Clause'
80-
distribution 'repo'
56+
name = 'The BSD 2-Clause License'
57+
url = 'http://opensource.org/licenses/BSD-2-Clause'
58+
distribution = 'repo'
8159
}
8260
}
83-
61+
scm {
62+
url = 'scm:[email protected]:TomasMikula/ReactFX.git'
63+
connection = 'scm:[email protected]:TomasMikula/ReactFX.git'
64+
developerConnection = 'scm:[email protected]:TomasMikula/ReactFX.git'
65+
}
8466
developers {
8567
developer {
86-
name 'Tomas Mikula'
68+
name = 'Tomas Mikula'
8769
}
8870
}
8971
}
9072
}
9173
}
74+
75+
repositories {
76+
maven {
77+
url = layout.buildDirectory.dir('staging-deploy')
78+
}
79+
}
9280
}
9381

94-
uploadArchives.onlyIf { doUploadArchives }
82+
// deploy artifacts with `gradle build publish jreleaserDeploy`
83+
jreleaser {
84+
signing {
85+
active = 'ALWAYS'
86+
armored = true
87+
mode = 'FILE'
88+
// set the following in ~/.jreleaser/config.properties
89+
// JRELEASER_GPG_PUBLIC_KEY=/path/to/public.gpg
90+
// JRELEASER_GPG_SECRET_KEY=/path/to/secret.gpg
91+
// JRELEASER_GPG_PASSPHRASE=<passphrase>
92+
}
93+
deploy {
94+
maven {
95+
mavenCentral {
96+
'release-deploy' {
97+
active = 'RELEASE'
98+
url = 'https://central.sonatype.com/api/v1/publisher'
99+
stagingRepository('build/staging-deploy')
100+
}
101+
// set the following properties in ~/.jreleaser/config.properties
102+
// JRELEASER_MAVENCENTRAL_USERNAME
103+
// JRELEASER_MAVENCENTRAL_PASSWORD
104+
}
105+
nexus2 {
106+
'snapshot-deploy' {
107+
active = 'SNAPSHOT'
108+
snapshotUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
109+
applyMavenCentralRules = true
110+
snapshotSupported = true
111+
closeRepository = true
112+
releaseRepository = true
113+
stagingRepository('build/staging-deploy')
114+
}
115+
// set the following properties in ~/.jreleaser/config.properties
116+
// JRELEASER_NEXUS2_USERNAME
117+
// JRELEASER_NEXUS2_PASSWORD
118+
}
119+
}
120+
}
121+
}

reactfx/src/main/java/org/reactfx/EventStream.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ default EventStream<List<T>> latestN(int n) {
474474
* C :----a------------c-----------d----&gt;
475475
* </pre>
476476
*
477-
* <h2>Relationship to other EventStreams:</h2>
477+
* <h4>Relationship to other EventStreams:</h4>
478478
* <ul>
479479
* <li>
480480
* This stream does NOT emit A's most recent event multiple
@@ -514,7 +514,7 @@ default EventStream<T> emitOn(EventStream<?> impulse) {
514514
* C :----a------------c--c--c-----d----&gt;
515515
* </pre>
516516
*
517-
* <h2>Relationship to other EventStreams:</h2>
517+
* <h4>Relationship to other EventStreams:</h4>
518518
* <ul>
519519
* <li>
520520
* This stream DOES emit A's most recent event multiple
@@ -553,7 +553,7 @@ default EventStream<T> emitOnEach(EventStream<?> impulse) {
553553
* C :---[a,1]------[c,2]-----------[d,4]-----&gt;
554554
* </pre>
555555
*
556-
* <h2>Relationship to other EventStreams:</h2>
556+
* <h4>Relationship to other EventStreams:</h4>
557557
* <ul>
558558
* <li>
559559
* This stream emits both A and B's events whereas {@link #emitOn(EventStream)},
@@ -586,7 +586,7 @@ default <I> EventStream<Tuple2<T, I>> emitBothOnEach(EventStream<I> impulse) {
586586
* C :-a--a----b---c--c-----c-----c---d-------&gt;
587587
* </pre>
588588
*
589-
* <h2>Relationship to other EventStreams:</h2>
589+
* <h4>Relationship to other EventStreams:</h4>
590590
* <ul>
591591
* <li>
592592
* This stream emits A's events when A emits an event and

0 commit comments

Comments
 (0)