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
53 changes: 53 additions & 0 deletions bom/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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"))
}
}
29 changes: 29 additions & 0 deletions build-logic/src/main/kotlin/polaris-bom.gradle.kts
Original file line number Diff line number Diff line change
@@ -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>()
39 changes: 1 addition & 38 deletions build-logic/src/main/kotlin/polaris-java.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
}
Expand Down Expand Up @@ -150,41 +148,6 @@ tasks.withType(Jar::class).configureEach {
}
}

spotless {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this related to BOM?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, need formatting, but not "Java"

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 {
Expand Down
61 changes: 61 additions & 0 deletions build-logic/src/main/kotlin/polaris-spotless.gradle.kts
Original file line number Diff line number Diff line change
@@ -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"), '<^[!?].*$')
}
}
1 change: 1 addition & 0 deletions gradle/projects.main.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down