jamesfredley commented on code in PR #15615:
URL: https://github.com/apache/grails-core/pull/15615#discussion_r3171673192
##########
settings.gradle:
##########
@@ -470,6 +465,30 @@ includeBuild('./build-logic') {
name = 'build-logic-root'
}
+// Grails-Micronaut "island" - kept on its own dependency graph because the
Micronaut
+// platform pins Groovy 5 / Spock 2.4-groovy-5.0, which is incompatible with
the
+// Groovy 4 / Spock 2.3-groovy-4.0 stack the rest of grails-core targets.
Skipping
+// these projects (via -PskipMicronautTests) keeps Micronaut's version
overrides
+// from leaking into builds where Groovy 4 is in play (notably the joint
validation
+// build that swaps in an apache/groovy 4.x snapshot).
+if (!skipMicronautTests) {
+ include(
+ 'grails-micronaut-bom',
+ 'grails-micronaut',
+ 'grails-test-examples-issue-11767',
+ 'grails-test-examples-micronaut',
+ 'grails-test-examples-micronaut-groovy-only',
+ 'grails-test-examples-plugins-issue-11767',
+ 'grails-test-examples-plugins-micronaut-singleton',
+ )
+ project(':grails-micronaut-bom').projectDir = file('grails-bom/micronaut')
+ project(':grails-test-examples-issue-11767').projectDir =
file('grails-test-examples/issue-11767')
+ project(':grails-test-examples-micronaut').projectDir =
file('grails-test-examples/micronaut')
+ project(':grails-test-examples-micronaut-groovy-only').projectDir =
file('grails-test-examples/micronaut-groovy-only')
+ project(':grails-test-examples-plugins-issue-11767').projectDir =
file('grails-test-examples/plugins/issue-11767')
+ project(':grails-test-examples-plugins-micronaut-singleton').projectDir =
file('grails-test-examples/plugins/micronaut-singleton')
+}
Review Comment:
Valid catch - the joint build_grails CI run actually hit this exact failure
on the first commit:
```
Build file 'grails-doc/build.gradle' line: 150
Could not determine the dependencies of task ':grails-doc:publishGuide'.
> Could not create task ':grails-doc:generateBomDocumentation'.
> Project with path ':grails-micronaut-bom' could not be found in project
':grails-doc'.
```
`./gradlew build` realises `:grails-doc:publishGuide` ->
`:grails-doc:generateBomDocumentation` during task-graph computation, which
forces the lazy `configure { ... }` block to run.
Fixed in 2623613716 by resolving the Micronaut BOM via
`findProject(':grails-micronaut-bom')` (same null-tolerant lookup style as
`GrailsDependencyValidatorPlugin.detectBomPath`/`collectBomVersions`) and
gating every Micronaut-specific `dependsOn`, `inputs.files`, `outputs.file`,
and `doLast` block on a non-null result. With the island in the graph the task
behaves identically to before; when it's skipped, `generateBomDocumentation`
produces only the default and Hibernate 5 BOM pages.
Verified `./gradlew :grails-doc:build -PskipMicronautTests --dry-run` ->
BUILD SUCCESSFUL.
##########
settings.gradle:
##########
@@ -73,6 +73,16 @@ buildCache {
rootProject.name = 'grails.core.ROOT'
+// When set, the Grails-Micronaut "island" is excluded from the build graph
entirely:
+// * grails-micronaut (Grails plugin that re-exports the Micronaut platform)
+// * grails-micronaut-bom (overrides Groovy/Spock to Groovy 5 / Spock
2.4-groovy-5.0)
+// * the five grails-test-examples that consume grails-micronaut-bom
+//
+// Used by .github/workflows/groovy-joint-workflow.yml so the joint Groovy 4
snapshot
+// build does not try to compile Spock specs against a Groovy-5-only Spock
artifact.
+// See https://github.com/apache/grails-core/issues/15613.
+def skipMicronautTests =
providers.gradleProperty('skipMicronautTests').isPresent()
Review Comment:
Surveyed the project's existing toggle conventions before changing this. The
religion across the codebase is **presence-based**:
```
gradle/grails-data-tck-config.gradle: if
(project.hasProperty('skipHibernate5Tests') && ...
gradle/functional-test-config.gradle: if
(project.hasProperty('skipFunctionalTests')) {
build-logic/.../GrailsCodeStylePlugin.groovy: task.onlyIf {
!project.hasProperty('skipCodeStyle') }
build-logic/.../GrailsDependencyValidatorPlugin.groovy: if
(!project.hasProperty('skipDependencyValidation')) {
```
Every existing `skipXxx` / `onlyXxx` toggle treats *any* invocation of
`-PskipXxx` as enabled, ignoring the value. Switching `skipMicronautTests` to
boolean-parsed semantics would make it the sole exception, which contradicts
the established pattern. `providers.gradleProperty(...).isPresent()` in
settings.gradle is the Settings-context equivalent of
`project.hasProperty(...)` (which isn't available before projects are
evaluated) and preserves the same semantic.
The misleading bit was the `#skipMicronautTests=true` example in
`gradle.properties` - that did imply value mattered. Dropped it in 2623613716
and added a note that the toggle is presence-based, like the other skip* flags.
Keeping the `isPresent()` check.
--
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]