Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 12 additions & 34 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2024 kopiLeft Services SARL, Tunis TN
* Copyright (c) 2013-2026 kopiLeft Services SARL, Tunis TN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,15 +15,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

import org.kopi.galite.gradle._java
import org.kopi.galite.gradle._publishing
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import org.kopi.galite.gradle.configureMavenCentralPom
import org.kopi.galite.gradle.signPublication

plugins {
id("org.jetbrains.kotlin.jvm") version "1.9.0" apply false
id("maven-publish")
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("org.jetbrains.kotlin.jvm") version "1.9.20" apply false
id("com.vanniktech.maven.publish") version "0.34.0"
}

val releasableProjects = listOf(
Expand Down Expand Up @@ -67,35 +65,15 @@ subprojects {
allprojects {
if (this.name in releasableProjects) {
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "signing")
_java {
withJavadocJar()
withSourcesJar()
}
apply(plugin = "com.vanniktech.maven.publish")

_publishing {
publications {
create<MavenPublication>("Galite") {
artifactId = project.name
from(project.components["java"])
pom {
configureMavenCentralPom(project)
}
signPublication(project)
}
mavenPublishing {
publishToMavenCentral(automaticRelease = true)
signAllPublications()
configure(JavaLibrary(sourcesJar = true, javadocJar = JavadocJar.Javadoc()))
pom {
configureMavenCentralPom(project)
}
}
}
}

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
username.set(System.getenv("SONATYPE_USERNAME"))
password.set(System.getenv("SONATYPE_PASSWORD"))
}
}
}
18 changes: 1 addition & 17 deletions buildSrc/src/main/kotlin/org/kopi/galite/gradle/Publishing.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2022 kopiLeft Services SARL, Tunis TN
* Copyright (c) 2013-2026 kopiLeft Services SARL, Tunis TN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -58,19 +58,3 @@ fun MavenPom.configureMavenCentralPom(project: Project) {
developerConnection.set("scm:git:git@github.com:kopiLeft/Galite.git")
}
}

fun MavenPublication.signPublication(project: Project) {
project.extensions.configure<SigningExtension>("signing") {
useInMemoryPgpKeys(System.getenv("GPG_PRIVATE_KEY"),
System.getenv("GPG_PRIVATE_PASSWORD"))
sign(this@signPublication)
}
}

fun Project._publishing(configure: PublishingExtension.() -> Unit) {
extensions.configure("publishing", configure)
}

fun Project._java(configure: JavaPluginExtension.() -> Unit) {
extensions.configure("java", configure)
}
51 changes: 14 additions & 37 deletions galite-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2025 kopiLeft Services SARL, Tunis TN
* Copyright (c) 2013-2026 kopiLeft Services SARL, Tunis TN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,56 +15,33 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

import com.vanniktech.maven.publish.GradlePlugin
import com.vanniktech.maven.publish.JavadocJar
import org.kopi.galite.gradle.configureMavenCentralPom

plugins {
id("maven-publish")
id("signing")
id("com.vanniktech.maven.publish")
}

subprojects {
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "signing")
apply(plugin = "java-gradle-plugin")
apply(plugin = "com.vanniktech.maven.publish")

dependencies {
if (project.name != "galite-common-plugin") {
api(project(":galite-plugins:galite-common-plugin"))
}
}

java {
withJavadocJar()
withSourcesJar()
}
mavenPublishing {
publishToMavenCentral(automaticRelease = true)

project.plugins.withId("java-gradle-plugin") {
publishing {
publications {
create<MavenPublication>("pluginMaven") {
artifactId = project.name
pom {
configureMavenCentralPom(project)
}
signing {
useInMemoryPgpKeys(System.getenv("GPG_PRIVATE_KEY"), System.getenv("GPG_PRIVATE_PASSWORD"))
sign(publishing.publications["pluginMaven"])
}
}
}
}
afterEvaluate {
publishing {
publications.named<MavenPublication>("PluginMarkerMaven") {
pom {
configureMavenCentralPom(project)
}
}
signing {
useInMemoryPgpKeys(System.getenv("GPG_PRIVATE_KEY"), System.getenv("GPG_PRIVATE_PASSWORD"))
sign(publishing.publications["PluginMarkerMaven"])
}
}
signAllPublications()

configure(GradlePlugin(javadocJar = JavadocJar.Javadoc(), sourcesJar = true))

pom {
configureMavenCentralPom(project)
}
}
}
4 changes: 2 additions & 2 deletions galite-plugins/galite-dbschema-generator/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2025 kopiLeft Services SARL, Tunis TN
* Copyright (c) 2013-2026 kopiLeft Services SARL, Tunis TN
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand All @@ -24,7 +24,7 @@ plugins {

dependencies {
api("org.reflections", "reflections", "0.10.2")
implementation("org.jetbrains.kotlin", "kotlin-gradle-plugin", "1.9.0")
implementation("org.jetbrains.kotlin", "kotlin-gradle-plugin", "1.9.20")
// Exposed dependency
implementation("org.jetbrains.exposed", "exposed-core", Versions.EXPOSED)
implementation("org.jetbrains.exposed", "exposed-jodatime", Versions.EXPOSED)
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading