1- val jvmVersion = 21
2-
31plugins {
4- // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
5- id(" org.jetbrains.kotlin.jvm" ) version " 2.2.20"
6-
7- // Apply the java-library plugin for API and implementation separation.
2+ alias(libs.plugins.kotlin.jvm)
83 `java- library`
94 `maven- publish`
105}
116
127repositories {
13- // Use Maven Central for resolving dependencies.
148 mavenCentral()
9+ mavenLocal()
1510}
1611
1712dependencies {
18- // Align versions of all Kotlin components
19- implementation(platform(" org.jetbrains.kotlin:kotlin-bom" ))
20-
21- // Use the Kotlin JDK 8 standard library.
22- implementation(" org.jetbrains.kotlin:kotlin-stdlib-jdk8" )
23-
24- // Use the Kotlin test library.
25- testImplementation(" org.jetbrains.kotlin:kotlin-test" )
26-
27- // Use the Kotlin JUnit integration.
28- testImplementation(" org.jetbrains.kotlin:kotlin-test-junit" )
13+ implementation(platform(libs.kotlin.bom))
14+ implementation(libs.bundles.kotlin)
15+ testImplementation(libs.bundles.test)
2916}
3017
3118publishing {
@@ -34,28 +21,30 @@ publishing {
3421 name = " GitHubPackages"
3522 url = uri(" https://maven.pkg.github.com/venture-falcon/capsule" )
3623 credentials {
37- username = System .getenv(" GPR_USER" )
38- password = System .getenv(" GPR_TOKEN" )
24+ val user = properties[" gpr.user" ] ? : System .getenv(" GPR_USER" )
25+ val token = properties[" gpr.token" ] ? : System .getenv(" GPR_TOKEN" )
26+ username = requireNotNull(user.toString()) { " Found no username for GitHub packages access" }
27+ password = requireNotNull(token.toString()) { " Found no token for GitHub packages access" }
3928 }
4029 }
4130 }
4231 publications {
4332 register<MavenPublication >(" gpr" ) {
4433 groupId = " io.nexure"
4534 artifactId = " capsule"
46- version = project.findProperty( " versionId " ) as String?
35+ version = " 3.2.1 "
4736 from(components[" java" ])
4837 }
4938 }
5039}
5140
41+ kotlin { jvmToolchain(21 ) }
42+
5243java {
5344 sourceCompatibility = JavaVersion .VERSION_21
5445 targetCompatibility = JavaVersion .VERSION_21
5546 withJavadocJar()
5647 withSourcesJar()
5748}
5849
59- kotlin {
60- jvmToolchain(jvmVersion)
61- }
50+
0 commit comments