Added release var.
This commit is contained in:
parent
78f6ba7842
commit
e2357e9c2a
1 changed files with 12 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
||||||
import com.jfrog.bintray.gradle.BintrayExtension
|
import com.jfrog.bintray.gradle.BintrayExtension
|
||||||
|
import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
import org.gradle.api.publish.maven.MavenPom
|
import org.gradle.api.publish.maven.MavenPom
|
||||||
import org.jetbrains.dokka.DokkaConfiguration
|
import org.jetbrains.dokka.DokkaConfiguration
|
||||||
|
@ -25,6 +26,7 @@ description = "Pinboard Poster for Kotlin/Java"
|
||||||
val gitHub = "ethauvin/$name"
|
val gitHub = "ethauvin/$name"
|
||||||
val mavenUrl = "https://github.com/$gitHub"
|
val mavenUrl = "https://github.com/$gitHub"
|
||||||
val deployDir = "deploy"
|
val deployDir = "deploy"
|
||||||
|
var release = false
|
||||||
|
|
||||||
// Load local.properties
|
// Load local.properties
|
||||||
File("local.properties").apply {
|
File("local.properties").apply {
|
||||||
|
@ -106,7 +108,7 @@ tasks {
|
||||||
|
|
||||||
val gitIsDirty by creating(Exec::class) {
|
val gitIsDirty by creating(Exec::class) {
|
||||||
description = "Fails if git has uncommitted changes."
|
description = "Fails if git has uncommitted changes."
|
||||||
group = PublishingPlugin.PUBLISH_TASK_GROUP
|
group = "verification"
|
||||||
commandLine("git", "diff-index", "--quiet", "HEAD", "--")
|
commandLine("git", "diff-index", "--quiet", "HEAD", "--")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,11 +164,15 @@ tasks {
|
||||||
destination = file("$projectDir/pom.xml")
|
destination = file("$projectDir/pom.xml")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val bintrayUpload by getting(BintrayUploadTask::class) {
|
||||||
|
dependsOn(generatePomFileForMavenJavaPublication, gitTag)
|
||||||
|
}
|
||||||
|
|
||||||
fun findProperty(s: String) = project.findProperty(s) as String?
|
fun findProperty(s: String) = project.findProperty(s) as String?
|
||||||
bintray {
|
bintray {
|
||||||
user = findProperty("bintray.user")
|
user = findProperty("bintray.user")
|
||||||
key = findProperty("bintray.apikey")
|
key = findProperty("bintray.apikey")
|
||||||
publish = true
|
publish = release
|
||||||
setPublications(publicationName)
|
setPublications(publicationName)
|
||||||
pkg.apply {
|
pkg.apply {
|
||||||
repo = "maven"
|
repo = "maven"
|
||||||
|
@ -198,7 +204,9 @@ tasks {
|
||||||
"release" {
|
"release" {
|
||||||
description = "Release version ${project.version} to Bintray."
|
description = "Release version ${project.version} to Bintray."
|
||||||
group = PublishingPlugin.PUBLISH_TASK_GROUP
|
group = PublishingPlugin.PUBLISH_TASK_GROUP
|
||||||
mustRunAfter(generatePomFileForMavenJavaPublication, gitTag)
|
dependsOn(bintrayUpload)
|
||||||
dependsOn("bintrayUpload", "publishToMavenLocal")
|
doFirst {
|
||||||
|
release = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue