diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts new file mode 100644 index 0000000000..8dae437c52 --- /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 0000000000..450039fddd --- /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() diff --git a/build-logic/src/main/kotlin/polaris-java.gradle.kts b/build-logic/src/main/kotlin/polaris-java.gradle.kts index e3b1767078..f6c9c343e3 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") } @@ -150,41 +148,6 @@ tasks.withType(Jar::class).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 0000000000..96f6af87b0 --- /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 88fbcd0fa4..3f9199294f 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