Skip to content

Commit 52b034c

Browse files
committed
release
1 parent 693992a commit 52b034c

File tree

6 files changed

+267
-183
lines changed

6 files changed

+267
-183
lines changed

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import java.text.SimpleDateFormat
22

33
plugins {
44
id 'java'
5-
id 'org.openjfx.javafxplugin' version '0.0.8'
5+
id 'org.openjfx.javafxplugin' version '0.0.13'
66
id 'com.github.hierynomus.license' version '0.15.0'
77
id 'maven-publish'
88
id 'com.jfrog.bintray' version '1.8.4'
@@ -11,7 +11,7 @@ plugins {
1111
apply from: 'gradle/publishing.gradle'
1212

1313
wrapper {
14-
gradleVersion = '6.8.2'
14+
gradleVersion = '7.5.1'
1515
}
1616

1717
sourceCompatibility = '11'

gradle/project-info.gradle

+15-19
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
// -----------------------------------------------------------------------------
22
// publishing information
33
// -----------------------------------------------------------------------------
4-
ext.publishing.artifactId = project.name.toLowerCase()
5-
ext.publishing.groupId = 'eu.mihosoft.monacofx'
6-
ext.publishing.versionId = '0.0.8'
4+
ext.publishingInfo.artifactId = project.name.toLowerCase()
5+
ext.publishingInfo.groupId = 'eu.mihosoft.monacofx'
6+
ext.publishingInfo.versionId = '0.0.8'
77

8-
ext.publishing.developerName = 'Michael Hoffer'
9-
ext.publishing.developerAlias = 'miho'
10-
ext.publishing.developerEmail = '[email protected]'
11-
ext.publishing.inceptionYear = '2020'
8+
ext.publishingInfo.developerName = 'Michael Hoffer'
9+
ext.publishingInfo.developerAlias = 'miho'
10+
ext.publishingInfo.developerEmail = '[email protected]'
11+
ext.publishingInfo.inceptionYear = '2020'
1212

13-
ext.publishing.bintray.repo = 'MonacoFX'
14-
ext.publishing.bintray.userOrg = 'miho'
15-
ext.publishing.bintray.name = project.name
13+
ext.publishingInfo.desc = 'Powerful editor node based on Monaco'
14+
ext.publishingInfo.license = 'MIT'
15+
ext.publishingInfo.licenseUrl = 'https://github.com/miho/MonacoFX/blob/master/LICENSE'
16+
ext.publishingInfo.labels = ['editor', 'VRL', 'vscode', 'VRL-Studio', 'java', 'programming languages']
17+
ext.publishingInfo.websiteUrl = 'https://github.com/miho/MonacoFX'
18+
ext.publishingInfo.issueTrackerUrl = 'https://github.com/miho/MonacoFX/issues'
19+
ext.publishingInfo.vcsUrl = 'https://github.com/miho/MonacoFX.git'
1620

17-
ext.publishing.desc = 'Powerful editor node based on Monaco'
18-
ext.publishing.license = 'MIT'
19-
ext.publishing.licenseUrl = 'https://github.com/miho/MonacoFX/blob/master/LICENSE'
20-
ext.publishing.labels = ['editor', 'VRL', 'vscode', 'VRL-Studio', 'java', 'programming languages']
21-
ext.publishing.websiteUrl = 'https://github.com/miho/MonacoFX'
22-
ext.publishing.issueTrackerUrl = 'https://github.com/miho/MonacoFX/issues'
23-
ext.publishing.vcsUrl = 'https://github.com/miho/MonacoFX.git'
24-
25-
ext.publishing.pomName = ext.publishing.artifactId
21+
ext.publishingInfo.pomName = ext.publishing.artifactId

gradle/publishing.gradle

+96-57
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,30 @@
11
// -----------------------------------------------------------------------------
22
// Collect publishing information
33
// -----------------------------------------------------------------------------
4-
ext.publishing = [:]
5-
ext.publishing.bintray = [:]
4+
ext.publishingInfo = [:]
65

7-
ext.publishing.pomName = ext.publishing.artifactId
6+
ext.publishingInfo.pomName = ext.publishingInfo.artifactId
87

98
apply from: "gradle/project-info.gradle"
9+
apply plugin: 'signing'
1010

1111
// -----------------------------------------------------------------------------
1212
// Performs publishing
1313
// -----------------------------------------------------------------------------
1414

1515
task javadocJar(type: Jar, dependsOn: javadoc) {
16-
classifier = 'javadoc'
16+
archiveClassifier = 'javadoc'
1717
from javadoc.destinationDir
1818
}
1919

2020
// create one jar for the source files
2121
task sourcesJar(type: Jar, dependsOn: classes) {
22-
classifier = 'sources'
22+
archiveClassifier = 'sources'
2323
from sourceSets.main.allSource
2424
}
2525

26-
// create one jar for the plugin jar (no fat-jar)
27-
task publicationJar(type: Jar, dependsOn: classes) {
28-
// project class files compiled from source
29-
from files(sourceSets.main.output.classesDirs)
30-
}
31-
3226
artifacts {
33-
archives publicationJar
27+
archives jar
3428
archives javadocJar
3529
archives sourcesJar
3630
}
@@ -48,7 +42,7 @@ jar {
4842
'Created-By': System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.properties['java.vm.version'] + ")",
4943
'Build-Date': project.buildDate,
5044
'Build-Time': project.buildTime,
51-
//'Build-Revision': versioning.info.commit,
45+
'Build-Revision': versioning.info.commit,
5246
'Specification-Title': project.name,
5347
'Specification-Version': project.version,
5448
'Implementation-Title': project.name,
@@ -59,76 +53,121 @@ jar {
5953

6054

6155
def pomConfig = {
62-
name ext.publishing.pomName
63-
description ext.publishing.desc
64-
url ext.publishing.websiteUrl
65-
inceptionYear ext.publishing.inceptionYear
56+
name ext.publishingInfo.pomName
57+
description ext.publishingInfo.desc
58+
url ext.publishingInfo.websiteUrl
59+
inceptionYear ext.publishingInfo.inceptionYear
6660
licenses {
6761
license([:]) {
68-
name ext.publishing.license
69-
url ext.publishing.licenseUrl
62+
name ext.publishingInfo.license
63+
url ext.publishingInfo.licenseUrl
7064
distribution 'repo'
7165
}
7266
}
7367
scm {
74-
url ext.publishing.vcsUrl
75-
connection ext.publishing.vcsUrl
76-
developerConnection ext.publishing.vcsUrl
68+
url ext.publishingInfo.vcsUrl
69+
connection ext.publishingInfo.vcsUrl
70+
developerConnection ext.publishingInfo.vcsUrl
7771
}
7872
developers {
7973
developer {
80-
id ext.publishing.developerNameAlias
81-
name ext.publishing.developerName
74+
id ext.publishingInfo.developerNameAlias
75+
name ext.publishingInfo.developerName
8276
}
8377
}
8478
}
8579

80+
81+
8682
publishing {
83+
84+
repositories {
85+
// --------------------------------------------------------------------------------
86+
// Destination Repository 'GitHubPackages'
87+
// -> call task 'publishMavenJavaPublicationToGitHubPackagesRepository' to publish
88+
// --------------------------------------------------------------------------------
89+
maven {
90+
name = "GitHubPackages"
91+
// see https://levelup.gitconnected.com/publish-a-maven-package-to-github-with-gradle-fabc6de24d6
92+
// Replace OWNER and REPOSITORY with your GitHub username/repository
93+
// (must be both lowercase according to the documenations)
94+
// url = uri("https://maven.pkg.github.com/OWNER/REPOSITORY")
95+
url = uri(project.findProperty('publishingInfo').gitHubMavenRepo)
96+
credentials {
97+
// Make sure to generate a token with write-packages and read-packages permission:
98+
// https://github.com/settings/tokens/new
99+
// You can either store the username and token in
100+
// ~/.gradle/gradle.properties (use the gpr.user and gpr.key keys)
101+
// Or you can store them as environment variables e.g. in ~/.bash_profile or ~/.zsh
102+
// depending on your shell (GITHUB_USERNAME and GITHUB_TOKEN keys)
103+
// Or you pass them via CLI: gradle publish -Pgpr.user=username -Pgpr.key=token
104+
// See at EOF for examples on how to store the credentials
105+
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
106+
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
107+
}
108+
}
109+
110+
// --------------------------------------------------------------------------------
111+
// Destination Repository 'OSSRH'
112+
// telling gradle to publish artifact to local directory
113+
// -> call task 'publishMavenJavaPublicationToOSSRHRepository' to publish
114+
// -> go to https://oss.sonatype.org/#stagingRepositories, click 'close', drink coffee and then click 'release'
115+
// if closing was successful
116+
// --------------------------------------------------------------------------------
117+
maven {
118+
name = "OSSRH"
119+
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
120+
credentials {
121+
username = project.findProperty("oss.user") ?: System.getenv("OSS_USERNAME")
122+
password = project.findProperty("oss.pwd") ?: System.getenv("OSS_PWD")
123+
}
124+
}
125+
126+
// --------------------------------------------------------------------------------
127+
// Destination Repository 'BuildDir'
128+
// telling gradle to publish artifact to local directory
129+
// -> call task 'publishMavenJavaPublicationToBuildDirRepository' to publish
130+
// --------------------------------------------------------------------------------
131+
maven {
132+
name = "BuildDir"
133+
url "file:/${buildDir}/artifacts"
134+
}
135+
}
136+
137+
87138
publications {
88-
mavenCustom(MavenPublication) {
89-
groupId publishing.groupId
90-
artifactId publishing.artifactId
91-
version publishing.versionId
139+
mavenJava(MavenPublication) {
140+
groupId publishingInfo.groupId
141+
artifactId publishingInfo.artifactId
142+
version publishingInfo.versionId
92143
from components.java
93144
artifact sourcesJar
94145
artifact javadocJar
95146

96147
pom.withXml {
97148
def root = asNode()
98-
root.appendNode 'description', publishing.desc
99-
root.dependencies.'*'.findAll() {
100-
it.groupId.text() == 'org.openjfx'
101-
}.each {
102-
it.remove(it.classifier)
103-
}
149+
root.appendNode 'description', publishingInfo.desc
104150
root.children().last() + pomConfig
105151
}
106152
}
107153
}
108154
}
109155

110-
if (!project.hasProperty('bintrayUsername')) ext.bintrayUsername = ''
111-
if (!project.hasProperty('bintrayApiKey')) ext.bintrayApiKey = ''
112-
113-
bintray {
114-
user = project.bintrayUsername
115-
key = project.bintrayApiKey
116-
publications = ['mavenCustom']
117-
pkg {
118-
repo = publishing.bintray.repo
119-
userOrg = publishing.bintray.userOrg
120-
name = publishing.bintray.name
121-
desc = publishing.desc
122-
licenses = [publishing.license]
123-
labels = publishing.labels
124-
websiteUrl = publishing.websiteUrl
125-
issueTrackerUrl = publishing.issueTrackerUrl
126-
vcsUrl = publishing.vcsUrl
127-
publicDownloadNumbers = true
128-
129-
version {
130-
name = publishing.versionId
131-
vcsTag = 'v' + publishing.versionId
132-
}
156+
157+
if(
158+
project.findProperty("signing.secretKeyRingFile")
159+
&& project.findProperty("signing.password")
160+
&& project.findProperty("signing.keyId")
161+
) {
162+
163+
signing {
164+
sign publishing.publications
133165
}
166+
167+
} else {
168+
println "> skipping signing, provide\n" +
169+
" - 'signing.secretKeyRingFile'\n" +
170+
" - 'signing.password'\n" +
171+
" - 'signing.keyId'\n" +
172+
" to activate it\n"
134173
}

gradle/wrapper/gradle-wrapper.jar

333 Bytes
Binary file not shown.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)