Skip to content

Commit

Permalink
WIP - JRelease to local
Browse files Browse the repository at this point in the history
  • Loading branch information
pacu committed Oct 2, 2024
1 parent c1b0289 commit 512bd0e
Showing 1 changed file with 51 additions and 34 deletions.
85 changes: 51 additions & 34 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import java.util.Base64

import org.jreleaser.model.Active
/*
* This file was generated by the Gradle 'init' task.
*
Expand All @@ -15,7 +15,7 @@ plugins {
id("io.gitlab.arturbosch.detekt") version "1.23.7"

`maven-publish`
// id("org.jreleaser") version "1.14.0"
id("org.jreleaser") version "1.14.0"
signing
// Apply the java-library plugin for API and implementation separation.
`java-library`
Expand Down Expand Up @@ -59,8 +59,8 @@ tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
// Apply a specific Java toolchain to ease working on different environments.
java {



withJavadocJar()
withSourcesJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
Expand All @@ -81,6 +81,28 @@ tasks.named<Test>("test") {
useJUnitPlatform()
}

//jreleaser {
// signing {
// active.set(Active.ALWAYS)
// armored.set(true)
// }
// deploy {
// maven {
// mavenCentral {
//
// active.set(Active.ALWAYS)
//// url.set("https://central.sonatype.com/api/v1/publisher")
// stagingRepository.set("target/staging-deploy")
//
//// sonatype {
//// active.set(Active)
//// url.set("https://central.sonatype.com/api/v1/publisher")
//// stagingRepository.set("target/staging-deploy")
//// }
// }
// }
// }
//}

val publicationVariant = "release"
val myVersion = project.property("LIBRARY_VERSION").toString()
Expand Down Expand Up @@ -129,41 +151,33 @@ publishing {
}
}
repositories {
val mavenUrl = if (isSnapshot) {
project.property("ZECDEV_MAVEN_PUBLISH_SNAPSHOT_URL").toString()
} else {
project.property("ZECDEV_MAVEN_PUBLISH_RELEASE_URL").toString()
}
val mavenPublishUsername = project.property("ZECDEV_MAVEN_PUBLISH_USERNAME").toString()
val mavenPublishPassword = project.property("ZECDEV_MAVEN_PUBLISH_PASSWORD").toString()

mavenLocal {
name = "MavenLocal"
}
maven(mavenUrl) {
name = "MavenCentral"
credentials {
username = mavenPublishUsername
password = mavenPublishPassword
}
maven {
url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI()
}
}
}

//jreleaser {
// deploy {
// maven {
// mavenCentral {
// app {
// active = 'ALWAYS'
// url = 'https://central.sonatype.com/api/v1/publisher'
// stagingRepository('target/staging-deploy')
// }
// repositories {
// val mavenUrl = if (isSnapshot) {
// project.property("ZECDEV_MAVEN_PUBLISH_SNAPSHOT_URL").toString()
// } else {
// project.property("ZECDEV_MAVEN_PUBLISH_RELEASE_URL").toString()
// }
// val mavenPublishUsername = project.property("ZECDEV_MAVEN_PUBLISH_USERNAME").toString()
// val mavenPublishPassword = project.property("ZECDEV_MAVEN_PUBLISH_PASSWORD").toString()
//
// mavenLocal {
// name = "MavenLocal"
// }
// maven(mavenUrl) {
// name = "MavenCentral"
// credentials {
// username = mavenPublishUsername
// password = mavenPublishPassword
// }
// }
// }
//}
//
}


//signing {
// // Maven Central requires signing for non-snapshots
// isRequired = !isSnapshot
Expand All @@ -185,6 +199,9 @@ publishing {
// sign(publishing.publications)
//}




// Workaround for:
// - https://youtrack.jetbrains.com/issue/KT-46466
// - https://github.com/gradle/gradle/issues/26091
Expand Down

0 comments on commit 512bd0e

Please sign in to comment.