@@ -4,18 +4,18 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
44plugins {
55 `maven- publish`
66 id(" io.github.gradle-nexus.publish-plugin" ) version " 1.3.0"
7- id(" com.github.johnrengelman.shadow" ) version " 8.1.0 "
7+ id(" com.github.johnrengelman.shadow" ) version " 8.1.1 "
88 id(" cl.franciscosolis.blossom-extended" ) version " 1.3.1"
99
10- kotlin(" jvm" ) version " 1.8 .10"
11- id(" org.jetbrains.dokka" ) version " 1.8.10 "
10+ kotlin(" jvm" ) version " 1.9 .10"
11+ id(" org.jetbrains.dokka" ) version " 1.9.0 "
1212}
1313
1414val env = project.rootProject.file(" .env" ).let { file ->
1515 if (file.exists()) file.readLines().filter { it.isNotBlank() && ! it.startsWith(" #" ) && it.split(" =" ).size == 2 }.associate { it.split(" =" )[0 ] to it.split(" =" )[1 ] } else emptyMap()
1616}.toMutableMap().apply { putAll(System .getenv()) }
1717
18- val projectVersion = env[" VERSION" ] ? : " 0.3.1 -SNAPSHOT"
18+ val projectVersion = env[" VERSION" ] ? : " 0.4.0 -SNAPSHOT"
1919
2020group = " xyz.theprogramsrc"
2121version = projectVersion
@@ -26,21 +26,31 @@ repositories {
2626 mavenCentral()
2727
2828 maven(" https://s01.oss.sonatype.org/content/groups/public/" )
29+ maven(" https://oss.sonatype.org/content/repositories/snapshots/" )
30+ maven(" https://oss.sonatype.org/content/repositories/releases/" )
2931 maven(" https://oss.sonatype.org/content/groups/public/" )
3032 maven(" https://hub.spigotmc.org/nexus/content/repositories/snapshots/" )
33+ maven(" https://repo.papermc.io/repository/maven-public/" )
3134 maven(" https://repo.codemc.org/repository/maven-public/" )
3235 maven(" https://jitpack.io/" )
3336}
3437
3538dependencies {
36- compileOnly(" xyz.theprogramsrc:simplecoreapi:0.6.2 -SNAPSHOT" )
39+ compileOnly(" xyz.theprogramsrc:simplecoreapi:0.8.0 -SNAPSHOT" )
3740
3841 implementation(" org.apache.logging.log4j:log4j-api:2.20.0" )
3942 implementation(" org.apache.logging.log4j:log4j-core:2.20.0" )
4043
41- testImplementation(" org.junit.jupiter:junit-jupiter:5.9.2 " )
44+ testImplementation(" org.junit.jupiter:junit-jupiter:5.10.0 " )
4245}
4346
47+ blossom {
48+ replaceToken(" @name@" , rootProject.name)
49+ replaceToken(" @version@" , project.version.toString())
50+ replaceToken(" @description@" , project.description)
51+ replaceToken(" @git_short@" , env[" GIT_COMMIT_SHORT_HASH" ] ? : " unknown" )
52+ replaceToken(" @git_full@" , env[" GIT_COMMIT_LONG_HASH" ] ? : " unknown" )
53+ }
4454
4555tasks {
4656 named<ShadowJar >(" shadowJar" ) {
@@ -88,8 +98,7 @@ tasks {
8898 }
8999
90100 dokkaHtml {
91- outputDirectory.set(file(project.buildDir.absolutePath + " /dokka" ))
92-
101+ outputDirectory.set(layout.buildDirectory.dir(" dokka/" ))
93102 }
94103}
95104
@@ -161,14 +170,16 @@ publishing {
161170 }
162171}
163172
164- nexusPublishing {
165- repositories {
166- sonatype {
167- nexusUrl.set(uri(" https://s01.oss.sonatype.org/service/local/" ))
168- snapshotRepositoryUrl.set(uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" ))
173+ if (env[" ENV" ] == " prod" ) {
174+ nexusPublishing {
175+ repositories {
176+ sonatype {
177+ nexusUrl.set(uri(" https://s01.oss.sonatype.org/service/local/" ))
178+ snapshotRepositoryUrl.set(uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" ))
169179
170- username.set(env[" SONATYPE_USERNAME" ])
171- password.set(env[" SONATYPE_PASSWORD" ])
180+ username.set(env[" SONATYPE_USERNAME" ])
181+ password.set(env[" SONATYPE_PASSWORD" ])
182+ }
172183 }
173184 }
174185}
0 commit comments