Skip to content

Commit

Permalink
Update build.gradle.kts
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Dec 29, 2020
1 parent ab385a5 commit 84501c4
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.util.*

plugins {
kotlin("jvm") version "1.4.21"
java
Expand All @@ -16,18 +18,23 @@ repositories {
jcenter()
}

val sourcesJar by tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
tasks {
create<Jar>("sourceJar") {
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
withType<Jar> {
archiveBaseName.set(artifactId)
}
}

publishing {
publications {
register("gpr", MavenPublication::class) {
create<MavenPublication>("mavenJava") {
from(components["java"])

artifact(sourcesJar)

artifact(tasks["sourceJar"])
artifactId = artifactId
version = artifactVersion
pom {
name.set(artifactId)
description.set(shortDesc)
Expand All @@ -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 {
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit 84501c4

Please sign in to comment.