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

snazy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new 36a5b1757 Add BOM (Bill of Materials) (#1216)
36a5b1757 is described below

commit 36a5b175763f8c8fe2367ec41e78f95587ef7a8a
Author: Robert Stupp <[email protected]>
AuthorDate: Fri Mar 21 08:51:24 2025 +0100

    Add BOM (Bill of Materials) (#1216)
    
    Fixes #788
---
 bom/build.gradle.kts                               | 53 +++++++++++++++++++
 build-logic/src/main/kotlin/polaris-bom.gradle.kts | 29 ++++++++++
 .../src/main/kotlin/polaris-java.gradle.kts        | 39 +-------------
 .../src/main/kotlin/polaris-spotless.gradle.kts    | 61 ++++++++++++++++++++++
 gradle/projects.main.properties                    |  1 +
 5 files changed, 145 insertions(+), 38 deletions(-)

diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts
new file mode 100644
index 000000000..8dae437c5
--- /dev/null
+++ b/bom/build.gradle.kts
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+plugins { id("polaris-bom") }
+
+description = "Apache Polaris - Bill of Materials (BOM)"
+
+dependencies {
+  constraints {
+    api(rootProject)
+    api(project(":polaris-api-catalog-service"))
+    api(project(":polaris-api-iceberg-service"))
+    api(project(":polaris-api-management-model"))
+    api(project(":polaris-api-management-service"))
+
+    api(project(":polaris-container-spec-helper"))
+    api(project(":polaris-immutables"))
+    api(project(":polaris-version"))
+
+    api(project(":polaris-config-docs-annotations"))
+    api(project(":polaris-config-docs-generator"))
+
+    api(project(":polaris-core"))
+    api(project(":polaris-service-common"))
+
+    api(project(":polaris-eclipselink"))
+    api(project(":polaris-jpa-model"))
+
+    api(project(":polaris-quarkus-admin"))
+    api(project(":polaris-quarkus-defaults"))
+    api(project(":polaris-quarkus-server"))
+    api(project(":polaris-quarkus-service"))
+    api(project(":polaris-quarkus-spark-tests"))
+
+    api(project(":polaris-tests"))
+  }
+}
diff --git a/build-logic/src/main/kotlin/polaris-bom.gradle.kts 
b/build-logic/src/main/kotlin/polaris-bom.gradle.kts
new file mode 100644
index 000000000..450039fdd
--- /dev/null
+++ b/build-logic/src/main/kotlin/polaris-bom.gradle.kts
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+
+import publishing.PublishingHelperPlugin
+
+plugins {
+  `java-platform`
+  `maven-publish`
+  signing
+  id("polaris-spotless")
+}
+
+apply<PublishingHelperPlugin>()
diff --git a/build-logic/src/main/kotlin/polaris-java.gradle.kts 
b/build-logic/src/main/kotlin/polaris-java.gradle.kts
index 5ac990972..f50aecde9 100644
--- a/build-logic/src/main/kotlin/polaris-java.gradle.kts
+++ b/build-logic/src/main/kotlin/polaris-java.gradle.kts
@@ -17,8 +17,6 @@
  * under the License.
  */
 
-import com.diffplug.spotless.FormatterFunc
-import java.io.Serializable
 import net.ltgt.gradle.errorprone.errorprone
 import org.gradle.api.tasks.compile.JavaCompile
 import org.gradle.api.tasks.testing.Test
@@ -30,7 +28,7 @@ plugins {
   `java-library`
   `java-test-fixtures`
   `jvm-test-suite`
-  id("com.diffplug.spotless")
+  id("polaris-spotless")
   id("jacoco-report-aggregation")
   id("net.ltgt.errorprone")
 }
@@ -157,41 +155,6 @@ tasks.withType<Jar>().configureEach {
   }
 }
 
-spotless {
-  java {
-    target("src/*/java/**/*.java")
-    googleJavaFormat()
-    licenseHeaderFile(rootProject.file("codestyle/copyright-header-java.txt"))
-    endWithNewline()
-    custom(
-      "disallowWildcardImports",
-      object : Serializable, FormatterFunc {
-        override fun apply(text: String): String {
-          val regex = "~/import .*\\.\\*;/".toRegex()
-          if (regex.matches(text)) {
-            throw GradleException("Wildcard imports disallowed - 
${regex.findAll(text)}")
-          }
-          return text
-        }
-      },
-    )
-    toggleOffOn()
-  }
-  kotlinGradle {
-    ktfmt().googleStyle()
-    licenseHeaderFile(rootProject.file("codestyle/copyright-header-java.txt"), 
"$")
-    target("*.gradle.kts")
-  }
-  format("xml") {
-    target("src/**/*.xml", "src/**/*.xsd")
-    targetExclude("codestyle/copyright-header.xml")
-    eclipseWtp(com.diffplug.spotless.extra.wtp.EclipseWtpFormatterStep.XML)
-      .configFile(rootProject.file("codestyle/org.eclipse.wst.xml.core.prefs"))
-    // getting the license-header delimiter right is a bit tricky.
-    // licenseHeaderFile(rootProject.file("codestyle/copyright-header.xml"), 
'<^[!?].*$')
-  }
-}
-
 dependencies { 
errorprone(versionCatalogs.named("libs").findLibrary("errorprone").get()) }
 
 java {
diff --git a/build-logic/src/main/kotlin/polaris-spotless.gradle.kts 
b/build-logic/src/main/kotlin/polaris-spotless.gradle.kts
new file mode 100644
index 000000000..96f6af87b
--- /dev/null
+++ b/build-logic/src/main/kotlin/polaris-spotless.gradle.kts
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+
+import com.diffplug.spotless.FormatterFunc
+import gradle.kotlin.dsl.accessors._fa00c0b20184971a79f32516372275b9.java
+import gradle.kotlin.dsl.accessors._fa00c0b20184971a79f32516372275b9.spotless
+import java.io.Serializable
+import org.gradle.api.GradleException
+
+plugins { id("com.diffplug.spotless") }
+
+spotless {
+  java {
+    target("src/*/java/**/*.java")
+    googleJavaFormat()
+    licenseHeaderFile(rootProject.file("codestyle/copyright-header-java.txt"))
+    endWithNewline()
+    custom(
+      "disallowWildcardImports",
+      object : Serializable, FormatterFunc {
+        override fun apply(text: String): String {
+          val regex = "~/import .*\\.\\*;/".toRegex()
+          if (regex.matches(text)) {
+            throw GradleException("Wildcard imports disallowed - 
${regex.findAll(text)}")
+          }
+          return text
+        }
+      },
+    )
+    toggleOffOn()
+  }
+  kotlinGradle {
+    ktfmt().googleStyle()
+    licenseHeaderFile(rootProject.file("codestyle/copyright-header-java.txt"), 
"$")
+    target("*.gradle.kts")
+  }
+  format("xml") {
+    target("src/**/*.xml", "src/**/*.xsd")
+    targetExclude("codestyle/copyright-header.xml")
+    eclipseWtp(com.diffplug.spotless.extra.wtp.EclipseWtpFormatterStep.XML)
+      .configFile(rootProject.file("codestyle/org.eclipse.wst.xml.core.prefs"))
+    // getting the license-header delimiter right is a bit tricky.
+    // licenseHeaderFile(rootProject.file("codestyle/copyright-header.xml"), 
'<^[!?].*$')
+  }
+}
diff --git a/gradle/projects.main.properties b/gradle/projects.main.properties
index 88fbcd0fa..3f9199294 100644
--- a/gradle/projects.main.properties
+++ b/gradle/projects.main.properties
@@ -18,6 +18,7 @@
 #
 #
 
+polaris-bom=bom
 polaris-core=polaris-core
 polaris-api-iceberg-service=api/iceberg-service
 polaris-api-management-model=api/management-model

Reply via email to