File tree Expand file tree Collapse file tree 2 files changed +24
-22
lines changed
Expand file tree Collapse file tree 2 files changed +24
-22
lines changed Original file line number Diff line number Diff line change @@ -39,3 +39,27 @@ nexusPublishing {
3939 }
4040 }
4141}
42+
43+ tasks.register(" publishRelease" ) {
44+ group = " publishing"
45+ description = " Publish to Maven Central (iff this is a release version)."
46+
47+ onlyIf { ! isSnapshot() }
48+
49+ if (! isSnapshot()) {
50+ dependsOn(" publishToSonatype" , " closeAndReleaseStagingRepositories" )
51+ }
52+ }
53+
54+ tasks.register(" publishSnapshot" ) {
55+ group = " publishing"
56+ description = " Publish to Maven Central (iff this is a snapshot version)."
57+
58+ onlyIf { isSnapshot() }
59+
60+ if (isSnapshot()) {
61+ dependsOn(" publishToSonatype" )
62+ }
63+ }
64+
65+ fun isSnapshot () = version.toString().endsWith(" -SNAPSHOT" )
Original file line number Diff line number Diff line change @@ -33,28 +33,6 @@ val dokkaJavadocJar by tasks.registering(Jar::class) {
3333 from(tasks.dokkaGeneratePublicationJavadoc)
3434}
3535
36- tasks.register(" publishRelease" ) {
37- group = " publishing"
38- description = " Publish to Maven Central (iff this is a release version)."
39-
40- onlyIf { ! isSnapshot() }
41-
42- if (! isSnapshot()) {
43- dependsOn(" publishToSonatype" , " closeAndReleaseStagingRepositories" )
44- }
45- }
46-
47- tasks.register(" publishSnapshot" ) {
48- group = " publishing"
49- description = " Publish to Maven Central (iff this is a snapshot version)."
50-
51- onlyIf { isSnapshot() }
52-
53- if (isSnapshot()) {
54- dependsOn(" publishToSonatype" )
55- }
56- }
57-
5836publishing {
5937 publications {
6038 create<MavenPublication >(" library" ) {
You can’t perform that action at this time.
0 commit comments