From e61ee3c10c0e58a273d41124db75f55924e8f106 Mon Sep 17 00:00:00 2001 From: puneetbehl Date: Thu, 10 Nov 2022 11:57:45 +0000 Subject: [PATCH 1/7] Back to 5.2.5-SNAPSHOT --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 5e0647d7..211727a9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=5.2.4 +projectVersion=5.2.5-SNAPSHOT grailsVersion=5.2.5 springBootVersion=2.7.5 groovyVersion=3.0.11 From e47123e526a592378b097d19830ca002f27d4fe8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 8 Jan 2023 19:49:11 +0530 Subject: [PATCH 2/7] Update plugin com.gradle.enterprise to v3.12.2 (#159) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- setting.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setting.gradle b/setting.gradle index b1a33924..8a30a0c9 100644 --- a/setting.gradle +++ b/setting.gradle @@ -1,5 +1,5 @@ plugins { - id "com.gradle.enterprise" version "3.11.4" + id "com.gradle.enterprise" version "3.12.2" id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.8.2' } From 6b1948beace0983637e402ead92b9ede86d743ff Mon Sep 17 00:00:00 2001 From: Puneet Behl Date: Wed, 8 Feb 2023 12:08:48 +0530 Subject: [PATCH 3/7] Use property getter for compatibility with Java classes (#164) Fixes grails/grails-core#12860 --- .../gradle/plugin/core/GrailsGradlePlugin.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy b/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy index 9d88bda2..1bf424b7 100644 --- a/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy +++ b/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy @@ -210,7 +210,7 @@ class GrailsGradlePlugin extends GroovyPlugin { Task buildPropertiesTask = project.tasks.create("buildProperties") - Map buildPropertiesContents = ['grails.env': Environment.isSystemSet() ? Environment.current.name : Environment.PRODUCTION.name, + Map buildPropertiesContents = ['grails.env': Environment.isSystemSet() ? Environment.getCurrent().getName() : Environment.PRODUCTION.getName(), 'info.app.name': project.name, 'info.app.version': project.version instanceof Serializable ? project.version : project.version.toString(), 'info.app.grailsVersion': project.properties.get('grailsVersion')] @@ -431,8 +431,8 @@ class GrailsGradlePlugin extends GroovyPlugin { TaskContainer tasks = project.tasks String grailsEnvSystemProperty = System.getProperty(Environment.KEY) - tasks.withType(Test).each systemPropertyConfigurer.curry(grailsEnvSystemProperty ?: Environment.TEST.name) - tasks.withType(JavaExec).each systemPropertyConfigurer.curry(grailsEnvSystemProperty ?: Environment.DEVELOPMENT.name) + tasks.withType(Test).each systemPropertyConfigurer.curry(grailsEnvSystemProperty ?: Environment.TEST.getName()) + tasks.withType(JavaExec).each systemPropertyConfigurer.curry(grailsEnvSystemProperty ?: Environment.DEVELOPMENT.getName()) } protected void configureConsoleTask(Project project) { @@ -606,7 +606,7 @@ class GrailsGradlePlugin extends GroovyPlugin { if (project.tasks.findByName("runScript") == null) { project.tasks.create("runScript", ApplicationContextScriptTask) { classpath = project.sourceSets.main.runtimeClasspath + project.configurations.console - systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.name) + systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName()) if (project.hasProperty('args')) { args(CommandLineParser.translateCommandline(project.args)) } @@ -619,7 +619,7 @@ class GrailsGradlePlugin extends GroovyPlugin { if (project.tasks.findByName("runCommand") == null) { project.tasks.create("runCommand", ApplicationContextCommandTask) { classpath = project.sourceSets.main.runtimeClasspath + project.configurations.console - systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.name) + systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName()) if (project.hasProperty('args')) { args(CommandLineParser.translateCommandline(project.args)) } From 2a8b0f015b6fa08250791245e5ed3149452d2c26 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 8 Feb 2023 12:09:33 +0530 Subject: [PATCH 4/7] Update plugin com.gradle.enterprise to v3.12.3 (#162) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- setting.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setting.gradle b/setting.gradle index 8a30a0c9..e815eae3 100644 --- a/setting.gradle +++ b/setting.gradle @@ -1,5 +1,5 @@ plugins { - id "com.gradle.enterprise" version "3.12.2" + id "com.gradle.enterprise" version "3.12.3" id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.8.2' } From fb4decc311b613490a9550694883b584d4d31ac6 Mon Sep 17 00:00:00 2001 From: Puneet Behl Date: Wed, 8 Feb 2023 18:48:54 +0530 Subject: [PATCH 5/7] Reformat Code --- .../profiles/GrailsProfileGradlePlugin.groovy | 2 +- .../profiles/tasks/ProfileCompilerTask.groovy | 37 +++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/main/groovy/org/grails/gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy b/src/main/groovy/org/grails/gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy index 1405d1b7..067b78ce 100644 --- a/src/main/groovy/org/grails/gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy +++ b/src/main/groovy/org/grails/gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy @@ -108,7 +108,7 @@ class GrailsProfileGradlePlugin implements Plugin { }) def classsesDir = new File(project.buildDir, "classes/profile") - def compileTask = project.tasks.create("compileProfile", ProfileCompilerTask, (Action){ ProfileCompilerTask task -> + def compileTask = project.tasks.create("compileProfile", ProfileCompilerTask, (Action) { ProfileCompilerTask task -> task.destinationDir = classsesDir task.source = commandsDir task.config = profileYml diff --git a/src/main/groovy/org/grails/gradle/plugin/profiles/tasks/ProfileCompilerTask.groovy b/src/main/groovy/org/grails/gradle/plugin/profiles/tasks/ProfileCompilerTask.groovy index 29344795..17ec9fdb 100644 --- a/src/main/groovy/org/grails/gradle/plugin/profiles/tasks/ProfileCompilerTask.groovy +++ b/src/main/groovy/org/grails/gradle/plugin/profiles/tasks/ProfileCompilerTask.groovy @@ -93,12 +93,11 @@ class ProfileCompilerTask extends AbstractCompile { options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK) def yaml = new Yaml(new SafeConstructor(), new Representer(), options) Map profileData - if(profileYmlExists) { + if (profileYmlExists) { profileData = (Map) config.withReader { BufferedReader r -> yaml.load(r) } - } - else { + } else { profileData = new LinkedHashMap() } @@ -107,7 +106,7 @@ class ProfileCompilerTask extends AbstractCompile { profileFile.parentFile.mkdirs() - if(!profileData.containsKey("extends")) { + if (!profileData.containsKey("extends")) { List dependencies = [] project.configurations.getByName(GrailsProfileGradlePlugin.RUNTIME_CONFIGURATION).allDependencies.all() { Dependency d -> dependencies.add("${d.group}:${d.name}:${d.version}".toString()) @@ -123,33 +122,33 @@ class ProfileCompilerTask extends AbstractCompile { } as File[] Map commandNames = [:] - for(File f in groovySourceFiles) { + for (File f in groovySourceFiles) { def fn = f.name commandNames.put(fn - '.groovy', fn) } - for(File f in ymlSourceFiles) { + for (File f in ymlSourceFiles) { def fn = f.name commandNames.put(fn - '.yml', fn) } - if(commandNames) { + if (commandNames) { profileData.put(PROFILE_COMMANDS, commandNames) } - if( profileYmlExists ) { + if (profileYmlExists) { def parentDir = config.parentFile.canonicalFile def featureDirs = new File(parentDir, "features").listFiles({ File f -> f.isDirectory() && !f.name.startsWith('.') } as FileFilter) - if(featureDirs) { - Map map = (Map)profileData.get("features") - if(map == null) { + if (featureDirs) { + Map map = (Map) profileData.get("features") + if (map == null) { map = [:] profileData.put("features", map) } List featureNames = [] - for(f in featureDirs) { + for (f in featureDirs) { featureNames.add f.name } - if(featureNames) { + if (featureNames) { map.put("provided", featureNames) } profileData.put("features", map) @@ -158,15 +157,15 @@ class ProfileCompilerTask extends AbstractCompile { List templates = [] - if(templatesDir?.exists()) { + if (templatesDir?.exists()) { project.fileTree(templatesDir).visit { FileVisitDetails f -> - if(!f.isDirectory() && !f.name.startsWith('.')) { + if (!f.isDirectory() && !f.name.startsWith('.')) { templates.add f.relativePath.pathString } } } - if(templates) { + if (templates) { profileData.put("templates", templates) } @@ -174,7 +173,7 @@ class ProfileCompilerTask extends AbstractCompile { yaml.dump(profileData, w) } - if(groovySourceFiles) { + if (groovySourceFiles) { CompilerConfiguration configuration = new CompilerConfiguration() configuration.setScriptBaseClass(GroovyScriptCommand.name) @@ -185,9 +184,9 @@ class ProfileCompilerTask extends AbstractCompile { importCustomizer.addStarImports("org.grails.cli.interactive.completers") importCustomizer.addStarImports("grails.util") importCustomizer.addStarImports("grails.codegen.model") - configuration.addCompilationCustomizers(importCustomizer,new ASTTransformationCustomizer(new GroovyScriptCommandTransform())) + configuration.addCompilationCustomizers(importCustomizer, new ASTTransformationCustomizer(new GroovyScriptCommandTransform())) - for(source in groovySourceFiles) { + for (source in groovySourceFiles) { CompilationUnit compilationUnit = new CompilationUnit(configuration) configuration.compilationCustomizers.clear() From b00b857ca492d3aaeb3f2a262c877823a18a1fea Mon Sep 17 00:00:00 2001 From: Puneet Behl Date: Wed, 8 Feb 2023 18:52:31 +0530 Subject: [PATCH 6/7] Update GrailsWebGradlePlugin.groovy Use property getter for compatibility with Java classes --- .../org/grails/gradle/plugin/web/GrailsWebGradlePlugin.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/org/grails/gradle/plugin/web/GrailsWebGradlePlugin.groovy b/src/main/groovy/org/grails/gradle/plugin/web/GrailsWebGradlePlugin.groovy index 2db60413..d76c4062 100644 --- a/src/main/groovy/org/grails/gradle/plugin/web/GrailsWebGradlePlugin.groovy +++ b/src/main/groovy/org/grails/gradle/plugin/web/GrailsWebGradlePlugin.groovy @@ -50,7 +50,7 @@ class GrailsWebGradlePlugin extends GrailsGradlePlugin { FileCollection fileCollection = buildClasspath(project, project.configurations.runtimeClasspath, project.configurations.console) taskContainer.create("urlMappingsReport", ApplicationContextCommandTask) { classpath = fileCollection - systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.name) + systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName()) command = 'url-mappings-report' } } From 631b133965d7f4cb434f01db02aaed63f6d20bca Mon Sep 17 00:00:00 2001 From: puneetbehl Date: Thu, 9 Feb 2023 08:51:53 +0000 Subject: [PATCH 7/7] [skip ci] Release v5.2.5 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 211727a9..21179c06 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=5.2.5-SNAPSHOT +projectVersion=5.2.5 grailsVersion=5.2.5 springBootVersion=2.7.5 groovyVersion=3.0.11