Skip to content

Commit

Permalink
Enabled publishing of core module SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
jlink committed Dec 6, 2024
1 parent 0a8eb2e commit 9db5ec0
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 1 deletion.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
val jqwik2Version by rootProject.extra { "2.0.0-alpha-1-SNAPSHOT" }

75 changes: 75 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,88 @@
plugins {
id("buildlogic.java-api-conventions")
`maven-publish`
signing
}

description = "Jqwik2 core module"

val jqwik2Version: String = "${rootProject.extra.get("jqwik2Version")}"
val isSnapshotRelease = isSnapshotRelease(jqwik2Version)
val artifactName = "jqwik2-core"

fun isSnapshotRelease(versionString: String): Boolean {
return versionString.endsWith("SNAPSHOT")
}

dependencies {
api(libs.apiguardian)
//implementation(project(":utilities"))

testImplementation(libs.junit.jupiter)
testImplementation(libs.assertj.core)
}

tasks.jar {
archiveBaseName.set("jqwik2-core")
archiveVersion.set("${rootProject.extra.get("jqwik2Version")}")
manifest {
attributes("Automatic-Module-Name" to "net.jqwik2.core")
}
}

publishing {
repositories {
maven {
// hint: credentials are in ~/.gradle/gradle.properties
val repoUsername: String = project.findProperty("tokenUsername") as? String ?: ""
val repoPassword: String = project.findProperty("tokenPassword") as? String ?: ""

credentials {
username = repoUsername
password = repoPassword
}

val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = uri(if (isSnapshotRelease) { snapshotsRepoUrl } else { releasesRepoUrl })
}
}
publications {
create<MavenPublication>("jqwik2Core") {
groupId = "net.jqwik"
artifactId = artifactName
from(components["java"])
pom {
version = jqwik2Version
groupId = "net.jqwik"
name = artifactId
description = "$description"
url = "https://github.org/jqwik-team/jqwik2"
licenses {
license {
name = "Eclipse Public License - v 2.0"
url = "http://www.eclipse.org/legal/epl-v20.html"
}
}
developers {
developer {
id = "jlink"
name = "Johannes Link"
email = "[email protected]"
}
}
scm {
connection = "scm:git:git://github.com/jqwik-team/jqwik2.git"
developerConnection = "scm:git:git://github.com/jqwik-team/jqwik2.git"
url = "https://github.com/jqwik-team/jqwik2"
}
}
}
}
}

signing {
if (!isSnapshotRelease) {
sign(publishing.publications["jqwik2Core"])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ java {
languageVersion = JavaLanguageVersion.of(javaVersion)
vendor = JvmVendorSpec.matching(javaVendor)
}

}

tasks.withType<JavaCompile> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ plugins {
id("buildlogic.java-common-conventions")
`java-library`
}

java {
withJavadocJar()
withSourcesJar()
}

0 comments on commit 9db5ec0

Please sign in to comment.