@@ -9,7 +9,7 @@ plugins {
99val javaVersion = 25
1010
1111group = " net.hypejet"
12- version = System .getenv( " GITHUB_REF_NAME " ) ? : " 1.0-SNAPSHOT"
12+ version = releaseTag( ) ? : " 1.0-SNAPSHOT"
1313description = " A Java library making modular programming easier"
1414
1515repositories {
@@ -48,40 +48,56 @@ tasks {
4848publishing {
4949 publications.create<MavenPublication >(" maven" ) {
5050 from(components[" java" ])
51- }
52- }
5351
54- mavenPublishing {
55- publishToMavenCentral()
56- signAllPublications()
52+ pom {
53+ artifactId = project.name.lowercase()
5754
58- pom {
59- url = " https://github.com/Hypejet/Modules"
55+ name = project.name
56+ description = project.description
57+ url = " https://github.com/Hypejet/Modules"
6058
61- licenses {
62- license {
63- name = " The Apache License, Version 2.0"
64- url = " https://www.apache.org/licenses/LICENSE-2.0.txt"
59+ licenses {
60+ license {
61+ name = " The Apache License, Version 2.0"
62+ url = " https://www.apache.org/licenses/LICENSE-2.0.txt"
63+ }
6564 }
66- }
6765
68- developers {
69- developer {
70- id = " Codestech1"
71- name = " Codestech"
72- email = " codestech@hypejet.net"
66+ developers {
67+ developer {
68+ id = " Codestech1"
69+ name = " Codestech"
70+ email = " codestech@hypejet.net"
71+ }
7372 }
74- }
7573
76- scm {
77- connection = " scm:git:git://github.com/Hypejet/Modules.git"
78- developerConnection = " scm:git:ssh://github.com:Hypejet/Modules.git"
79- url = " https://github.com/Hypejet/Modules"
74+ scm {
75+ connection = " scm:git:git://github.com/Hypejet/Modules.git"
76+ developerConnection = " scm:git:ssh://github.com:Hypejet/Modules.git"
77+ url = " https://github.com/Hypejet/Modules"
78+ }
8079 }
8180 }
8281}
8382
83+ mavenPublishing {
84+ publishToMavenCentral()
85+ signAllPublications()
86+ }
87+
8488indraSpotlessLicenser {
8589 licenseHeaderFile(rootProject.file(" LICENSE_HEADER" ))
8690 property(" YEAR" , Year .now().value.toString())
91+ }
92+
93+ private fun releaseTag (): String? {
94+ val ref = System .getenv(" GITHUB_REF" ) ? : return null
95+ val tagRefPrefix = " refs/tags/"
96+
97+ if (! ref.startsWith(tagRefPrefix))
98+ return null
99+
100+ val tag = ref.removePrefix(tagRefPrefix)
101+ if (tag.isEmpty() || ! tag.startsWith(" v" )) return null
102+ return tag.removePrefix(" v" ).ifEmpty { null }
87103}
0 commit comments