This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 516dfb985ff2b6f638f3a25c2159ef3afcbf3377
Author: Martin Desruisseaux <martin.desruisse...@geomatys.com>
AuthorDate: Tue Nov 28 17:51:06 2023 +0100

    Build configuration: remove `sis.library-conventions.gradle.kts`
    because it depends on `kotlin-dsl`, which is not compatible with Java 21.
    Even if Apache SIS targets Java 11, we want it to compile with newer Java 
versions.
---
 buildSrc/build.gradle.kts                          |  1 -
 .../main/kotlin/sis.library-conventions.gradle.kts | 68 ----------------------
 endorsed/build.gradle.kts                          | 15 ++++-
 gradle.properties                                  | 13 +++++
 incubator/build.gradle.kts                         | 16 ++++-
 optional/build.gradle.kts                          | 15 ++++-
 6 files changed, 55 insertions(+), 73 deletions(-)

diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts
index 8b74d433bc..cfbc70ea94 100644
--- a/buildSrc/build.gradle.kts
+++ b/buildSrc/build.gradle.kts
@@ -16,7 +16,6 @@
  */
 plugins {
     `java-gradle-plugin`
-    `kotlin-dsl`
 }
 
 gradlePlugin {
diff --git a/buildSrc/src/main/kotlin/sis.library-conventions.gradle.kts 
b/buildSrc/src/main/kotlin/sis.library-conventions.gradle.kts
deleted file mode 100644
index 140c601648..0000000000
--- a/buildSrc/src/main/kotlin/sis.library-conventions.gradle.kts
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-group = "org.apache.sis"
-version = "2.0-SNAPSHOT"
-
-/*
- * "org.apache.sis.buildtools" is a custom Gradle plugin for building a 
project with Module Source Hierarchy
- * as specified in 
https://docs.oracle.com/en/java/javase/21/docs/specs/man/javac.html#directory-hierarchies
- * The expected hierarchy is:
- *
- *   endorsed
- *     ├─ build
- *     └─ src
- *         ├─ org.apache.sis.metadata
- *         │    ├─ main
- *         │    │   ├─ module-info.java
- *         │    │   └─ org/apache/sis/metadata/…
- *         │    └─ test
- *         │        └─ org/apache/sis/metadata/…
- *         ├─ org.apache.sis.referencing
- *         │    ├─ main
- *         │    │   ├─ module-info.java
- *         │    │   └─ org/apache/sis/referencing/…
- *         │    └─ test
- *         │        └─ org/apache/sis/referencing/…
- *         └─ etc.
- */
-plugins {
-    `java-library`
-    `maven-publish`
-    signing
-}
-
-/*
- * Configuration of the repositories where to deploy artifacts.
- */
-publishing {
-    repositories {
-        maven {
-            name = "Apache"
-            url = uri(if (version.toString().endsWith("SNAPSHOT"))
-                      
"https://repository.apache.org/content/repositories/snapshots"; else
-                      
"https://repository.apache.org/service/local/staging/deploy/maven2";)
-            credentials {
-                val asfNexusUsername = 
providers.gradleProperty("asfNexusUsername")
-                val asfNexusPassword = 
providers.gradleProperty("asfNexusPassword")
-                if (asfNexusUsername.isPresent() && 
asfNexusPassword.isPresent()) {
-                    username = asfNexusUsername.get()
-                    password = asfNexusPassword.get()
-                }
-            }
-        }
-    }
-}
diff --git a/endorsed/build.gradle.kts b/endorsed/build.gradle.kts
index 39ec0363db..614b3c4b21 100644
--- a/endorsed/build.gradle.kts
+++ b/endorsed/build.gradle.kts
@@ -14,6 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+group = "org.apache.sis"
+// The version is specified in `gradle.properties`.
 
 /*
  * This project uses a custom Gradle plugin for building a project with Module 
Source Hierarchy as specified
@@ -38,7 +40,10 @@
  *         └─ etc.
  */
 plugins {
-    id("sis.library-conventions")
+    `java-library`
+    `maven-publish`
+    signing
+    id("net.linguica.maven-settings") version "0.5"
     id("org.apache.sis.buildtools")
 }
 
@@ -441,6 +446,14 @@ publishing {
             }
         }
     }
