jamesfredley commented on code in PR #15467:
URL: https://github.com/apache/grails-core/pull/15467#discussion_r3214125319


##########
grails-gradle/bom-property-overrides/build.gradle:
##########
@@ -0,0 +1,81 @@
+/*
+ *  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
+ *
+ *    https://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 'groovy'
+    id 'java-gradle-plugin'
+    id 'org.apache.grails.buildsrc.properties'
+    id 'org.apache.grails.buildsrc.dependency-validator'
+    id 'org.apache.grails.buildsrc.compile'
+    id 'org.apache.grails.buildsrc.publish'
+    id 'org.apache.grails.buildsrc.sbom'
+    id 'org.apache.grails.gradle.grails-code-style'
+}
+
+version = projectVersion
+group = 'org.apache.grails'
+
+ext {
+    pomTitle = 'Grails BOM Property Overrides Gradle Plugin'
+    pomDescription = 'A standalone Gradle plugin that enables Maven-style 
property-based version overrides for any Gradle platform() BOM. Reads the BOM 
POM <properties> block and lets consumers override versions via 
gradle.properties or ext[\'property.name\']. Reusable independently of Grails.'
+    pomMavenPublicationName = 'pluginMaven'
+}
+
+dependencies {
+    implementation platform(project(':grails-gradle-bom'))
+
+    // compile with the Groovy version provided by Gradle

Review Comment:
   You're right that `groovy` is now a managed version on `grails-gradle-bom`, 
but the comment was about *why* this dependency is `compileOnly` rather than 
`implementation`: the Groovy version we compile against is the one Gradle ships 
in the running distribution (per the [Gradle/Groovy compatibility 
matrix](https://docs.gradle.org/current/userguide/compatibility.html#groovy)), 
so we deliberately don't bundle our own. Rewrote the comment in 5254097 to make 
that explicit and to also mention the `transitive = false` + classpath excludes 
that prevent Spock from leaking a different Groovy onto the test classpath. 
Same comment+pattern as `grails-gradle/plugins/build.gradle`.



##########
grails-gradle/bom-property-overrides/build.gradle:
##########
@@ -0,0 +1,81 @@
+/*
+ *  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
+ *
+ *    https://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 'groovy'
+    id 'java-gradle-plugin'
+    id 'org.apache.grails.buildsrc.properties'
+    id 'org.apache.grails.buildsrc.dependency-validator'
+    id 'org.apache.grails.buildsrc.compile'
+    id 'org.apache.grails.buildsrc.publish'
+    id 'org.apache.grails.buildsrc.sbom'
+    id 'org.apache.grails.gradle.grails-code-style'
+}
+
+version = projectVersion
+group = 'org.apache.grails'
+
+ext {
+    pomTitle = 'Grails BOM Property Overrides Gradle Plugin'
+    pomDescription = 'A standalone Gradle plugin that enables Maven-style 
property-based version overrides for any Gradle platform() BOM. Reads the BOM 
POM <properties> block and lets consumers override versions via 
gradle.properties or ext[\'property.name\']. Reusable independently of Grails.'
+    pomMavenPublicationName = 'pluginMaven'
+}
+
+dependencies {
+    implementation platform(project(':grails-gradle-bom'))
+
+    // compile with the Groovy version provided by Gradle
+    // see: https://docs.gradle.org/current/userguide/compatibility.html#groovy
+    compileOnly 'org.apache.groovy:groovy'
+
+    // Testing - Gradle TestKit is auto-added by java-gradle-plugin
+    testImplementation('org.spockframework:spock-core') { transitive = false }

Review Comment:
   Yes - same reason as in `grails-gradle/plugins/build.gradle`: Spock 
2.3-groovy-4.0 transitively depends on `org.apache.groovy:groovy`, which would 
conflict with the Groovy version Gradle ships at runtime. The `transitive = 
false` + the `testCompileClasspath` / `testRuntimeClasspath` excludes a few 
lines down are the belt-and-suspenders defense (Spock has historically had one 
or two transitive groovy deps that needed a hard exclude rather than just 
`transitive = false`). I expanded the comment block above the dependency in 
5254097 to make this rationale explicit so it doesn't read as redundant.



##########
grails-gradle/bom-property-overrides/build.gradle:
##########
@@ -0,0 +1,81 @@
+/*
+ *  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
+ *
+ *    https://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 'groovy'
+    id 'java-gradle-plugin'
+    id 'org.apache.grails.buildsrc.properties'
+    id 'org.apache.grails.buildsrc.dependency-validator'
+    id 'org.apache.grails.buildsrc.compile'
+    id 'org.apache.grails.buildsrc.publish'
+    id 'org.apache.grails.buildsrc.sbom'
+    id 'org.apache.grails.gradle.grails-code-style'
+}
+
+version = projectVersion
+group = 'org.apache.grails'
+
+ext {
+    pomTitle = 'Grails BOM Property Overrides Gradle Plugin'
+    pomDescription = 'A standalone Gradle plugin that enables Maven-style 
property-based version overrides for any Gradle platform() BOM. Reads the BOM 
POM <properties> block and lets consumers override versions via 
gradle.properties or ext[\'property.name\']. Reusable independently of Grails.'
+    pomMavenPublicationName = 'pluginMaven'
+}
+
+dependencies {
+    implementation platform(project(':grails-gradle-bom'))
+
+    // compile with the Groovy version provided by Gradle
+    // see: https://docs.gradle.org/current/userguide/compatibility.html#groovy
+    compileOnly 'org.apache.groovy:groovy'
+
+    // Testing - Gradle TestKit is auto-added by java-gradle-plugin
+    testImplementation('org.spockframework:spock-core') { transitive = false }
+    testImplementation 'org.apache.groovy:groovy-test-junit5'
+    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
+}
+
+configurations {
+    testCompileClasspath.exclude group: 'org.apache.groovy', module: 'groovy'

Review Comment:
   Switched to parenthesised form for both `testCompileClasspath.exclude(...)` 
and `testRuntimeClasspath.exclude(...)` in 5254097.



##########
grails-gradle/bom-property-overrides/build.gradle:
##########
@@ -0,0 +1,81 @@
+/*
+ *  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
+ *
+ *    https://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 'groovy'
+    id 'java-gradle-plugin'
+    id 'org.apache.grails.buildsrc.properties'
+    id 'org.apache.grails.buildsrc.dependency-validator'
+    id 'org.apache.grails.buildsrc.compile'
+    id 'org.apache.grails.buildsrc.publish'
+    id 'org.apache.grails.buildsrc.sbom'
+    id 'org.apache.grails.gradle.grails-code-style'
+}
+
+version = projectVersion
+group = 'org.apache.grails'
+
+ext {
+    pomTitle = 'Grails BOM Property Overrides Gradle Plugin'
+    pomDescription = 'A standalone Gradle plugin that enables Maven-style 
property-based version overrides for any Gradle platform() BOM. Reads the BOM 
POM <properties> block and lets consumers override versions via 
gradle.properties or ext[\'property.name\']. Reusable independently of Grails.'
+    pomMavenPublicationName = 'pluginMaven'
+}
+
+dependencies {
+    implementation platform(project(':grails-gradle-bom'))
+
+    // compile with the Groovy version provided by Gradle
+    // see: https://docs.gradle.org/current/userguide/compatibility.html#groovy
+    compileOnly 'org.apache.groovy:groovy'
+
+    // Testing - Gradle TestKit is auto-added by java-gradle-plugin
+    testImplementation('org.spockframework:spock-core') { transitive = false }
+    testImplementation 'org.apache.groovy:groovy-test-junit5'
+    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
+}
+
+configurations {
+    testCompileClasspath.exclude group: 'org.apache.groovy', module: 'groovy'
+    testRuntimeClasspath.exclude group: 'org.apache.groovy', module: 'groovy'
+}
+
+gradlePlugin {
+    plugins {
+        bomPropertyOverrides {

Review Comment:
   Switched to `register('bomPropertyOverrides') {` in 5254097 - IDE now 
resolves the closure target as a `NamedDomainObjectProvider<PluginDeclaration>` 
and gives type hints inside the block.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to