From 8579baec61eea362394bd2738db0c30722296ed4 Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Tue, 15 Oct 2024 00:15:09 -0700 Subject: [PATCH] 7.0 start --- .sdkmanrc | 2 +- README.md | 1 + app/build.gradle | 7 +++---- app/buildSrc/build.gradle | 6 +++--- app/gradle.properties | 6 +++--- buildSrc/build.gradle | 6 +++--- plugin/build.gradle | 9 +++++---- plugin/buildSrc/build.gradle | 6 +++--- plugin/gradle.properties | 6 +++--- .../console/WebConsoleGrailsPlugin.groovy | 3 ++- .../console/ConsoleControllerSpec.groovy | 19 +++++++++++-------- .../plugins/console/ConsoleServiceSpec.groovy | 2 ++ settings.gradle | 6 +++--- 13 files changed, 43 insertions(+), 36 deletions(-) diff --git a/.sdkmanrc b/.sdkmanrc index e2a1d58..215786f 100644 --- a/.sdkmanrc +++ b/.sdkmanrc @@ -1 +1 @@ -java=11.0.24-librca +java=17.0.12-librca diff --git a/README.md b/README.md index 23f798f..2cfbcca 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ A web-based Groovy console for interactive runtime application management and de - `4.X.X` for Grails 4+ - `5.X.X` for Grails 5+ - `6.X.X` for Grails 6+ +- `7.X.X` for Grails 7+ ## Installation diff --git a/app/build.gradle b/app/build.gradle index 9267059..3923125 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,9 +47,8 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-logging") implementation("org.springframework.boot:spring-boot-starter-tomcat") implementation("org.springframework.boot:spring-boot-starter-validation") - compileOnly("io.micronaut:micronaut-inject-groovy") console("org.grails:grails-console") - runtimeOnly("com.bertramlabs.plugins:asset-pipeline-grails:4.3.0") + runtimeOnly("com.bertramlabs.plugins:asset-pipeline-grails:5.0.1") runtimeOnly("com.h2database:h2") runtimeOnly("org.apache.tomcat:tomcat-jdbc") runtimeOnly("org.fusesource.jansi:jansi:1.18") @@ -75,7 +74,7 @@ application { } java { - sourceCompatibility = JavaVersion.toVersion("11") + sourceCompatibility = JavaVersion.toVersion("17") } tasks.withType(Test) { @@ -93,4 +92,4 @@ webdriverBinaries { assets { minifyJs = true minifyCss = true -} +} \ No newline at end of file diff --git a/app/buildSrc/build.gradle b/app/buildSrc/build.gradle index 4b68763..2528835 100644 --- a/app/buildSrc/build.gradle +++ b/app/buildSrc/build.gradle @@ -5,7 +5,7 @@ repositories { maven { url "https://repo.grails.org/grails/core" } } dependencies { - implementation("com.bertramlabs.plugins:asset-pipeline-gradle:4.3.0") - implementation("org.grails:grails-gradle-plugin:6.1.2") - implementation("org.grails.plugins:hibernate5:8.1.0") + implementation("com.bertramlabs.plugins:asset-pipeline-gradle:5.0.1") + implementation("org.grails:grails-gradle-plugin:7.0.0-SNAPSHOT") + implementation("org.grails.plugins:hibernate5:9.0.0-SNAPSHOT") } diff --git a/app/gradle.properties b/app/gradle.properties index 680ac62..9443be9 100644 --- a/app/gradle.properties +++ b/app/gradle.properties @@ -1,6 +1,6 @@ -grailsVersion=6.2.0 -grailsGradlePluginVersion=6.1.2 -version=6.0 +grailsVersion=7.0.0-SNAPSHOT +grailsGradlePluginVersion=7.0.0-SNAPSHOT +version=7.0.0-SNAPSHOT org.gradle.caching=true org.gradle.daemon=true org.gradle.parallel=true diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 1b7f0f0..c4c3778 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -6,8 +6,8 @@ repositories { } dependencies { - implementation("org.grails:grails-gradle-plugin:6.1.2") - implementation("org.grails.plugins:hibernate5:8.1.0") - implementation("com.bertramlabs.plugins:asset-pipeline-gradle:4.3.0") + implementation("org.grails:grails-gradle-plugin:7.0.0-SNAPSHOT") + implementation("org.grails.plugins:hibernate5:9.0.0-SNAPSHOT") + implementation("com.bertramlabs.plugins:asset-pipeline-gradle:5.0.1") implementation("com.gorylenko.gradle-git-properties:gradle-git-properties:2.4.2") } \ No newline at end of file diff --git a/plugin/build.gradle b/plugin/build.gradle index ecfae37..159016c 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -38,19 +38,17 @@ dependencies { implementation("org.springframework.boot:spring-boot-autoconfigure") implementation("org.springframework.boot:spring-boot-starter-logging") implementation("org.springframework.boot:spring-boot-starter-validation") - compileOnly("io.micronaut:micronaut-inject-groovy") console("org.grails:grails-console") runtimeOnly("com.h2database:h2") runtimeOnly("org.apache.tomcat:tomcat-jdbc") - testImplementation("io.micronaut:micronaut-inject-groovy") testImplementation("org.grails:grails-gorm-testing-support") testImplementation("org.grails:grails-web-testing-support") testImplementation("org.spockframework:spock-core") - testImplementation("io.micronaut:micronaut-http-client") implementation("org.grails.plugins:scaffolding") implementation 'commons-io:commons-io:2.16.1' + runtimeOnly("org.fusesource.jansi:jansi") } application { @@ -58,7 +56,7 @@ application { } java { - sourceCompatibility = JavaVersion.toVersion(11) + sourceCompatibility = JavaVersion.toVersion(17) } bootRun { @@ -96,6 +94,7 @@ generateGitProperties.outputs.upToDateWhen { } // make sure the generateGitProperties task always executes (even when git.properties is not changed) jar { + dependsOn repairPublicFiles dependsOn generateGitProperties manifest { attributes("Built-By": System.getProperty("user.name")) @@ -109,6 +108,8 @@ jar { exclude 'git.properties' } +compileTestGroovy.dependsOn(repairPublicFiles) + task sourceJar(type: Jar) { classifier = 'sources' diff --git a/plugin/buildSrc/build.gradle b/plugin/buildSrc/build.gradle index e56144e..0ba8e34 100644 --- a/plugin/buildSrc/build.gradle +++ b/plugin/buildSrc/build.gradle @@ -6,8 +6,8 @@ repositories { } dependencies { - implementation("org.grails:grails-gradle-plugin:6.1.2") - implementation("org.grails.plugins:hibernate5:8.1.0") - implementation("com.bertramlabs.plugins:asset-pipeline-gradle:4.3.0") + implementation("org.grails:grails-gradle-plugin:7.0.0-SNAPSHOT") + implementation("org.grails.plugins:hibernate5:9.0.0-SNAPSHOT") + implementation("com.bertramlabs.plugins:asset-pipeline-gradle:5.0.1") implementation("com.gorylenko.gradle-git-properties:gradle-git-properties:2.4.2") } diff --git a/plugin/gradle.properties b/plugin/gradle.properties index 1f60f3d..9443be9 100644 --- a/plugin/gradle.properties +++ b/plugin/gradle.properties @@ -1,6 +1,6 @@ -grailsVersion=6.2.0 -grailsGradlePluginVersion=6.1.2 -version=6.0.0-SNAPSHOT +grailsVersion=7.0.0-SNAPSHOT +grailsGradlePluginVersion=7.0.0-SNAPSHOT +version=7.0.0-SNAPSHOT org.gradle.caching=true org.gradle.daemon=true org.gradle.parallel=true diff --git a/plugin/src/main/groovy/org/grails/plugins/console/WebConsoleGrailsPlugin.groovy b/plugin/src/main/groovy/org/grails/plugins/console/WebConsoleGrailsPlugin.groovy index a3fdf91..c5867ab 100644 --- a/plugin/src/main/groovy/org/grails/plugins/console/WebConsoleGrailsPlugin.groovy +++ b/plugin/src/main/groovy/org/grails/plugins/console/WebConsoleGrailsPlugin.groovy @@ -44,7 +44,8 @@ class WebConsoleGrailsPlugin extends Plugin { } void doWithApplicationContext() { - config.grails.assets.plugin.'console'.excludes = ['**/*'] + // TODO set property +// config.grails.assets.plugin.'console'.excludes = ['**/*'] ConsoleUtil.initJsonConfig() } diff --git a/plugin/src/test/groovy/org/grails/plugins/console/ConsoleControllerSpec.groovy b/plugin/src/test/groovy/org/grails/plugins/console/ConsoleControllerSpec.groovy index 7f77b89..732c6a2 100644 --- a/plugin/src/test/groovy/org/grails/plugins/console/ConsoleControllerSpec.groovy +++ b/plugin/src/test/groovy/org/grails/plugins/console/ConsoleControllerSpec.groovy @@ -14,8 +14,9 @@ class ConsoleControllerSpec extends Specification implements ControllerUnitTest< @Override Closure doWithConfig() {{ config -> - config.grails.plugin.console.fileStore.remote.enabled = true - config.grails.plugin.console.csrfProtection.enabled = true + // TODO: fix dot notation +// config.grails.plugin.console.fileStore.remote.enabled = true +// config.grails.plugin.console.csrfProtection.enabled = true }} void setup() { @@ -50,10 +51,11 @@ class ConsoleControllerSpec extends Specification implements ControllerUnitTest< model.json.baseUrl == 'http://localhost:8080/console' } + // TODO: fix dot notation void 'index - baseUrl with config'() { when: - config.grails.plugin.console.baseUrl = 'http://localhost:5050/x/y/z/console' - controller.consoleConfig = new ConsoleConfig(config.grails.plugin.console) + config['grails.plugin.console'] = [baseUrl:'http://localhost:5050/x/y/z/console'] + controller.consoleConfig = new ConsoleConfig(config['grails.plugin.console']) controller.index() then: @@ -147,11 +149,12 @@ class ConsoleControllerSpec extends Specification implements ControllerUnitTest< response.json.error.contains 'Directory not found' } + // TODO: fix dot notation void 'listFiles - remote file store disabled'() { given: String path = tempDir.absolutePath - config.grails.plugin.console.fileStore.remote.enabled = false - controller.consoleConfig = new ConsoleConfig(config.grails.plugin.console) + config['grails.plugin.console'] = [fileStore:[remote:[enabled: false]]] + controller.consoleConfig = new ConsoleConfig(config['grails.plugin.console']) when: controller.listFiles(path) @@ -188,8 +191,8 @@ class ConsoleControllerSpec extends Specification implements ControllerUnitTest< request.method = 'GET' params.path = testFile1.absolutePath - config.grails.plugin.console.fileStore.remote.enabled = false - controller.consoleConfig = new ConsoleConfig(config.grails.plugin.console) + config['grails.plugin.console'] = [fileStore:[remote:[enabled: false]]] + controller.consoleConfig = new ConsoleConfig(config['grails.plugin.console']) when: controller.file() diff --git a/plugin/src/test/groovy/org/grails/plugins/console/ConsoleServiceSpec.groovy b/plugin/src/test/groovy/org/grails/plugins/console/ConsoleServiceSpec.groovy index d342211..c185994 100644 --- a/plugin/src/test/groovy/org/grails/plugins/console/ConsoleServiceSpec.groovy +++ b/plugin/src/test/groovy/org/grails/plugins/console/ConsoleServiceSpec.groovy @@ -2,6 +2,7 @@ package org.grails.plugins.console import grails.testing.services.ServiceUnitTest import org.springframework.mock.web.MockHttpServletRequest +import spock.lang.Ignore import spock.lang.Specification class ConsoleServiceSpec extends Specification implements ServiceUnitTest { @@ -22,6 +23,7 @@ class ConsoleServiceSpec extends Specification implements ServiceUnitTest