build.gradle.kts:

- plugin versions now defined in single location (settings.gradle.kts)
- going back to Gradle 6.1.1
- using "extra" properties for bintray user and key
- allow easy enabling/disabling bintray upload dryMode and publishing
This commit is contained in:
Karl Tauber
2020-02-16 12:12:00 +01:00
parent e439d91763
commit 7489526eb7
7 changed files with 49 additions and 27 deletions

View File

@@ -38,3 +38,14 @@ println( "FlatLaf Version: ${version}" )
println( "Gradle ${gradle.gradleVersion} at ${gradle.gradleHomeDir}" )
println( "Java ${System.getProperty( "java.version" )}" )
println()
extra["bintray.user"] = System.getenv( "BINTRAY_USER" ) ?: System.getProperty( "bintray.user" )
extra["bintray.key"] = System.getenv( "BINTRAY_KEY" ) ?: System.getProperty( "bintray.key" )
// if true, do not upload to bintray
extra["bintray.dryRun"] = false
// if true, uploaded artifacts are visible to all
// if false, only visible to owner when logged into bintray
extra["bintray.publish"] = true

View File

@@ -17,8 +17,8 @@
plugins {
`java-library`
`maven-publish`
id( "com.jfrog.bintray" ) version "1.8.4"
id( "com.jfrog.artifactory" ) version "4.13.0"
id( "com.jfrog.bintray" )
id( "com.jfrog.artifactory" )
}
if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
@@ -127,8 +127,8 @@ publishing {
}
bintray {
user = System.getenv( "BINTRAY_USER" ) ?: System.getProperty( "bintray.user" )
key = System.getenv( "BINTRAY_KEY" ) ?: System.getProperty( "bintray.key" )
user = rootProject.extra["bintray.user"] as String?
key = rootProject.extra["bintray.key"] as String?
setPublications( "maven" )
@@ -142,7 +142,8 @@ bintray {
name = project.version.toString()
}
publish = true
publish = rootProject.extra["bintray.publish"] as Boolean
dryRun = rootProject.extra["bintray.dryRun"] as Boolean
}
}
@@ -152,8 +153,8 @@ artifactory {
publish( closureOf<org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig> {
repository( delegateClosureOf<groovy.lang.GroovyObject> {
setProperty( "repoKey", "oss-snapshot-local" )
setProperty( "username", System.getenv( "BINTRAY_USER" ) ?: System.getProperty( "bintray.user" ) )
setProperty( "password", System.getenv( "BINTRAY_KEY" ) ?: System.getProperty( "bintray.key" ) )
setProperty( "username", rootProject.extra["bintray.user"] as String? )
setProperty( "password", rootProject.extra["bintray.key"] as String? )
} )
defaults( delegateClosureOf<groovy.lang.GroovyObject> {

View File

@@ -16,7 +16,7 @@
plugins {
`java-library`
id( "com.jfrog.bintray" ) version "1.8.4"
id( "com.jfrog.bintray" )
// Although artifactory plugin is not used in this subproject, the plugin is required
// because otherwise gradle fails with following error:
@@ -24,7 +24,7 @@ plugins {
// Cannot cast object 'task ':bintrayUpload''
// with class 'com.jfrog.bintray.gradle.tasks.BintrayUploadTask_Decorated'
// to class 'com.jfrog.bintray.gradle.tasks.BintrayUploadTask'
id( "com.jfrog.artifactory" ) version "4.13.0"
id( "com.jfrog.artifactory" )
}
dependencies {
@@ -58,8 +58,8 @@ tasks {
}
bintray {
user = System.getenv( "BINTRAY_USER" ) ?: System.getProperty( "bintray.user" )
key = System.getenv( "BINTRAY_KEY" ) ?: System.getProperty( "bintray.key" )
user = rootProject.extra["bintray.user"] as String?
key = rootProject.extra["bintray.key"] as String?
setConfigurations( "archives" )
@@ -73,6 +73,7 @@ bintray {
name = project.version.toString()
}
publish = true
publish = rootProject.extra["bintray.publish"] as Boolean
dryRun = rootProject.extra["bintray.dryRun"] as Boolean
}
}

View File

@@ -17,8 +17,8 @@
plugins {
`java-library`
`maven-publish`
id( "com.jfrog.bintray" ) version "1.8.4"
id( "com.jfrog.artifactory" ) version "4.13.0"
id( "com.jfrog.bintray" )
id( "com.jfrog.artifactory" )
}
dependencies {
@@ -100,8 +100,8 @@ publishing {
}
bintray {
user = System.getenv( "BINTRAY_USER" ) ?: System.getProperty( "bintray.user" )
key = System.getenv( "BINTRAY_KEY" ) ?: System.getProperty( "bintray.key" )
user = rootProject.extra["bintray.user"] as String?
key = rootProject.extra["bintray.key"] as String?
setPublications( "maven" )
@@ -115,7 +115,8 @@ bintray {
name = project.version.toString()
}
publish = true
publish = rootProject.extra["bintray.publish"] as Boolean
dryRun = rootProject.extra["bintray.dryRun"] as Boolean
}
}
@@ -125,8 +126,8 @@ artifactory {
publish( closureOf<org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig> {
repository( delegateClosureOf<groovy.lang.GroovyObject> {
setProperty( "repoKey", "oss-snapshot-local" )
setProperty( "username", System.getenv( "BINTRAY_USER" ) ?: System.getProperty( "bintray.user" ) )
setProperty( "password", System.getenv( "BINTRAY_KEY" ) ?: System.getProperty( "bintray.key" ) )
setProperty( "username", rootProject.extra["bintray.user"] as String? )
setProperty( "password", rootProject.extra["bintray.key"] as String? )
} )
defaults( delegateClosureOf<groovy.lang.GroovyObject> {

View File

@@ -17,8 +17,8 @@
plugins {
`java-library`
`maven-publish`
id( "com.jfrog.bintray" ) version "1.8.4"
id( "com.jfrog.artifactory" ) version "4.13.0"
id( "com.jfrog.bintray" )
id( "com.jfrog.artifactory" )
}
dependencies {
@@ -100,8 +100,8 @@ publishing {
}
bintray {
user = System.getenv( "BINTRAY_USER" ) ?: System.getProperty( "bintray.user" )
key = System.getenv( "BINTRAY_KEY" ) ?: System.getProperty( "bintray.key" )
user = rootProject.extra["bintray.user"] as String?
key = rootProject.extra["bintray.key"] as String?
setPublications( "maven" )
@@ -115,7 +115,8 @@ bintray {
name = project.version.toString()
}
publish = true
publish = rootProject.extra["bintray.publish"] as Boolean
dryRun = rootProject.extra["bintray.dryRun"] as Boolean
}
}
@@ -125,8 +126,8 @@ artifactory {
publish( closureOf<org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig> {
repository( delegateClosureOf<groovy.lang.GroovyObject> {
setProperty( "repoKey", "oss-snapshot-local" )
setProperty( "username", System.getenv( "BINTRAY_USER" ) ?: System.getProperty( "bintray.user" ) )
setProperty( "password", System.getenv( "BINTRAY_KEY" ) ?: System.getProperty( "bintray.key" ) )
setProperty( "username", rootProject.extra["bintray.user"] as String? )
setProperty( "password", rootProject.extra["bintray.key"] as String? )
} )
defaults( delegateClosureOf<groovy.lang.GroovyObject> {

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -22,3 +22,10 @@ include( "flatlaf-swingx" )
include( "flatlaf-jide-oss" )
include( "flatlaf-demo" )
include( "flatlaf-testing" )
pluginManagement {
plugins {
id( "com.jfrog.bintray" ) version "1.8.4"
id( "com.jfrog.artifactory" ) version "4.13.0"
}
}