|
| 1 | +@file:Suppress("UnstableApiUsage") |
| 2 | + |
| 3 | +import com.novoda.gradle.release.PublishExtension |
1 | 4 | import org.jetbrains.dokka.gradle.DokkaTask |
2 | 5 |
|
3 | 6 | plugins { |
@@ -26,3 +29,56 @@ val dokka by tasks.getting(DokkaTask::class) { |
26 | 29 | suffix = "#L" |
27 | 30 | } |
28 | 31 | } |
| 32 | + |
| 33 | +apply(plugin = Plugins.bintrayRelease) |
| 34 | + |
| 35 | +configure<PublishExtension> { |
| 36 | + bintrayUser = propertyOrEmpty("Turtle_Bintray_User") |
| 37 | + bintrayKey = propertyOrEmpty("Turtle_Bintray_ApiKey") |
| 38 | + |
| 39 | + userOrg = Turtle.BINTRAY_USER |
| 40 | + repoName = Turtle.BINTRAY_REPOSITORY |
| 41 | + |
| 42 | + groupId = Turtle.GROUP_ID |
| 43 | + artifactId = Turtle.ARTIFACT_ID |
| 44 | + publishVersion = Turtle.VERSION_NAME |
| 45 | + |
| 46 | + desc = Turtle.DESCRIPTION |
| 47 | + setLicences(Turtle.LICENSE) |
| 48 | + website = Turtle.WEBSITE |
| 49 | + issueTracker = Turtle.ISSUE_TRACKER |
| 50 | + repository = Turtle.SOURCE_CONTROL |
| 51 | +} |
| 52 | + |
| 53 | +if (project.isPublishing()) { |
| 54 | + apply(plugin = "maven") |
| 55 | + |
| 56 | + gradle.taskGraph.whenReady { |
| 57 | + tasks.withType<GenerateMavenPom>().configureEach { |
| 58 | + pom.description.set(Turtle.DESCRIPTION) |
| 59 | + pom.packaging = "jar" |
| 60 | + pom.url.set(Turtle.WEBSITE) |
| 61 | + |
| 62 | + pom.scm { |
| 63 | + url.set(Turtle.SOURCE_CONTROL) |
| 64 | + connection.set(Turtle.SOURCE_CONTROL) |
| 65 | + developerConnection.set(Turtle.SOURCE_CONTROL) |
| 66 | + } |
| 67 | + |
| 68 | + pom.licenses { |
| 69 | + license { |
| 70 | + name.set("The Apache Software License, Version 2.0") |
| 71 | + url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") |
| 72 | + distribution.set("repo") |
| 73 | + } |
| 74 | + } |
| 75 | + |
| 76 | + pom.developers { |
| 77 | + developer { |
| 78 | + id.set(Turtle.DEVELOPER_USER) |
| 79 | + name.set(Turtle.DEVELOPER_NAME) |
| 80 | + } |
| 81 | + } |
| 82 | + } |
| 83 | + } |
| 84 | +} |
0 commit comments