Skip to content

Commit 84501c4

Browse files
committed
Update build.gradle.kts
1 parent ab385a5 commit 84501c4

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

build.gradle.kts

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import java.util.*
2+
13
plugins {
24
kotlin("jvm") version "1.4.21"
35
java
@@ -16,18 +18,23 @@ repositories {
1618
jcenter()
1719
}
1820

19-
val sourcesJar by tasks.creating(Jar::class) {
20-
archiveClassifier.set("sources")
21-
from(sourceSets.getByName("main").allSource)
21+
tasks {
22+
create<Jar>("sourceJar") {
23+
archiveClassifier.set("sources")
24+
from(sourceSets["main"].allSource)
25+
}
26+
withType<Jar> {
27+
archiveBaseName.set(artifactId)
28+
}
2229
}
2330

2431
publishing {
2532
publications {
26-
register("gpr", MavenPublication::class) {
33+
create<MavenPublication>("mavenJava") {
2734
from(components["java"])
28-
29-
artifact(sourcesJar)
30-
35+
artifact(tasks["sourceJar"])
36+
artifactId = artifactId
37+
version = artifactVersion
3138
pom {
3239
name.set(artifactId)
3340
description.set(shortDesc)
@@ -36,6 +43,7 @@ publishing {
3643
license {
3744
name.set("The 3-Clause BSD License")
3845
url.set("https://opensource.org/licenses/BSD-3-Clause")
46+
distribution.set("repo")
3947
}
4048
}
4149
developers {
@@ -70,27 +78,36 @@ bintray {
7078
user = System.getenv("BINTRAY_USER")
7179
key = System.getenv("BINTRAY_APIKEY")
7280
publish = true
73-
setPublications(artifactId)
81+
setConfigurations("archives")
82+
7483
pkg.apply {
7584
repo = "maven"
7685
name = artifactId
77-
userOrg = "servicestack"
86+
userOrg = orgName.toLowerCase()
87+
7888
websiteUrl = "https://gist.cafe"
89+
issueTrackerUrl = "https://github.com/$repoName/issues"
7990
githubRepo = repoName
8091
vcsUrl = "https://github.com/$repoName"
8192
description = shortDesc
82-
setLabels("kotlin")
83-
setLicenses("BSD")
93+
setLabels("servicestack","gistcafe","kotlin")
94+
setLicenses("BSD 3-Clause")
8495
desc = shortDesc
8596

8697
version.apply {
8798
name = artifactVersion
8899
desc = repoUrl
100+
released = Date().toString()
89101
vcsTag = artifactVersion
90102
}
91103
}
92104
}
93105

106+
artifacts {
107+
add("archives", tasks["jar"])
108+
add("archives", tasks["sourceJar"])
109+
}
110+
94111
tasks.test {
95112
useJUnitPlatform()
96113
}

0 commit comments

Comments
 (0)