mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-29 15:32:06 +01:00
gradle: add support for custom repo to publish to
And introduce useSonatype setting to skip the sonatype repos if desired.
This commit is contained in:
parent
ea944a8dc6
commit
398cba330b
1 changed files with 24 additions and 3 deletions
23
build.gradle
23
build.gradle
|
@ -134,6 +134,12 @@ allprojects {
|
||||||
junitVersion = '5.6.0'
|
junitVersion = '5.6.0'
|
||||||
powerMockVersion = '2.0.2'
|
powerMockVersion = '2.0.2'
|
||||||
commonsIoVersion = '2.6'
|
commonsIoVersion = '2.6'
|
||||||
|
if (project.hasProperty("useSonatype")) {
|
||||||
|
useSonatype = project.getProperty("useSonatype").toBoolean()
|
||||||
|
} else {
|
||||||
|
// Default to true
|
||||||
|
useSonatype = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
group = 'org.igniterealtime.smack'
|
group = 'org.igniterealtime.smack'
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
@ -457,15 +463,30 @@ subprojects {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
|
if (sonatypeCredentialsAvailable && useSonatype) {
|
||||||
maven {
|
maven {
|
||||||
url isSnapshot ? sonatypeSnapshotUrl : sonatypeStagingUrl
|
url isSnapshot ? sonatypeSnapshotUrl : sonatypeStagingUrl
|
||||||
if (sonatypeCredentialsAvailable) {
|
|
||||||
credentials {
|
credentials {
|
||||||
username = sonatypeUsername
|
username = sonatypeUsername
|
||||||
password = sonatypePassword
|
password = sonatypePassword
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Use
|
||||||
|
// gradle publish -P customRepoUrl=https://www.igniterealtime.org/archiva/repository/maven -P customRepoUsername=bamboo -P customRepoPassword=hidden -P useSonatype=false
|
||||||
|
// to deploy to this repo.
|
||||||
|
if (project.hasProperty("customRepoUrl")) {
|
||||||
|
maven {
|
||||||
|
name 'customRepo'
|
||||||
|
url customRepoUrl
|
||||||
|
if (project.hasProperty("customRepoUsername")) {
|
||||||
|
credentials {
|
||||||
|
username customRepoUsername
|
||||||
|
password customRepoPassword
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rootProject.distributionZip {
|
rootProject.distributionZip {
|
||||||
|
|
Loading…
Reference in a new issue