diff --git a/java/lib/build.gradle.kts b/java/lib/build.gradle.kts index e3721e75..27dbe44d 100644 --- a/java/lib/build.gradle.kts +++ b/java/lib/build.gradle.kts @@ -1,25 +1,20 @@ plugins { - // Apply the java-library plugin for API and implementation separation. - `java-library` - `maven-publish` + `maven-publish` // Apply the maven-publish plugin before java-library for publishing to GitHub Packages. + `java-library` // Apply the java-library plugin for API and implementation separation. } +group = "dev.arkbuilders" +version = "1.0-SNAPSHOT" + repositories { - // Use Maven Central for resolving dependencies. - mavenCentral() + mavenCentral() // Use Maven Central for resolving dependencies. } dependencies { - // Use JUnit Jupiter for testing. - testImplementation(libs.junit.jupiter) - + testImplementation(libs.junit.jupiter) // Use JUnit Jupiter for testing. testRuntimeOnly("org.junit.platform:junit-platform-launcher") - - // This dependency is exported to consumers, that is to say found on their compile classpath. - api(libs.commons.math3) - - // This dependency is used internally, and not exposed to consumers on their own compile classpath. - implementation(libs.guava) + api(libs.commons.math3) // This dependency is exported to consumers, that is to say found on their compile classpath. + implementation(libs.guava) // This dependency is used internally, and not exposed to consumers on their own compile classpath. } // Apply a specific Java toolchain to ease working on different environments. @@ -30,11 +25,9 @@ java { } tasks.named("test") { - // Use JUnit Platform for unit tests. - useJUnitPlatform() - // Set the JVM argument for the java.library.path (To import rust compiled library) - val rustLibPath = projectDir.resolve("../../target/release").absolutePath jvmArgs = listOf("-Djava.library.path=$rustLibPath") + useJUnitPlatform() // Use JUnit Platform for unit tests. + val rustLibPath = projectDir.resolve("../../target/release").absolutePath // Set the JVM argument for the java.library.path (To import rust compiled library) } tasks.named("javadoc") { @@ -43,6 +36,12 @@ tasks.named("javadoc") { } publishing { + // Define a Maven publication for the 'maven' repository + publications { + create("Maven") { + from(components["java"]) + } + } repositories { maven { name = "GitHubPackages"