diff --git a/gradle.properties b/gradle.properties index 5e0647d7..21179c06 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=5.2.4 +projectVersion=5.2.5 grailsVersion=5.2.5 springBootVersion=2.7.5 groovyVersion=3.0.11 diff --git a/setting.gradle b/setting.gradle index b1a33924..e815eae3 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.3" id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.8.2' } 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)) } 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() 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' } }