-
Notifications
You must be signed in to change notification settings - Fork 404
/
publishing.gradle
34 lines (31 loc) · 1.37 KB
/
publishing.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Sets up publishing of release artifacts.
// Note: Keep this script in sync across all airbnb open source projects.
apply plugin: 'com.vanniktech.maven.publish'
// https://vanniktech.github.io/gradle-maven-publish-plugin/other/
publishing {
repositories {
maven {
// The "name" value creates a task like `publishAllPublicationsTo[Name]Repository
// In this case, publishAllPublicationsToAirbnbArtifactoryRepository
name = 'airbnbArtifactory'
url = version.toString().endsWith("SNAPSHOT") ? findProperty("ARTIFACTORY_SNAPSHOT_URL") : findProperty("ARTIFACTORY_RELEASE_URL")
credentials {
username = findProperty("ARTIFACTORY_USERNAME")
password = findProperty("ARTIFACTORY_PASSWORD")
}
}
}
}
mavenPublishing {
if (findProperty("enforceSnapshotVersion").toString().toBoolean() && !findProperty("VERSION_NAME").toString().endsWith("-SNAPSHOT")) {
throw new org.gradle.api.tasks.TaskInstantiationException(
"Cannot publish non snapshot version(${findProperty("VERSION_NAME")}) if 'enforceSnapshotVersion' property is set!"
)
}
if (findProperty("doNotSignRelease").toString().toBoolean()) {
println("Skipping release signing")
} else {
println("Signing release with gpg")
signAllPublications()
}
}