+    /* Following block is currently repeated in all sub-projects. */
+    repositories {
+        maven {
+            val stage = if (version.toString().endsWith("SNAPSHOT")) 
"snapshots" else "releases"
+            name = providers.gradleProperty("${stage}Id").get()
+            url = uri(providers.gradleProperty("${stage}URL").get())
+        }
+    }
 }
 
 signing {
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000000..df07faace3
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,13 @@
+#
+# Branch-specific or tag-specific properties of Apache SIS.
+# This file provides a single location where version number
+# and deployment URL can be changed before new tags.
+#
+version=2.0-SNAPSHOT
+
+# Following identifiers should match <server> elements in the Maven 
settings.xml file.
+# They are used for fetching the credentials for publishing binaries in a 
repository.
+snapshotsId  = apache.snapshots.https
+releasesId   = apache.releases.https
+snapshotsURL = https://repository.apache.org/content/repositories/snapshots
+releasesURL  = 
https://repository.apache.org/service/local/staging/deploy/maven2
diff --git a/incubator/build.gradle.kts b/incubator/build.gradle.kts
index cf4ec04008..58d4fefc52 100644
--- a/incubator/build.gradle.kts
+++ b/incubator/build.gradle.kts
@@ -14,15 +14,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+group = "org.apache.sis"
+// The version is specified in `gradle.properties`.
 
 /*
  * This project uses a custom Gradle plugin for building a project with Module 
Source Hierarchy.
  * See the Gradle build script in the `endorsed` directory for more 
information.
  */
 plugins {
-    id("sis.library-conventions")
-    id("org.apache.sis.buildtools")
     antlr
+    `java-library`
+    `maven-publish`     // For local deployment only. Not to be published on 
Maven Central.
+    id("net.linguica.maven-settings") version "0.5"
+    id("org.apache.sis.buildtools")
 }
 
 /*
@@ -149,4 +153,12 @@ publishing {
             }
         }
     }
+    /* Following block is currently repeated in all sub-projects. */
+    repositories {
+        maven {
+            val stage = if (version.toString().endsWith("SNAPSHOT")) 
"snapshots" else "releases"
+            name = providers.gradleProperty("${stage}Id").get()
+            url = uri(providers.gradleProperty("${stage}URL").get())
+        }
+    }
 }
diff --git a/optional/build.gradle.kts b/optional/build.gradle.kts
index b813615a6f..323605fdb8 100644
--- a/optional/build.gradle.kts
+++ b/optional/build.gradle.kts
@@ -14,6 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+group = "org.apache.sis"
+// The version is specified in `gradle.properties`.
 
 val pathToFX = System.getenv("PATH_TO_FX")
 if (pathToFX == null) {
@@ -28,7 +30,10 @@ if (!File(pathToFX, "javafx.base.jar").isFile()) {
  * See the Gradle build script in the `endorsed` directory for more 
information.
  */
 plugins {
-    id("sis.library-conventions")
+    `java-library`
+    `maven-publish`
+    signing
+    id("net.linguica.maven-settings") version "0.5"
     id("org.apache.sis.buildtools")
 }
 
@@ -171,6 +176,14 @@ publishing {
             }
         }
     }
+    /* Following block is currently repeated in all sub-projects. */
+    repositories {
+        maven {
+            val stage = if (version.toString().endsWith("SNAPSHOT")) 
"snapshots" else "releases"
+            name = providers.gradleProperty("${stage}Id").get()
+            url = uri(providers.gradleProperty("${stage}URL").get())
+        }
+    }
 }
 
 signing {

Reply via email to