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
+ }
3
7
4
8
group = ' org.reactfx'
5
9
6
10
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' ]
12
22
}
13
23
14
24
javadoc {
@@ -22,73 +32,90 @@ javadoc {
22
32
]
23
33
}
24
34
25
- task javadocJar ( type : Jar , dependsOn : javadoc) {
26
- classifier = ' javadoc '
27
- from ' build/docs/javadoc '
35
+ java {
36
+ withJavadocJar()
37
+ withSourcesJar()
28
38
}
29
39
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
59
44
60
- snapshotRepository(url : ' https://oss.sonatype.org/content/repositories/snapshots' ) {
61
- authentication(userName : sonatypeUsername, password : sonatypePassword)
62
- }
45
+ groupId = ' org.reactfx'
46
+ artifactId = ' reactfx'
63
47
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'
66
53
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
-
76
54
licenses {
77
55
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'
81
59
}
82
60
}
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
+ }
84
66
developers {
85
67
developer {
86
- name ' Tomas Mikula'
68
+ name = ' Tomas Mikula'
87
69
}
88
70
}
89
71
}
90
72
}
91
73
}
74
+
75
+ repositories {
76
+ maven {
77
+ url = layout. buildDirectory. dir(' staging-deploy' )
78
+ }
79
+ }
92
80
}
93
81
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
+ }
0 commit comments