From 84501c4615a5af4fb72dfa31cce389ffa47809be Mon Sep 17 00:00:00 2001 From: Demis Bellot Date: Wed, 30 Dec 2020 04:41:29 +0800 Subject: [PATCH] Update build.gradle.kts --- build.gradle.kts | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 82d96d7..06cb1bd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,5 @@ +import java.util.* + plugins { kotlin("jvm") version "1.4.21" java @@ -16,18 +18,23 @@ repositories { jcenter() } -val sourcesJar by tasks.creating(Jar::class) { - archiveClassifier.set("sources") - from(sourceSets.getByName("main").allSource) +tasks { + create("sourceJar") { + archiveClassifier.set("sources") + from(sourceSets["main"].allSource) + } + withType { + archiveBaseName.set(artifactId) + } } publishing { publications { - register("gpr", MavenPublication::class) { + create("mavenJava") { from(components["java"]) - - artifact(sourcesJar) - + artifact(tasks["sourceJar"]) + artifactId = artifactId + version = artifactVersion pom { name.set(artifactId) description.set(shortDesc) @@ -36,6 +43,7 @@ publishing { license { name.set("The 3-Clause BSD License") url.set("https://opensource.org/licenses/BSD-3-Clause") + distribution.set("repo") } } developers { @@ -70,27 +78,36 @@ bintray { user = System.getenv("BINTRAY_USER") key = System.getenv("BINTRAY_APIKEY") publish = true - setPublications(artifactId) + setConfigurations("archives") + pkg.apply { repo = "maven" name = artifactId - userOrg = "servicestack" + userOrg = orgName.toLowerCase() + websiteUrl = "https://gist.cafe" + issueTrackerUrl = "https://github.com/$repoName/issues" githubRepo = repoName vcsUrl = "https://github.com/$repoName" description = shortDesc - setLabels("kotlin") - setLicenses("BSD") + setLabels("servicestack","gistcafe","kotlin") + setLicenses("BSD 3-Clause") desc = shortDesc version.apply { name = artifactVersion desc = repoUrl + released = Date().toString() vcsTag = artifactVersion } } } +artifacts { + add("archives", tasks["jar"]) + add("archives", tasks["sourceJar"]) +} + tasks.test { useJUnitPlatform() }