Skip to content

Commit 36a5b17

Browse files
authored
Add BOM (Bill of Materials) (#1216)
Fixes #788
1 parent a8cecc3 commit 36a5b17

File tree

5 files changed

+145
-38
lines changed

5 files changed

+145
-38
lines changed

bom/build.gradle.kts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
plugins { id("polaris-bom") }
21+
22+
description = "Apache Polaris - Bill of Materials (BOM)"
23+
24+
dependencies {
25+
constraints {
26+
api(rootProject)
27+
api(project(":polaris-api-catalog-service"))
28+
api(project(":polaris-api-iceberg-service"))
29+
api(project(":polaris-api-management-model"))
30+
api(project(":polaris-api-management-service"))
31+
32+
api(project(":polaris-container-spec-helper"))
33+
api(project(":polaris-immutables"))
34+
api(project(":polaris-version"))
35+
36+
api(project(":polaris-config-docs-annotations"))
37+
api(project(":polaris-config-docs-generator"))
38+
39+
api(project(":polaris-core"))
40+
api(project(":polaris-service-common"))
41+
42+
api(project(":polaris-eclipselink"))
43+
api(project(":polaris-jpa-model"))
44+
45+
api(project(":polaris-quarkus-admin"))
46+
api(project(":polaris-quarkus-defaults"))
47+
api(project(":polaris-quarkus-server"))
48+
api(project(":polaris-quarkus-service"))
49+
api(project(":polaris-quarkus-spark-tests"))
50+
51+
api(project(":polaris-tests"))
52+
}
53+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import publishing.PublishingHelperPlugin
21+
22+
plugins {
23+
`java-platform`
24+
`maven-publish`
25+
signing
26+
id("polaris-spotless")
27+
}
28+
29+
apply<PublishingHelperPlugin>()

build-logic/src/main/kotlin/polaris-java.gradle.kts

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* under the License.
1818
*/
1919

20-
import com.diffplug.spotless.FormatterFunc
21-
import java.io.Serializable
2220
import net.ltgt.gradle.errorprone.errorprone
2321
import org.gradle.api.tasks.compile.JavaCompile
2422
import org.gradle.api.tasks.testing.Test
@@ -30,7 +28,7 @@ plugins {
3028
`java-library`
3129
`java-test-fixtures`
3230
`jvm-test-suite`
33-
id("com.diffplug.spotless")
31+
id("polaris-spotless")
3432
id("jacoco-report-aggregation")
3533
id("net.ltgt.errorprone")
3634
}
@@ -157,41 +155,6 @@ tasks.withType<Jar>().configureEach {
157155
}
158156
}
159157

160-
spotless {
161-
java {
162-
target("src/*/java/**/*.java")
163-
googleJavaFormat()
164-
licenseHeaderFile(rootProject.file("codestyle/copyright-header-java.txt"))
165-
endWithNewline()
166-
custom(
167-
"disallowWildcardImports",
168-
object : Serializable, FormatterFunc {
169-
override fun apply(text: String): String {
170-
val regex = "~/import .*\\.\\*;/".toRegex()
171-
if (regex.matches(text)) {
172-
throw GradleException("Wildcard imports disallowed - ${regex.findAll(text)}")
173-
}
174-
return text
175-
}
176-
},
177-
)
178-
toggleOffOn()
179-
}
180-
kotlinGradle {
181-
ktfmt().googleStyle()
182-
licenseHeaderFile(rootProject.file("codestyle/copyright-header-java.txt"), "$")
183-
target("*.gradle.kts")
184-
}
185-
format("xml") {
186-
target("src/**/*.xml", "src/**/*.xsd")
187-
targetExclude("codestyle/copyright-header.xml")
188-
eclipseWtp(com.diffplug.spotless.extra.wtp.EclipseWtpFormatterStep.XML)
189-
.configFile(rootProject.file("codestyle/org.eclipse.wst.xml.core.prefs"))
190-
// getting the license-header delimiter right is a bit tricky.
191-
// licenseHeaderFile(rootProject.file("codestyle/copyright-header.xml"), '<^[!?].*$')
192-
}
193-
}
194-
195158
dependencies { errorprone(versionCatalogs.named("libs").findLibrary("errorprone").get()) }
196159

197160
java {
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import com.diffplug.spotless.FormatterFunc
21+
import gradle.kotlin.dsl.accessors._fa00c0b20184971a79f32516372275b9.java
22+
import gradle.kotlin.dsl.accessors._fa00c0b20184971a79f32516372275b9.spotless
23+
import java.io.Serializable
24+
import org.gradle.api.GradleException
25+
26+
plugins { id("com.diffplug.spotless") }
27+
28+
spotless {
29+
java {
30+
target("src/*/java/**/*.java")
31+
googleJavaFormat()
32+
licenseHeaderFile(rootProject.file("codestyle/copyright-header-java.txt"))
33+
endWithNewline()
34+
custom(
35+
"disallowWildcardImports",
36+
object : Serializable, FormatterFunc {
37+
override fun apply(text: String): String {
38+
val regex = "~/import .*\\.\\*;/".toRegex()
39+
if (regex.matches(text)) {
40+
throw GradleException("Wildcard imports disallowed - ${regex.findAll(text)}")
41+
}
42+
return text
43+
}
44+
},
45+
)
46+
toggleOffOn()
47+
}
48+
kotlinGradle {
49+
ktfmt().googleStyle()
50+
licenseHeaderFile(rootProject.file("codestyle/copyright-header-java.txt"), "$")
51+
target("*.gradle.kts")
52+
}
53+
format("xml") {
54+
target("src/**/*.xml", "src/**/*.xsd")
55+
targetExclude("codestyle/copyright-header.xml")
56+
eclipseWtp(com.diffplug.spotless.extra.wtp.EclipseWtpFormatterStep.XML)
57+
.configFile(rootProject.file("codestyle/org.eclipse.wst.xml.core.prefs"))
58+
// getting the license-header delimiter right is a bit tricky.
59+
// licenseHeaderFile(rootProject.file("codestyle/copyright-header.xml"), '<^[!?].*$')
60+
}
61+
}

gradle/projects.main.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#
1919
#
2020

21+
polaris-bom=bom
2122
polaris-core=polaris-core
2223
polaris-api-iceberg-service=api/iceberg-service
2324
polaris-api-management-model=api/management-model

0 commit comments

Comments
 (0)