1
+ import java.util.*
2
+
1
3
plugins {
2
4
kotlin(" jvm" ) version " 1.4.21"
3
5
java
@@ -16,18 +18,23 @@ repositories {
16
18
jcenter()
17
19
}
18
20
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
+ }
22
29
}
23
30
24
31
publishing {
25
32
publications {
26
- register( " gpr " , MavenPublication :: class ) {
33
+ create< MavenPublication >( " mavenJava " ) {
27
34
from(components[" java" ])
28
-
29
- artifact(sourcesJar)
30
-
35
+ artifact(tasks[ " sourceJar " ])
36
+ artifactId = artifactId
37
+ version = artifactVersion
31
38
pom {
32
39
name.set(artifactId)
33
40
description.set(shortDesc)
@@ -36,6 +43,7 @@ publishing {
36
43
license {
37
44
name.set(" The 3-Clause BSD License" )
38
45
url.set(" https://opensource.org/licenses/BSD-3-Clause" )
46
+ distribution.set(" repo" )
39
47
}
40
48
}
41
49
developers {
@@ -70,27 +78,36 @@ bintray {
70
78
user = System .getenv(" BINTRAY_USER" )
71
79
key = System .getenv(" BINTRAY_APIKEY" )
72
80
publish = true
73
- setPublications(artifactId)
81
+ setConfigurations(" archives" )
82
+
74
83
pkg.apply {
75
84
repo = " maven"
76
85
name = artifactId
77
- userOrg = " servicestack"
86
+ userOrg = orgName.toLowerCase()
87
+
78
88
websiteUrl = " https://gist.cafe"
89
+ issueTrackerUrl = " https://github.com/$repoName /issues"
79
90
githubRepo = repoName
80
91
vcsUrl = " https://github.com/$repoName "
81
92
description = shortDesc
82
- setLabels(" kotlin" )
83
- setLicenses(" BSD" )
93
+ setLabels(" servicestack " , " gistcafe " , " kotlin" )
94
+ setLicenses(" BSD 3-Clause " )
84
95
desc = shortDesc
85
96
86
97
version.apply {
87
98
name = artifactVersion
88
99
desc = repoUrl
100
+ released = Date ().toString()
89
101
vcsTag = artifactVersion
90
102
}
91
103
}
92
104
}
93
105
106
+ artifacts {
107
+ add(" archives" , tasks[" jar" ])
108
+ add(" archives" , tasks[" sourceJar" ])
109
+ }
110
+
94
111
tasks.test {
95
112
useJUnitPlatform()
96
113
}
0 commit comments