Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions .github/workflows/groovy-joint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,19 @@ jobs:
run: |
sed -i "/['\"]groovy\.version['\"][[:space:]]*:/c\'groovy.version':'${{ needs.build_groovy.outputs.groovyVersion }}'," dependencies.gradle
- name: "🔨 Build and test Grails using the locally built Groovy snapshot"
# -PskipMicronautTests excludes the Grails-Micronaut "island" (grails-micronaut,
# grails-micronaut-bom, and the micronaut-tied test-examples) from the build graph.
# That island intentionally pins Groovy 5 / Spock 2.4-groovy-5.0 via grails-micronaut-bom,
# which is incompatible with the Groovy 4.x snapshot this job swaps in above.
# See https://github.com/apache/grails-core/issues/15613.
run: >
./gradlew build
--continue
--stacktrace
-x groovydoc
-PgebAtCheckWaiting
-PskipCodeStyle
-PskipMicronautTests
-PmaxTestParallel=3
env:
GRAILS_INCLUDE_MAVEN_LOCAL: true
5 changes: 5 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ gradleCycloneDxPluginVersion=3.0.0
# micronaut libraries not in the bom due to the potential for spring mismatches
micronautPlatformVersion=5.0.0-M2

# Pass -PskipMicronautTests to drop the Grails-Micronaut "island" (grails-micronaut,
# grails-micronaut-bom, and the micronaut-tied test-examples) from the build graph.
# See settings.gradle for the gating logic and grails-core#15613 for the rationale.
#skipMicronautTests=true

# Libraries only specific to test apps, these should not be exposed
ersatzVersion=4.0.1
grailsSpringSecurityVersion=8.0.0-SNAPSHOT
Expand Down
49 changes: 34 additions & 15 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Comment thread
jamesfredley marked this conversation as resolved.
Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We already have test slicing, and this isn't skipping tests. It's skipping projects. We should rename this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Renamed in cf47e9f:

  • skipMicronautTests -> skipMicronautProjects across settings.gradle, gradle.properties, .github/workflows/groovy-joint-workflow.yml, and the grails-doc comment.
  • Name now reflects what the flag actually does (skip whole projects, not tests) and removes the overlap with test-related flag naming.

While in there, I also guarded the two unconditional Micronaut BOM cross-references in grails-doc/build.gradle (lines 193, 206) - per Oracle architectural review, when the Micronaut BOM page is intentionally omitted under the skip flag, the default and Hibernate 5 BOM pages should not link to it. Verified locally with both flag states (./gradlew :grails-doc:generateBomDocumentation):

Flag state Pages generated Cross-links
no flag Default, Hibernate 5, Micronaut all 3 link to each other
-PskipMicronautProjects Default, Hibernate 5 only link to each other (no dead Micronaut link)


include(
'grails-bootstrap',
'grails-cache',
Expand Down Expand Up @@ -119,7 +129,6 @@ include(
'grails-base-bom',
'grails-bom', // the default bom
'grails-hibernate5-bom',
'grails-micronaut-bom',

// Docs
'grails-doc',
Expand Down Expand Up @@ -192,15 +201,11 @@ include(

// wrapper
'grails-wrapper',

// micronaut plugin for integration with Grails
'grails-micronaut',
)

project(':grails-bom').projectDir = file('grails-bom/default')
project(':grails-base-bom').projectDir = file('grails-bom/base')
project(':grails-hibernate5-bom').projectDir = file('grails-bom/hibernate5')
project(':grails-micronaut-bom').projectDir = file('grails-bom/micronaut')

// Instead of using : to separate nested projects, fix the project directories by setting the projectDir explicitly
// (Preserve the parent directory name as part of the nested project name)
Expand Down Expand Up @@ -400,20 +405,15 @@ include(
// TODO: 'grails-test-examples-gsp-spring-boot',
'grails-test-examples-hyphenated',
'grails-test-examples-issue-11102',
'grails-test-examples-issue-11767',
'grails-test-examples-issue-15228',
'grails-test-examples-issue-698-domain-save-npe',
'grails-test-examples-issue-views-182',
'grails-test-examples-micronaut',
'grails-test-examples-micronaut-groovy-only',
'grails-test-examples-namespaces',
'grails-test-examples-plugins-exploded',
'grails-test-examples-plugins-issue-11767',
'grails-test-examples-plugins-issue11005',
'grails-test-examples-plugins-loadafter',
'grails-test-examples-plugins-loadfirst',
'grails-test-examples-plugins-loadsecond',
'grails-test-examples-plugins-micronaut-singleton',
'grails-test-examples-config-report',
'grails-test-examples-scaffolding',
'grails-test-examples-scaffolding-fields',
Expand Down Expand Up @@ -444,17 +444,12 @@ project(':grails-test-examples-hyphenated').projectDir = file('grails-test-examp
project(':grails-test-examples-issue-views-182').projectDir = file('grails-test-examples/issue-views-182')
project(':grails-test-examples-issue-11102').projectDir = file('grails-test-examples/issue-11102')
project(':grails-test-examples-demo33').projectDir = file('grails-test-examples/demo33')
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-loadfirst').projectDir = file('grails-test-examples/plugins/loadfirst')
project(':grails-test-examples-plugins-loadsecond').projectDir = file('grails-test-examples/plugins/loadsecond')
project(':grails-test-examples-plugins-loadafter').projectDir = file('grails-test-examples/plugins/loadafter')
project(':grails-test-examples-plugins-issue11005').projectDir = file('grails-test-examples/plugins/issue11005')
project(':grails-test-examples-issue-11767').projectDir = file('grails-test-examples/issue-11767')
project(':grails-test-examples-issue-15228').projectDir = file('grails-test-examples/issue-15228')
project(':grails-test-examples-plugins-exploded').projectDir = file('grails-test-examples/plugins/exploded')
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')
project(':grails-test-examples-cache').projectDir = file('grails-test-examples/cache')
project(':grails-test-examples-config-report').projectDir = file('grails-test-examples/config-report')
project(':grails-test-examples-scaffolding').projectDir = file('grails-test-examples/scaffolding')
Expand All @@ -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')
}
Comment thread
jamesfredley marked this conversation as resolved.
Outdated

// Due to https://github.com/gradle/gradle/issues/2986 , we can't change the global exclude for profiles, it must be done everywhere
for (String pattern in DirectoryScanner.defaultExcludes) {
if (pattern.contains('gitignore') || pattern.contains('gitattributes')) {
Expand Down
Loading