Skip to content
Permalink
Browse files

Contains the following changes:

* Update to Gradle 6.0.1
* Use maven-publish to publish artifacts
* Use nexus-publish plugin to avoid split staging repositories while releasing from Travis
  • Loading branch information
abhinayagarwal committed Dec 5, 2019
1 parent 2b713d7 commit 5f887f10063b67883ac9b6e602dc6269e1de2ca0
Showing with 64 additions and 115 deletions.
  1. +1 −1 .ci/deploy-snapshot.sh
  2. +1 −1 .ci/deploy.sh
  3. +3 −6 build.gradle
  4. +0 −8 controlsfx/build.gradle
  5. +1 −1 gradle/wrapper/gradle-wrapper.properties
  6. +46 −98 mavenPublish.gradle
  7. +12 −0 settings.gradle
@@ -6,5 +6,5 @@ ver=$(./gradlew -q :controlsfx:getVersion | tail -n 1)
# deploy if snapshot found
if [[ $ver == *"SNAPSHOT"* ]]
then
./gradlew uploadPublished -PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD
./gradlew publish -PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD
fi
@@ -6,4 +6,4 @@ if [[ ! -s sonatype.gpg ]]
exit 1
fi

./gradlew uploadPublished --info -PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD -Psigning.keyId=$GPG_KEY_ID -Psigning.password=$GPG_KEY_PASSPHRASE -Psigning.secretKeyRingFile=/home/travis/build/controlsfx/controlsfx/sonatype.gpg
./gradlew publish --info -PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD -Psigning.keyId=$GPG_KEY_ID -Psigning.password=$GPG_KEY_PASSPHRASE -Psigning.secretKeyRingFile=/home/travis/build/controlsfx/controlsfx/sonatype.gpg
@@ -3,13 +3,12 @@ subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'osgi'
apply plugin: 'maven'
apply from : '../mavenPublish.gradle'

Properties cfg = new Properties()
cfg.load(new FileInputStream("$rootDir/controlsfx-build.properties"))

ext {
artifact_suffix = cfg.artifact_suffix
specification_title = cfg.controlsfx_specification_title //'Java 8u20'
@@ -20,7 +19,6 @@ subprojects {
fxsampler_mainClass = 'fxsampler.FXSampler'
}


group = 'org.controlsfx'
version = specification_version + artifact_suffix

@@ -33,8 +31,8 @@ subprojects {

dependencies {
testCompile 'junit:junit:[4,)'
testCompile 'org.testfx:testfx-core:4.0.10-alpha'
testRuntime 'org.testfx:openjfx-monocle:1.8.0_20'
testCompile 'org.testfx:testfx-core:4.0.10-alpha'
testRuntime 'org.testfx:openjfx-monocle:1.8.0_20'
}

test {
@@ -79,5 +77,4 @@ subprojects {
println "$project.version"
}
}

}
@@ -105,14 +105,6 @@ jar {
'Implementation-Version': version,\
'Bundle-Name': 'ControlsFX'
)
instruction 'Bundle-Description', 'High quality UI controls and other tools to complement the core JavaFX distribution'
instruction 'Import-Package',
'!org.controlsfx*',
'*'

instruction 'Export-Package',
'!impl.org.controlsfx.*',
'org.controlsfx.*'
}
}

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
@@ -1,118 +1,66 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'

configurations {
samples { extendsFrom runtime}
jdk
maven { extendsFrom archives }
published { extendsFrom archives, signatures}
}
apply plugin: 'de.marcphilipp.nexus-publish'

signing {
required = { gradle.taskGraph.hasTask(uploadPublished) && !version.endsWith("SNAPSHOT") }
required = { gradle.taskGraph.hasTask(publish) && !version.endsWith("SNAPSHOT") }
sign configurations.archives
}

repositories {
mavenLocal()
maven { url 'https://oss.sonatype.org/content/groups/staging' }
mavenCentral()
}

uploadPublished {
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
afterEvaluate {
artifact sourceJar
artifact javadocJar
}

doFirst {
// configure repositories in a doFirst so we can late bind the properties
checkPasswords()
repositories {
mavenDeployer {
configurePOM(pom)
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication userName: sonatypeUsername, password: sonatypePassword
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication userName: sonatypeUsername, password: sonatypePassword
usage('java-runtime') {
fromResolutionResult()
}
}
}
}
configuration = configurations.published
}

install {
doFirst {
configurePOM(repositories.mavenInstaller.pom)
}
configuration = configurations.published
}

//ext {
// pomExclusions = []
//}

private configurePOM(def pom) {
pom.project {
name 'ControlsFX'
description 'High quality UI controls and other tools to complement the core JavaFX distribution'
url 'http://www.controlsfx.org/'
modelVersion '4.0.0'
packaging 'jar'
scm {
connection 'scm:hg:https://bitbucket.org/controlsfx/controlsfx'
developerConnection 'scm:hg:ssh://hg@bitbucket.org/controlsfx/controlsfx'
url 'https://bitbucket.org/controlsfx/controlsfx'
}
developers {
developer {
name 'Jonathan Giles'
email 'jonathan@jonathangiles.net'
roles {
role 'author'
role 'developer'
pom {
name = 'ControlsFX'
description = 'High quality UI controls and other tools to complement the core JavaFX distribution'
url = 'http://www.controlsfx.org/'
licenses {
license {
name = 'The 3-Clause BSD License'
url = 'http://www.opensource.org/licenses/bsd-license.php'
distribution = 'repo'
}
}
developers {
developer {
name = 'Jonathan Giles'
email = 'jonathan@jonathangiles.net'
roles = [
'author',
'developer'
]
}
}
scm {
connection = 'scm:hg:https://bitbucket.org/controlsfx/controlsfx'
developerConnection = 'scm:hg:ssh://hg@bitbucket.org/controlsfx/controlsfx'
url = 'https://bitbucket.org/controlsfx/controlsfx'
}
}
}
licenses {
license {
name 'The 3-Clause BSD License'
url 'http://www.opensource.org/licenses/bsd-license.php'
distribution 'repo'
}
}
properties {
//project.build.sourceEncoding='UTF-8'
setProperty('project.build.sourceEncoding', 'UTF8')
}
//}
//whenConfigured{
// dependencies = dependencies.findAll {dep -> !pomExclusions.contains(dep.artifactId) }
//}

}
}

ext.checkPasswords = {
try {
def check = [sonatypeUsername, sonatypePassword]
println "Using sonatype user $sonatypeUsername"
} catch (MissingPropertyException e) {
e.printStackTrace()
Console console = System.console()
console.printf "\n\nIn order to upload to Sonatype we need your username and password.\nEnter a blank username or password to skip upload\n\n"
ext.sonatypeUsername = console.readLine("Sonatype Username: ")
ext.sonatypePassword = new String(console.readPassword("Sonatype Password: "))
if (!sonatypePassword || !sonatypeUsername) {
console.printf("\n\nSonatype upload aborted")
subprojects {
signing {
enabled = false
}
uploadPublished {
enabled = false
}
}
throw new StopExecutionException()
nexusPublishing {
repositories {
sonatype {
username = project.hasProperty('sonatypeUsername') ? project.property('sonatypeUsername') : ''
password = project.hasProperty('sonatypePassword') ? project.property('sonatypePassword') : ''
}
}
}

@@ -1 +1,13 @@
include "controlsfx", "fxsampler", "controlsfx-samples"

buildscript {
repositories {
mavenCentral()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'de.marcphilipp.gradle:nexus-publish-plugin:0.4.0'
}
}

0 comments on commit 5f887f1

Please sign in to comment.
You can’t perform that action at this time.