Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Missing Changes from 6.1.x into 6.2.x #13713

Merged
merged 21 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8c65852
Update actions/cache action to v4 (#13367)
renovate[bot] Jan 26, 2024
972cb93
Update gspVersion to v6.1.3 (#13365)
renovate[bot] Jan 26, 2024
856fcde
Update dependency org.jsoup:jsoup to v1.17.2 (#13363)
renovate[bot] Jan 26, 2024
ecb16f8
Update dependency org.asciidoctor:asciidoctorj to v2.5.11 (#13361)
renovate[bot] Jan 26, 2024
4ba5f37
Update grails-testing-support monorepo to v3.1.2 (#13364)
renovate[bot] Jan 26, 2024
81cbe84
Update datastoreVersion to v8.0.4 (#13360)
renovate[bot] Jan 26, 2024
57fe4c8
Update plugin com.gradle.enterprise to v3.16.2 (#13366)
renovate[bot] Jan 26, 2024
ed1c0b4
Update apache-tomcat monorepo to v9.0.85 (#13359)
renovate[bot] Jan 26, 2024
228500a
Update dependency org.grails:grails-datastore-gorm-hibernate5 to v8.0…
renovate[bot] Jan 26, 2024
a58ae33
fix: Groovy 3.0.20 compatibility (#13371)
matrei Jan 26, 2024
7fd6d7c
Update Grails BOM (#13374)
puneetbehl Jan 26, 2024
66030dd
Decouple Nexus Publish and Release Jobs (#13375)
puneetbehl Jan 26, 2024
7eaeeaf
Update release.yml
puneetbehl Jan 30, 2024
3048525
Back to 6.1.3-SNAPSHOT
puneetbehl Jan 31, 2024
5312c1f
fix(build): Set groovyVersion property in joint workflow (#13376)
matrei Feb 6, 2024
7bc852a
Migrate to Develocity build cache connector (#13387)
jprinet Feb 20, 2024
82a9d0e
fix: Plugin config loading in Micronaut beans (#13388)
matrei Feb 20, 2024
e2061a8
feat(core): Remove/Replace deprecated Groovy classes to prepare upgra…
puneetbehl Feb 27, 2024
d001c6c
Merge branch '6.1.x' into 6.2.x
jdaugherty Oct 1, 2024
a7f00c7
Revert "feat(core): Remove/Replace deprecated Groovy classes to prepa…
jdaugherty Oct 1, 2024
e43ceee
Merge remote-tracking branch 'upstream/6.2.x' into 6.2.x
jdaugherty Oct 2, 2024
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
4 changes: 0 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
with:
arguments: build groovydoc
publish:
Expand All @@ -55,8 +53,6 @@ jobs:
uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/groovy-joint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ jobs:
- name: Checkout Groovy 3_0_X (Grails 5 and later)
if: startsWith(github.ref, 'refs/heads/6.') || startsWith(github.base_ref, '6.') || startsWith(github.ref, 'refs/heads/5.') || startsWith(github.base_ref, '5.')
run: cd .. && git clone --depth 1 https://github.com/apache/groovy.git -b GROOVY_3_0_X --single-branch
- name: Set CI_GROOVY_VERSION for Grails
- name: Get Groovy version for Grails
id: groovy-version
run: |
cd ../groovy
echo "CI_GROOVY_VERSION=$(cat gradle.properties | grep groovyVersion | cut -d\= -f2 | tr -d '[:space:]')" >> $GITHUB_ENV
echo "value=$(cat gradle.properties | grep groovyVersion | cut -d\= -f2 | tr -d '[:space:]')" >> $GITHUB_OUTPUT
- name: Prepare GE Set-up Configuration
id: ge_conf
Expand Down Expand Up @@ -130,7 +129,7 @@ jobs:
distribution: 'adopt'
java-version: '11'
- name: Cache local Maven repository & Groovy
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
with:
path: |
~/groovy
Expand All @@ -143,10 +142,11 @@ jobs:
id: build_grails
uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3
env:
ORG_GRADLE_PROJECT_groovyVersion: ${{ needs.build_groovy.outputs.groovyVersion }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
with:
arguments: |
build
-x groovydoc
-x groovydoc
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
- name: Upload Distribution
if: success()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: grails-${{ steps.release_version.outputs.value }}.zip
path: build/distributions/grails-${{ steps.release_version.outputs.value }}.zip
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/retry-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
arguments: assemble
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
- name: Upload artifacts to the Github release
id: upload_artifact
if: steps.assemble.outcome == 'success'
Expand Down
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ext {
// When making changes in the dependencyVersions, remember to also update the Grails BOM Documentation:
// https://docs.grails.org/snapshot/ref/Dependency%20Versions/Grails%20BOM.html
dependencyVersions = [
'fieldsPlugin' : [version: feildsPluginVersion,
'fieldsPlugin' : [version: fieldsPluginVersion,
group : 'org.grails.plugins',
names : ['fields'],
modules: ['']
Expand Down Expand Up @@ -220,14 +220,14 @@ if (isReleaseVersion) {

allprojects {
repositories {
mavenLocal()
mavenLocal() // Used by the Groovy Joint Validation Github workflow after building groovy locally in CI
mavenCentral()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url = "https://repo.grails.org/grails/core" }
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
if (groovyVersion.endsWith('-SNAPSHOT')) {
maven {
name 'JFrog OSS snapshot repo'
url 'https://oss.jfrog.org/oss-snapshot-local/'
maven { // Used for testing with Groovy snapshots locally
name = 'Groovy Snapshot repository'
url = 'https://groovy.jfrog.io/artifactory/libs-snapshot-local/'
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cglibVersion=2.2.2
commonsLangVersion=2.6
datastoreVersion=8.1.2
directoryWatcherVersion=0.9.9
feildsPluginVersion=5.1.0-SNAPSHOT
fieldsPluginVersion=5.1.0-SNAPSHOT
gdocEngineVersion=1.0.1
gradleNexusPluginVersion=2.3.1
gradleNexusStagingPluginVersion=0.12.0
Expand Down Expand Up @@ -42,6 +42,7 @@ spockVersion=2.1-groovy-3.0
springBootVersion=2.7.18
springLoadedVersion=1.2.8.RELEASE
springVersion=5.3.39
spring.version=5.3.39
testingSupportVersion=3.2.1
testingSupportVersionForTests=3.2.2
tomcatLog4jVersion=8.5.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,10 @@ class GrailsApplicationPostProcessor implements BeanDefinitionRegistryPostProces

GrailsApplicationPostProcessor(GrailsApplicationLifeCycle lifeCycle, ApplicationContext applicationContext, Class...classes) {
this.lifeCycle = lifeCycle
if(lifeCycle instanceof GrailsApplicationClass) {
this.applicationClass = (GrailsApplicationClass)lifeCycle
}
else {
this.applicationClass = null
}
this.classes = classes != null ? classes : [] as Class[]
grailsApplication = applicationClass != null ? new DefaultGrailsApplication(applicationClass) : new DefaultGrailsApplication()
pluginManager = new DefaultGrailsPluginManager(grailsApplication)
this.applicationClass = lifeCycle instanceof GrailsApplicationClass ? (GrailsApplicationClass) lifeCycle : null
this.classes = classes ?: [] as Class[]
this.grailsApplication = applicationClass ? new DefaultGrailsApplication(applicationClass) : new DefaultGrailsApplication()
this.pluginManager = applicationContext?.getBeanNamesForType(GrailsPluginManager) ? applicationContext.getBean(GrailsPluginManager) : new DefaultGrailsPluginManager(grailsApplication)
if(applicationContext != null) {
setApplicationContext(applicationContext)
}
Expand Down Expand Up @@ -290,30 +285,22 @@ class GrailsApplicationPostProcessor implements BeanDefinitionRegistryPostProces
}
}

@SuppressWarnings("GrMethodMayBeStatic")
private void loadPluginConfigurationsToMicronautContext(ConfigurableApplicationContext applicationContext) {
String[] beanNames = applicationContext.getBeanNamesForType(GrailsPluginManager)
if (beanNames.length == 0) {
// do not continue if PluginManager is not available
ConfigurableApplicationContext parentApplicationContext = (ConfigurableApplicationContext) applicationContext.parent
if (!parentApplicationContext) {
// No Micronaut parent context, return early
return
}

GrailsPluginManager pluginManager = applicationContext.getBean(GrailsPluginManager)
ConfigurableApplicationContext parentApplicationContext = (ConfigurableApplicationContext) applicationContext.parent
ConfigurableEnvironment parentContextEnv = parentApplicationContext.getEnvironment()
if (parentContextEnv instanceof MicronautEnvironment) {
if (log.isDebugEnabled()) {
log.debug("Loading configurations from the plugins to the parent Micronaut context")
}
log.debug('Loading configurations from the plugins to the parent Micronaut context')
final io.micronaut.context.env.Environment micronautEnv = ((io.micronaut.context.env.Environment) parentContextEnv.getEnvironment())
final GrailsPlugin[] plugins = pluginManager.allPlugins
Integer priority = AbstractPropertySourceLoader.DEFAULT_POSITION
Arrays.stream(plugins)
.filter({ GrailsPlugin plugin -> plugin.propertySource != null })
.forEach({ GrailsPlugin plugin ->
if (log.isDebugEnabled()) {
log.debug("Loading configurations from {} plugin to the parent Micronaut context", plugin.name)
}
log.debug('Loading configurations from {} plugin to the parent Micronaut context', plugin.name)
micronautEnv.addPropertySource(PropertySource.of("grails.plugins.$plugin.name", (Map) plugin.propertySource.source, --priority))
})
micronautEnv.refresh()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package org.grails.plugins

import grails.boot.config.GrailsAutoConfiguration
import grails.core.DefaultGrailsApplication
import grails.core.GrailsApplication
import grails.plugins.GrailsPlugin
import grails.plugins.GrailsPluginManager
import groovy.transform.CompileStatic
import org.grails.plugins.DefaultGrailsPlugin
import org.grails.plugins.MockGrailsPluginManager
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.core.io.FileSystemResource
Expand All @@ -24,17 +21,17 @@ class GrailsPluginConfigurationClass extends GrailsAutoConfiguration {

@Bean(name = "grailsPluginManager")
GrailsPluginManager getGrailsPluginManager() {
String tempDir = System.getProperty("java.io.tmpdir")
GrailsApplication grailsApplication = new DefaultGrailsApplication()
final MockGrailsPluginManager pluginManager = new MockGrailsPluginManager(grailsApplication)
final List<DefaultGrailsPlugin> plugins = createGrailsPlugins(grailsApplication)
plugins.forEach({ plugin -> pluginManager.registerMockPlugin((GrailsPlugin) plugin)})
return pluginManager
MockGrailsPluginManager pluginManager = new MockGrailsPluginManager()
createGrailsPlugins(pluginManager.application).each {
pluginManager.registerMockPlugin(it)
}
pluginManager
}

private List<DefaultGrailsPlugin> createGrailsPlugins(DefaultGrailsApplication grailsApplication) {
private List<GrailsPlugin> createGrailsPlugins(GrailsApplication grailsApplication) {
final String grailsVersion = '4.0.1'
def gcl = new GroovyClassLoader()

GrailsPlugin plugin = new MockTestGrailsPlugin(gcl.parseClass("""class TestGrailsPlugin {
def version = '1.0.0'
def grailsVersion = '$grailsVersion'
Expand All @@ -45,7 +42,8 @@ class GrailsPluginConfigurationClass extends GrailsAutoConfiguration {
def version = '1.0.0'
def grailsVersion = '$grailsVersion'
}"""), grailsApplication)
[plugin, plugin2]

List<GrailsPlugin>.of(plugin, plugin2)
}

class MockTestGrailsPlugin extends DefaultGrailsPlugin {
Expand Down Expand Up @@ -82,10 +80,6 @@ class GrailsPluginConfigurationClass extends GrailsAutoConfiguration {

class MockTestTwoGrailsPlugin extends DefaultGrailsPlugin {

MockTestTwoGrailsPlugin(Class<?> pluginClass, Resource resource, GrailsApplication application) {
super(pluginClass, resource, application)
}

MockTestTwoGrailsPlugin(Class<?> pluginClass, GrailsApplication application) {
super(pluginClass, application)
}
Expand Down
Loading
Loading