From 710fff4a70bd89312e2c9a0354b2b57c530f6cd5 Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Fri, 15 Nov 2024 11:37:22 -0800 Subject: [PATCH 01/17] Fix version warning --- .../org/grails/plugins/console/WebConsoleGrailsPlugin.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 559d76b..b1eaca8 100644 --- a/plugin/src/main/groovy/org/grails/plugins/console/WebConsoleGrailsPlugin.groovy +++ b/plugin/src/main/groovy/org/grails/plugins/console/WebConsoleGrailsPlugin.groovy @@ -5,7 +5,7 @@ import grails.plugins.* class WebConsoleGrailsPlugin extends Plugin { // the version or versions of Grails the plugin is designed for - def grailsVersion = "7.0.0 > *" + def grailsVersion = "7.0.0-SNAPSHOT > *" // resources that are excluded from plugin packaging def pluginExcludes = [ From 9f61b78e5c6cb480d2c1bc49d709d8ec7a2e0110 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Mon, 9 Dec 2024 15:40:00 -0500 Subject: [PATCH 02/17] Updating Build --- .github/workflows/gradle.yml | 55 +++++---- .github/workflows/release.yml | 112 ++++++++++++++++++ README.md | 6 +- app/build.gradle | 42 +------ build.gradle | 16 +++ buildSrc/build.gradle | 12 -- app/gradle.properties => gradle.properties | 4 + plugin/build.gradle | 47 +++++--- plugin/gradle.properties | 7 -- plugin/release.sh | 13 -- plugin/settings.gradle | 10 -- .../console/WebConsoleGrailsPlugin.groovy | 6 +- settings.gradle | 14 ++- 13 files changed, 212 insertions(+), 132 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 build.gradle delete mode 100644 buildSrc/build.gradle rename app/gradle.properties => gradle.properties (72%) delete mode 100644 plugin/gradle.properties delete mode 100755 plugin/release.sh delete mode 100644 plugin/settings.gradle diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0fd3ab9..c126657 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -15,46 +15,53 @@ jobs: GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8 SIGNING_KEYRING: ${{ secrets.SECRING_FILE }} steps: - - uses: actions/checkout@v4 - - name: Setup up node + - name: "πŸ“₯ Checkout the repository" + uses: actions/checkout@v4 + - name: "🧱 Setup up node" uses: actions/setup-node@v3 with: node-version: '20.5.1' - - run: npm install - - run: npx gulp grailsRelease - - name: Set up JDK + - name: "Pull node dependencies" + run: npm install + - name: "Package node dependencies" + run: npx gulp grailsRelease + - name: "β˜•οΈ Setup JDK" uses: actions/setup-java@v4 with: distribution: 'liberica' java-version: '17' - - name: Setup Gradle - uses: gradle/gradle-build-action@v3 - - name: Run build with Gradle Wrapper - run: ./gradlew build -Dgeb.env=chromeHeadless - working-directory: plugin + - name: "🐘 Setup Gradle" + uses: gradle/actions/setup-gradle@v4 + - name: "πŸ”¨ Run Base Tests" + run: ./gradlew check --continue publish: if: github.event_name == 'push' - needs: ['build'] + needs: build runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@v4 - - name: Setup up node + - name: "πŸ“₯ Checkout the repository" + uses: actions/checkout@v4 + - name: "🧱 Setup up node" uses: actions/setup-node@v3 with: node-version: '20.5.1' - - run: npm install - - run: npx gulp grailsRelease - - name: Set up JDK + - name: "Pull node dependencies" + run: npm install + - name: "Package node dependencies" + run: npx gulp grailsRelease + - name: "β˜•οΈ Setup JDK" uses: actions/setup-java@v4 with: distribution: 'liberica' java-version: '17' - - name: Setup Gradle - uses: gradle/gradle-build-action@v3 - - name: Publish Artifacts (repo.grails.org) - id: publish + - name: "🐘 Setup Gradle" + uses: gradle/actions/setup-gradle@v4 + - name: "πŸ“€ Publish to Snapshot (repo.grails.org)" env: - ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} - ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} - working-directory: plugin - run: ./gradlew -Dorg.gradle.internal.publish.checksums.insecure=true publish \ No newline at end of file + MAVEN_PUBLISH_USERNAME: ${{ secrets.MAVEN_PUBLISH_USERNAME }} + MAVEN_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PUBLISH_PASSWORD }} + MAVEN_PUBLISH_URL: ${{ secrets.MAVEN_PUBLISH_SNAPSHOT_URL }} + working-directory: ./plugin + run: ../gradlew publish diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..14495f1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,112 @@ +name: Release +on: + release: + types: [published] +env: + GIT_USER_NAME: 'grails-build' + GIT_USER_EMAIL: 'grails-build@users.noreply.github.com' +jobs: + publish: + permissions: + contents: write # to create release + issues: write # to modify milestones + runs-on: ubuntu-latest + outputs: + release_version: ${{ steps.release_version.outputs.value }} + target_branch: ${{ steps.extract_branch.outputs.value }} + steps: + - name: "πŸ“₯ Checkout the repository" + uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_TOKEN }} + - name: "🧱 Setup up node" + uses: actions/setup-node@v3 + with: + node-version: '20.5.1' + - name: "Pull node dependencies" + run: npm install + - name: "Package node dependencies" + run: npx gulp grailsRelease + - name: "β˜•οΈ Setup JDK" + uses: actions/setup-java@v4 + with: + distribution: 'liberica' + java-version: '17' + - name: "🐘 Setup Gradle" + uses: gradle/actions/setup-gradle@v4 + - name: "πŸ“ Store the target branch" + id: extract_branch + run: | + echo "Determining Target Branch" + TARGET_BRANCH=${GITHUB_REF#refs/heads/} + echo $TARGET_BRANCH + echo "value=${TARGET_BRANCH}" >> $GITHUB_OUTPUT + - name: "πŸ“Set the current release version" + id: release_version + run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT + - name: "βš™οΈ Run pre-release" + uses: micronaut-projects/github-actions/pre-release@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: "🧩 Run Assemble" + if: success() + id: assemble + run: ./gradlew assemble + - name: "πŸ” Generate secring file" + env: + SECRING_FILE: ${{ secrets.SECRING_FILE }} + run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg + - name: "πŸš€ Publish to Sonatype OSSRH" + id: publish + env: + NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }} + NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }} + NEXUS_PUBLISH_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }} + NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} + SECRING_FILE: ${{ secrets.SECRING_FILE }} + working-directory: ./plugin + run: > + ../gradlew + -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg + publishToSonatype + closeSonatypeStagingRepository + release: + needs: publish + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: "πŸ“₯ Checkout repository" + uses: actions/checkout@v4 + - name: "β˜•οΈ Setup JDK" + uses: actions/setup-java@v4 + with: + distribution: liberica + java-version: 17 + - name: "πŸ“₯ Checkout repository" + uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_TOKEN }} + ref: v${{ needs.publish.outputs.release_version }} + - name: "🐘 Setup Gradle" + uses: gradle/actions/setup-gradle@v4 + - name: "πŸ†Nexus Staging Close And Release" + env: + NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }} + NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }} + NEXUS_PUBLISH_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }} + NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }} + working-directory: ./plugin + run: > + ../gradlew + findSonatypeStagingRepository + releaseSonatypeStagingRepository + - name: "βš™οΈRun post-release" + if: success() + uses: micronaut-projects/github-actions/post-release@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + env: + SNAPSHOT_SUFFIX: -SNAPSHOT diff --git a/README.md b/README.md index 26c0a99..8c80d58 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Java CI](https://github.com/gpc/grails-web-console/actions/workflows/gradle.yml/badge.svg)](https://github.com/gpc/grails-web-console/actions/workflows/gradle.yml) +[![Java CI](https://github.com/grails-plugins/grails-web-console/actions/workflows/gradle.yml/badge.svg)](https://github.com/grails-plugins/grails-web-console/actions/workflows/gradle.yml) # Grails Web Console @@ -27,7 +27,7 @@ repositories { } dependencies { - runtimeOnly 'com.github.gpc:grails-web-console:7.0.0-SNAPSHOT' + runtimeOnly 'com.github.grails-plugins:grails-web-console:7.0.0-SNAPSHOT' } ``` @@ -74,7 +74,7 @@ The following implicit variables are available: * `session` - the current [HTTP session](http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpSession.html) * `out` - the output [PrintStream](http://docs.oracle.com/javase/7/docs/api/java/io/PrintStream.html) -See [Script Examples](https://github.com/gpc/grails-web-console/wiki/Script-Examples) for example usage. +See [Script Examples](https://github.com/grails-plugins/grails-web-console/wiki/Script-Examples) for example usage. ## Keyboard Shortcuts diff --git a/app/build.gradle b/app/build.gradle index 021fd62..a7157e0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,7 +2,6 @@ plugins { id "groovy" id "org.grails.grails-web" id "org.grails.grails-gsp" - id "com.github.erdi.webdriver-binaries" id "war" id "idea" id "com.bertramlabs.asset-pipeline" @@ -12,20 +11,6 @@ plugins { group = "grails.app" -repositories { - maven { url "https://repo.grails.org/grails/core" } -} - -configurations { - all { - resolutionStrategy.eachDependency { DependencyResolveDetails details-> - if (details.requested.group == 'org.seleniumhq.selenium') { - details.useVersion('4.19.1') - } - } - } -} - dependencies { implementation("org.grails:grails-core") implementation("org.grails:grails-logging") @@ -46,22 +31,15 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-tomcat") implementation("org.springframework.boot:spring-boot-starter-validation") console("org.grails:grails-console") - runtimeOnly("com.bertramlabs.plugins:asset-pipeline-grails:5.0.1") + runtimeOnly("com.bertramlabs.plugins:asset-pipeline-grails:${assetPipelineVersion}") runtimeOnly("com.h2database:h2") runtimeOnly("org.apache.tomcat:tomcat-jdbc") runtimeOnly("org.fusesource.jansi:jansi:1.18") - testImplementation("io.micronaut:micronaut-inject-groovy") testImplementation("org.grails:grails-gorm-testing-support") testImplementation("org.grails:grails-web-testing-support") - testImplementation("org.grails.plugins:geb") - testImplementation("org.seleniumhq.selenium:selenium-api:4.19.1") - testImplementation("org.seleniumhq.selenium:selenium-remote-driver:4.19.1") - testImplementation("org.seleniumhq.selenium:selenium-support:4.19.1") + + integrationTestImplementation testFixtures("org.grails.plugins:geb:${gebVersion}") testImplementation("org.spockframework:spock-core") - testRuntimeOnly("org.seleniumhq.selenium:selenium-chrome-driver:4.19.1") - testRuntimeOnly("org.seleniumhq.selenium:selenium-firefox-driver:4.19.1") - testRuntimeOnly("org.seleniumhq.selenium:selenium-safari-driver:4.19.1") - testImplementation("io.micronaut:micronaut-http-client") implementation project(':plugin') @@ -71,22 +49,10 @@ application { mainClass.set("grails.app.Application") } -java { - sourceCompatibility = JavaVersion.toVersion("17") -} - tasks.withType(Test) { useJUnitPlatform() - systemProperty "geb.env", System.getProperty('geb.env') - systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest") - systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver" - systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver" -} -webdriverBinaries { - chromedriver '122.0.6260.0' - geckodriver '0.33.0' - edgedriver '110.0.1587.57' } + assets { minifyJs = true minifyCss = true diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..8b67d93 --- /dev/null +++ b/build.gradle @@ -0,0 +1,16 @@ +allprojects { + repositories { + mavenCentral() + maven { url "https://repo.grails.org/grails/core" } + } +} + +version project.projectVersion + +subprojects { project -> + version project.projectVersion + + apply plugin: "groovy" + + project.compileJava.options.release = 17 +} \ No newline at end of file diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle deleted file mode 100644 index de24bc5..0000000 --- a/buildSrc/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -repositories { - mavenCentral() - maven { url "https://repo1.maven.org/maven2/" } - maven { url "https://repo.grails.org/grails/core" } -} - -dependencies { - 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/app/gradle.properties b/gradle.properties similarity index 72% rename from app/gradle.properties rename to gradle.properties index 9443be9..8a175d6 100644 --- a/app/gradle.properties +++ b/gradle.properties @@ -1,5 +1,9 @@ +projectVersion=7.0.0-SNAPSHOT + grailsVersion=7.0.0-SNAPSHOT grailsGradlePluginVersion=7.0.0-SNAPSHOT +gebVersion=5.0.0-SNAPSHOT +assetPipelineVersion=5.0.1 version=7.0.0-SNAPSHOT org.gradle.caching=true org.gradle.daemon=true diff --git a/plugin/build.gradle b/plugin/build.gradle index 6440622..2672616 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -1,3 +1,14 @@ +buildscript { + repositories { + mavenCentral() + gradlePluginPortal() + maven { url "https://repo.grails.org/grails/core" } + } + dependencies { + classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" + } +} + plugins { id "groovy" id "idea" @@ -7,20 +18,12 @@ plugins { id "application" id "eclipse" id "com.gorylenko.gradle-git-properties" - id "org.grails.internal.grails-plugin-publish" + id "org.grails.grails-publish" + id "com.adarshr.test-logger" version "4.0.0" } group "org.grails.plugins" -repositories { - maven { url "https://repo.grails.org/grails/core" } -} - -configurations { - all { - } -} - dependencies { implementation("org.grails:grails-core") implementation("org.grails:grails-logging") @@ -47,17 +50,13 @@ dependencies { implementation("org.grails.plugins:scaffolding") implementation 'commons-io:commons-io:2.16.1' - runtimeOnly("org.fusesource.jansi:jansi:1.18") + runtimeOnly("org.fusesource.jansi:jansi") } application { mainClass.set("grailsconsole.Application") } -java { - sourceCompatibility = JavaVersion.toVersion(17) -} - bootRun { ignoreExitValue true jvmArgs( @@ -114,13 +113,27 @@ task packageGroovydoc(type: Jar) { tasks.withType(Test) { useJUnitPlatform() + + testLogging { + exceptionFormat = 'full' + events 'passed', 'skipped', 'failed'//, 'standardOut', 'standardError' + } +} + +testlogger { + theme 'mocha' + showFullStackTraces true + showStandardStreams true + showPassedStandardStreams false + showSkippedStandardStreams false + showFailedStandardStreams true } + // enable if you wish to package this plugin as a standalone application bootJar.enabled = false grailsPublish { - userOrg = "grails" - githubSlug = 'gpc/grails-web-console' + githubSlug = 'grails-plugins/grails-web-console' license { name = 'Apache-2.0' } diff --git a/plugin/gradle.properties b/plugin/gradle.properties deleted file mode 100644 index 9443be9..0000000 --- a/plugin/gradle.properties +++ /dev/null @@ -1,7 +0,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 -org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M diff --git a/plugin/release.sh b/plugin/release.sh deleted file mode 100755 index af56d72..0000000 --- a/plugin/release.sh +++ /dev/null @@ -1,13 +0,0 @@ -rm -rf target/release -mkdir -p target/release -cd target/release -git clone git@github.com:gpc/grails-web-console.git - -cd grails-web-console -npm install -gulp grails:release - -cd plugin -./gradlew clean -./gradlew compileGroovy -./gradlew publishMavenJarPublicationToGitHubPackagesRepository diff --git a/plugin/settings.gradle b/plugin/settings.gradle deleted file mode 100644 index c2ab3c0..0000000 --- a/plugin/settings.gradle +++ /dev/null @@ -1,10 +0,0 @@ -pluginManagement { - repositories { - maven { url "https://repo.grails.org/grails/core/" } - gradlePluginPortal() - } - plugins { - } -} - -rootProject.name = 'grails-web-console' 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 b1eaca8..49e9871 100644 --- a/plugin/src/main/groovy/org/grails/plugins/console/WebConsoleGrailsPlugin.groovy +++ b/plugin/src/main/groovy/org/grails/plugins/console/WebConsoleGrailsPlugin.groovy @@ -20,7 +20,7 @@ class WebConsoleGrailsPlugin extends Plugin { def profiles = ['web'] // URL to the plugin's documentation - String documentation = 'https://github.com/gpc/grails-web-console/blob/6.0.x/README.md' + String documentation = 'https://github.com/grails-plugins/grails-web-console/blob/6.0.x/README.md' String license = 'APACHE' def developers = [ @@ -30,8 +30,8 @@ class WebConsoleGrailsPlugin extends Plugin { [name: 'Matt Sheehan', email: 'mr.sheehan@gmail.com'], [name: 'Sachin Verma', email: 'v.sachin.v@gmail.com'] ] - def issueManagement = [system: 'github', url: 'https://github.com/gpc/grails-web-console/issues'] - def scm = [url: 'https://github.com/gpc/grails-web-console'] + def issueManagement = [system: 'github', url: 'https://github.com/grails-plugins/grails-web-console/issues'] + def scm = [url: 'https://github.com/grails-plugins/grails-web-console'] Closure doWithSpring() { diff --git a/settings.gradle b/settings.gradle index 52f32b3..19f832c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,11 +4,15 @@ pluginManagement { gradlePluginPortal() } plugins { - id "org.grails.grails-web" version "7.0.0-SNAPSHOT" - id "org.grails.grails-gsp" version "7.0.0-SNAPSHOT" - id "com.bertramlabs.asset-pipeline" version "5.0.1" - id "com.github.erdi.webdriver-binaries" version "3.2" + id "org.grails.grails-web" version "${grailsVersion}" + id "org.grails.grails-gsp" version "${grailsVersion}" + id "org.grails.grails-plugin" version "${grailsVersion}" + id "org.grails.grails-publish" version "${grailsVersion}" + id "com.bertramlabs.asset-pipeline" version "${assetPipelineVersion}" + id "com.gorylenko.gradle-git-properties" version "2.4.2" } } -include 'app', 'plugin' +rootProject.name = 'grails-web-console-root' +include 'plugin' +include 'app' \ No newline at end of file From 1e443a82460b8b546f38b8d5825f37842662727f Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Mon, 23 Dec 2024 21:45:39 -0500 Subject: [PATCH 03/17] Update for Grails 7.0.0-M1 --- .github/workflows/release.yml | 14 ++++------ LOCALDEPLOYMENT.md | 6 ++-- README.md | 2 +- app/build.gradle | 34 +++++++++++++++-------- app/buildSrc/build.gradle | 10 ------- app/grails-app/conf/logback-spring.xml | 34 +++++++++++++++++++++++ app/grails-app/conf/logback.xml | 19 ------------- build.gradle | 26 +++++++++++++++++ gradle.properties | 8 +++--- plugin/build.gradle | 28 ++++++++----------- plugin/buildSrc/build.gradle | 12 -------- plugin/grails-app/conf/logback-spring.xml | 34 +++++++++++++++++++++++ plugin/grails-app/conf/logback.xml | 19 ------------- settings.gradle | 11 +++++--- 14 files changed, 148 insertions(+), 109 deletions(-) delete mode 100644 app/buildSrc/build.gradle create mode 100644 app/grails-app/conf/logback-spring.xml delete mode 100644 app/grails-app/conf/logback.xml delete mode 100644 plugin/buildSrc/build.gradle create mode 100644 plugin/grails-app/conf/logback-spring.xml delete mode 100644 plugin/grails-app/conf/logback.xml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14495f1..af18b3e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,13 +45,13 @@ jobs: id: release_version run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT - name: "βš™οΈ Run pre-release" - uses: micronaut-projects/github-actions/pre-release@master + uses: grails/github-actions/pre-release@main with: token: ${{ secrets.GITHUB_TOKEN }} - name: "🧩 Run Assemble" if: success() id: assemble - run: ./gradlew assemble + run: ./gradlew -U assemble - name: "πŸ” Generate secring file" env: SECRING_FILE: ${{ secrets.SECRING_FILE }} @@ -63,12 +63,11 @@ jobs: NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }} NEXUS_PUBLISH_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }} NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }} - SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY_ID }} SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} SECRING_FILE: ${{ secrets.SECRING_FILE }} - working-directory: ./plugin run: > - ../gradlew + ./gradlew -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeSonatypeStagingRepository @@ -98,14 +97,13 @@ jobs: NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }} NEXUS_PUBLISH_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }} NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }} - working-directory: ./plugin run: > - ../gradlew + ./gradlew findSonatypeStagingRepository releaseSonatypeStagingRepository - name: "βš™οΈRun post-release" if: success() - uses: micronaut-projects/github-actions/post-release@master + uses: grails/github-actions/post-release@main with: token: ${{ secrets.GITHUB_TOKEN }} env: diff --git a/LOCALDEPLOYMENT.md b/LOCALDEPLOYMENT.md index 2cb3a8d..22c7e7b 100644 --- a/LOCALDEPLOYMENT.md +++ b/LOCALDEPLOYMENT.md @@ -5,12 +5,12 @@ This page is meant for people not willing to wait for an official plugin release ### Build ```shell -npm run grails:release +npm install +npx gulp grailsRelease cd plugin -./gradlew clean -./gradlew build +./gradlew clean build ``` ### Public local diff --git a/README.md b/README.md index 8c80d58..4d03311 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ repositories { } dependencies { - runtimeOnly 'com.github.grails-plugins:grails-web-console:7.0.0-SNAPSHOT' + runtimeOnly 'com.github.grails-plugins:grails-web-console:7.0.0-M1' } ``` diff --git a/app/build.gradle b/app/build.gradle index a7157e0..fcfa329 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,17 +1,31 @@ +buildscript { + repositories { + maven { url "https://plugins.gradle.org/m2/" } + maven { url "https://repo.grails.org/grails/core" } + } + dependencies { + classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" + classpath "org.grails.plugins:hibernate5:$grailsHibernateGradlePluginVersion" + classpath "com.bertramlabs.plugins:asset-pipeline-gradle:$assetPipelineVersion" + } +} + plugins { id "groovy" - id "org.grails.grails-web" - id "org.grails.grails-gsp" id "war" id "idea" - id "com.bertramlabs.asset-pipeline" - id "application" + id "com.bertramlabs.asset-pipeline" version "$assetPipelineVersion" id "eclipse" } +apply plugin: "org.grails.grails-web" +apply plugin: "org.grails.grails-gsp" + group = "grails.app" dependencies { + implementation platform("org.grails:grails-bom:$grailsVersion") + implementation("org.grails:grails-core") implementation("org.grails:grails-logging") implementation("org.grails:grails-plugin-databinding") @@ -31,22 +45,18 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-tomcat") implementation("org.springframework.boot:spring-boot-starter-validation") console("org.grails:grails-console") - runtimeOnly("com.bertramlabs.plugins:asset-pipeline-grails:${assetPipelineVersion}") + runtimeOnly("com.bertramlabs.plugins:asset-pipeline-grails") runtimeOnly("com.h2database:h2") runtimeOnly("org.apache.tomcat:tomcat-jdbc") - runtimeOnly("org.fusesource.jansi:jansi:1.18") + runtimeOnly("org.fusesource.jansi:jansi") testImplementation("org.grails:grails-gorm-testing-support") testImplementation("org.grails:grails-web-testing-support") - integrationTestImplementation testFixtures("org.grails.plugins:geb:${gebVersion}") + integrationTestImplementation testFixtures("org.grails.plugins:geb") testImplementation("org.spockframework:spock-core") - implementation project(':plugin') - -} + implementation project(':grails-web-console') -application { - mainClass.set("grails.app.Application") } tasks.withType(Test) { diff --git a/app/buildSrc/build.gradle b/app/buildSrc/build.gradle deleted file mode 100644 index a7078cd..0000000 --- a/app/buildSrc/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -repositories { - mavenCentral() - maven { url "https://repo1.maven.org/maven2/" } - maven { url "https://repo.grails.org/grails/core" } -} -dependencies { - 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/grails-app/conf/logback-spring.xml b/app/grails-app/conf/logback-spring.xml new file mode 100644 index 0000000..3b41fb9 --- /dev/null +++ b/app/grails-app/conf/logback-spring.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/grails-app/conf/logback.xml b/app/grails-app/conf/logback.xml deleted file mode 100644 index 70b1484..0000000 --- a/app/grails-app/conf/logback.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - true - - UTF-8 - %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex - - - - - - - - diff --git a/build.gradle b/build.gradle index 8b67d93..a520d2e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,13 @@ +buildscript { + repositories { + maven { url "https://plugins.gradle.org/m2/" } + maven { url "https://repo.grails.org/grails/core" } + } + dependencies { + classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" + } +} + allprojects { repositories { mavenCentral() @@ -6,6 +16,7 @@ allprojects { } version project.projectVersion +group "org.grails.plugins" subprojects { project -> version project.projectVersion @@ -13,4 +24,19 @@ subprojects { project -> apply plugin: "groovy" project.compileJava.options.release = 17 + + if(project.name.endsWith('grails-web-console')) { + apply plugin: "org.grails.grails-publish" + + grailsPublish { + githubSlug = 'grails-plugins/grails-web-console' + + license { + name = 'Apache-2.0' + } + title = "Grails Web Console Plugin" + desc = "A web-based Groovy console for interactive runtime application management and debugging" + developers = [ziegfried: 'Siegfried Puchbauer', mingfai: 'Mingfai Ma', burtbeckwith: 'Burt Beckwith', sheehan: 'Matt Sheehan', mjhugo: 'Mike Hugo', kdybicz: 'Kamil Dybicz', vsachinv: 'vsachinv' ] + } + } } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 8a175d6..0a70384 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ projectVersion=7.0.0-SNAPSHOT -grailsVersion=7.0.0-SNAPSHOT +grailsVersion=7.0.0-M1 grailsGradlePluginVersion=7.0.0-SNAPSHOT -gebVersion=5.0.0-SNAPSHOT -assetPipelineVersion=5.0.1 -version=7.0.0-SNAPSHOT +grailsHibernateGradlePluginVersion=9.0.0-M2 +assetPipelineVersion=5.0.5 + org.gradle.caching=true org.gradle.daemon=true org.gradle.parallel=true diff --git a/plugin/build.gradle b/plugin/build.gradle index 2672616..355dfbe 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -1,30 +1,34 @@ buildscript { repositories { - mavenCentral() - gradlePluginPortal() + maven { url "https://plugins.gradle.org/m2/" } maven { url "https://repo.grails.org/grails/core" } } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" + classpath "org.grails.plugins:hibernate5:$grailsHibernateGradlePluginVersion" + classpath "com.bertramlabs.plugins:asset-pipeline-gradle:$assetPipelineVersion" } } plugins { id "groovy" + id "war" id "idea" - id "org.grails.grails-web" - id "org.grails.grails-gsp" - id "org.grails.grails-plugin" - id "application" id "eclipse" + id "application" id "com.gorylenko.gradle-git-properties" - id "org.grails.grails-publish" id "com.adarshr.test-logger" version "4.0.0" } +apply plugin: "org.grails.grails-web" +apply plugin: "org.grails.grails-gsp" +apply plugin: "org.grails.grails-plugin" + group "org.grails.plugins" dependencies { + implementation platform("org.grails:grails-bom:$grailsVersion") + implementation("org.grails:grails-core") implementation("org.grails:grails-logging") implementation("org.grails:grails-plugin-databinding") @@ -131,13 +135,3 @@ testlogger { // enable if you wish to package this plugin as a standalone application bootJar.enabled = false - -grailsPublish { - githubSlug = 'grails-plugins/grails-web-console' - license { - name = 'Apache-2.0' - } - title = "Grails Web Console Plugin" - desc = "A web-based Groovy console for interactive runtime application management and debugging" - developers = [ziegfried: 'Siegfried Puchbauer', mingfai: 'Mingfai Ma', burtbeckwith: 'Burt Beckwith', sheehan: 'Matt Sheehan', mjhugo: 'Mike Hugo', kdybicz: 'Kamil Dybicz', vsachinv: 'vsachinv' ] -} diff --git a/plugin/buildSrc/build.gradle b/plugin/buildSrc/build.gradle deleted file mode 100644 index ed3b224..0000000 --- a/plugin/buildSrc/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -repositories { - mavenCentral() - maven { url "https://repo1.maven.org/maven2/" } - maven { url "https://repo.grails.org/grails/core" } -} - -dependencies { - 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/grails-app/conf/logback-spring.xml b/plugin/grails-app/conf/logback-spring.xml new file mode 100644 index 0000000..3b41fb9 --- /dev/null +++ b/plugin/grails-app/conf/logback-spring.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugin/grails-app/conf/logback.xml b/plugin/grails-app/conf/logback.xml deleted file mode 100644 index 70b1484..0000000 --- a/plugin/grails-app/conf/logback.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - true - - UTF-8 - %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex - - - - - - - - diff --git a/settings.gradle b/settings.gradle index 19f832c..f84178e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,15 +4,18 @@ pluginManagement { gradlePluginPortal() } plugins { - id "org.grails.grails-web" version "${grailsVersion}" - id "org.grails.grails-gsp" version "${grailsVersion}" - id "org.grails.grails-plugin" version "${grailsVersion}" - id "org.grails.grails-publish" version "${grailsVersion}" + id "org.grails.grails-web" version "${grailsGradlePluginVersion}" + id "org.grails.grails-gsp" version "${grailsGradlePluginVersion}" + id "org.grails.grails-plugin" version "${grailsGradlePluginVersion}" + id "org.grails.grails-publish" version "${grailsGradlePluginVersion}" id "com.bertramlabs.asset-pipeline" version "${assetPipelineVersion}" id "com.gorylenko.gradle-git-properties" version "2.4.2" } } rootProject.name = 'grails-web-console-root' + include 'plugin' +findProject(":plugin").name = "grails-web-console" + include 'app' \ No newline at end of file From 5a588bd1b31686bf7d19bc0b823c33807601d72b Mon Sep 17 00:00:00 2001 From: grails-build Date: Tue, 24 Dec 2024 02:51:56 +0000 Subject: [PATCH 04/17] [skip ci] Release v7.0.0-M1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 0a70384..81e6011 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=7.0.0-SNAPSHOT +projectVersion=7.0.0-M1 grailsVersion=7.0.0-M1 grailsGradlePluginVersion=7.0.0-SNAPSHOT From 2c56bd8d6b54e111f5e3ffb0bd0c631083be277f Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Tue, 24 Dec 2024 13:22:01 -0500 Subject: [PATCH 05/17] [skip ci] Back to snapshot --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 81e6011..0a70384 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=7.0.0-M1 +projectVersion=7.0.0-SNAPSHOT grailsVersion=7.0.0-M1 grailsGradlePluginVersion=7.0.0-SNAPSHOT From 1230eb348d699383bdb3da393893d74472966b22 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Tue, 24 Dec 2024 13:23:00 -0500 Subject: [PATCH 06/17] [skip ci] update SIGNING_KEY secret name --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af18b3e..6537a60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,7 +63,7 @@ jobs: NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }} NEXUS_PUBLISH_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }} NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }} - SIGNING_KEY: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} SECRING_FILE: ${{ secrets.SECRING_FILE }} run: > From 851aa83205f53bc13220a4dbb3ba02b22bb400e4 Mon Sep 17 00:00:00 2001 From: grails-build Date: Tue, 24 Dec 2024 18:24:09 +0000 Subject: [PATCH 07/17] [skip ci] Release v7.0.0-M2 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 0a70384..39de7d4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=7.0.0-SNAPSHOT +projectVersion=7.0.0-M2 grailsVersion=7.0.0-M1 grailsGradlePluginVersion=7.0.0-SNAPSHOT From 17f5060b7f7218280d553860224087413178b176 Mon Sep 17 00:00:00 2001 From: grails-build Date: Tue, 24 Dec 2024 18:27:46 +0000 Subject: [PATCH 08/17] chore: Bump version to 7.0.0-SNAPSHOT --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 39de7d4..0a70384 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=7.0.0-M2 +projectVersion=7.0.0-SNAPSHOT grailsVersion=7.0.0-M1 grailsGradlePluginVersion=7.0.0-SNAPSHOT From 4ef9c1c5042211b1e6be56a6aeec5d8a93fe6d0f Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Wed, 16 Jul 2025 14:15:31 -0600 Subject: [PATCH 09/17] Update to Grails 7.0.0-M5 --- .github/workflows/gradle.yml | 2 +- .github/workflows/release.yml | 114 +++++++------ app/build.gradle | 67 ++++---- build.gradle | 19 +-- buildSrc/build.gradle | 43 +++++ gradle.properties | 8 +- gradle/java-config.gradle | 41 +++++ gradle/test-config.gradle | 18 +++ gradle/wrapper/gradle-wrapper.properties | 2 +- plugin/build.gradle | 153 ++++-------------- .../plugins/console/ConsoleController.groovy | 52 +++--- .../plugins/console/ConsoleUrlMappings.groovy | 8 - .../plugins/console/EnabledInterceptor.groovy | 3 +- .../plugins/console/TokenInterceptor.groovy | 12 +- .../init/grailsconsole/Application.groovy | 3 + .../plugins/console/ConsoleService.groovy | 16 +- .../console/ConsoleControllerSpec.groovy | 3 +- settings.gradle | 15 -- 18 files changed, 284 insertions(+), 295 deletions(-) create mode 100644 buildSrc/build.gradle create mode 100644 gradle/java-config.gradle create mode 100644 gradle/test-config.gradle delete mode 100644 plugin/grails-app/controllers/org/grails/plugins/console/ConsoleUrlMappings.groovy diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index c126657..cbd520d 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -62,6 +62,6 @@ jobs: env: MAVEN_PUBLISH_USERNAME: ${{ secrets.MAVEN_PUBLISH_USERNAME }} MAVEN_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PUBLISH_PASSWORD }} - MAVEN_PUBLISH_URL: ${{ secrets.MAVEN_PUBLISH_SNAPSHOT_URL }} + MAVEN_PUBLISH_URL: 'https://repo.grails.org/artifactory/plugins3-snapshots-local' working-directory: ./plugin run: ../gradlew publish diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6537a60..678b806 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,22 +3,41 @@ on: release: types: [published] env: - GIT_USER_NAME: 'grails-build' - GIT_USER_EMAIL: 'grails-build@users.noreply.github.com' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + JAVA_VERSION: '17.0.15' # this must be a specific version for reproducible builds + RELEASE_TAG_PREFIX: 'v' jobs: publish: permissions: + packages: read # pre-release workflow contents: write # to create release issues: write # to modify milestones - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: release_version: ${{ steps.release_version.outputs.value }} - target_branch: ${{ steps.extract_branch.outputs.value }} + extract_repository_name: ${{ steps.extract_repository_name.outputs.repository_name }} steps: + - name: "πŸ“ Store the current release version" + id: release_version + run: | + export RELEASE_VERSION="${{ github.ref_name }}" + export RELEASE_VERSION=${RELEASE_VERSION:${#RELEASE_TAG_PREFIX}} + echo "Found Release Version: ${RELEASE_VERSION}" + echo "value=${RELEASE_VERSION}" >> $GITHUB_OUTPUT + - name: "Extract repository name" + id: extract_repository_name + run: | + echo "repository_name=${GITHUB_REPOSITORY##*/}" >> $GITHUB_OUTPUT - name: "πŸ“₯ Checkout the repository" uses: actions/checkout@v4 with: - token: ${{ secrets.GH_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} + ref: v{{ steps.release_version.outputs.value }} + - name: 'Ensure Common Build Date' # to ensure a reproducible build + run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> "$GITHUB_ENV" + - name: "Ensure source files use common date" + run: | + find . -depth \( -type f -o -type d \) -exec touch -d "@${SOURCE_DATE_EPOCH}" {} + - name: "🧱 Setup up node" uses: actions/setup-node@v3 with: @@ -30,81 +49,74 @@ jobs: - name: "β˜•οΈ Setup JDK" uses: actions/setup-java@v4 with: - distribution: 'liberica' - java-version: '17' + distribution: liberica + java-version: ${{ env.JAVA_VERSION }} - name: "🐘 Setup Gradle" uses: gradle/actions/setup-gradle@v4 - - name: "πŸ“ Store the target branch" - id: extract_branch - run: | - echo "Determining Target Branch" - TARGET_BRANCH=${GITHUB_REF#refs/heads/} - echo $TARGET_BRANCH - echo "value=${TARGET_BRANCH}" >> $GITHUB_OUTPUT - - name: "πŸ“Set the current release version" - id: release_version - run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT - name: "βš™οΈ Run pre-release" - uses: grails/github-actions/pre-release@main - with: - token: ${{ secrets.GITHUB_TOKEN }} + uses: grails/github-actions/pre-release@asf + env: + RELEASE_VERSION: ${{ steps.release_version.outputs.value }} - name: "🧩 Run Assemble" - if: success() id: assemble run: ./gradlew -U assemble - - name: "πŸ” Generate secring file" + - name: "πŸ” Generate key file for artifact signing" env: SECRING_FILE: ${{ secrets.SECRING_FILE }} run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg - - name: "πŸš€ Publish to Sonatype OSSRH" - id: publish + - name: "πŸ“€ Publish to Maven Central" env: - NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }} - NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }} - NEXUS_PUBLISH_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }} - NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }} + GRAILS_PUBLISH_RELEASE: 'true' + NEXUS_PUBLISH_USERNAME: ${{ secrets.MAVEN_USERNAME }} + NEXUS_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + NEXUS_PUBLISH_URL: 'https://ossrh-staging-api.central.sonatype.com/service/local/' + NEXUS_PUBLISH_DESCRIPTION: '${{ steps.extract_repository_name.outputs.repository_name }}:${{ steps.release_version.outputs.value }}' SIGNING_KEY: ${{ secrets.SIGNING_KEY }} - SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} - SECRING_FILE: ${{ secrets.SECRING_FILE }} + SIGNING_PASSPHRASE: ${{ secrets.SECRING_PASSPHRASE }} run: > ./gradlew - -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg - publishToSonatype + -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg + publishMavenPublicationToSonatypeRepository + publishPluginMavenPublicationToSonatypeRepository closeSonatypeStagingRepository + - name: "Generate Build Date file" + run: echo "$SOURCE_DATE_EPOCH" >> build/BUILD_DATE.txt + - name: "Upload Build Date file" + uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 + with: + files: build/BUILD_DATE.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} release: needs: publish runs-on: ubuntu-latest permissions: - contents: read + contents: write + issues: write + pull-requests: write steps: - name: "πŸ“₯ Checkout repository" uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ref: v${{ needs.publish.outputs.release_version }} - name: "β˜•οΈ Setup JDK" uses: actions/setup-java@v4 with: distribution: liberica - java-version: 17 - - name: "πŸ“₯ Checkout repository" - uses: actions/checkout@v4 - with: - token: ${{ secrets.GH_TOKEN }} - ref: v${{ needs.publish.outputs.release_version }} + java-version: ${{ env.JAVA_VERSION }} - name: "🐘 Setup Gradle" uses: gradle/actions/setup-gradle@v4 - - name: "πŸ†Nexus Staging Close And Release" + - name: "πŸ“€ Release staging repository" env: - NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }} - NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }} - NEXUS_PUBLISH_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }} - NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }} + GRAILS_PUBLISH_RELEASE: 'true' + NEXUS_PUBLISH_USERNAME: ${{ secrets.MAVEN_USERNAME }} + NEXUS_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + NEXUS_PUBLISH_URL: 'https://ossrh-staging-api.central.sonatype.com/service/local/' + NEXUS_PUBLISH_DESCRIPTION: '${{ needs.publish.outputs.extract_repository_name }}:${{ needs.publish.outputs.release_version }}' run: > ./gradlew findSonatypeStagingRepository releaseSonatypeStagingRepository - - name: "βš™οΈRun post-release" - if: success() - uses: grails/github-actions/post-release@main - with: - token: ${{ secrets.GITHUB_TOKEN }} - env: - SNAPSHOT_SUFFIX: -SNAPSHOT + - name: "βš™οΈ Run post-release" + uses: apache/grails-github-actions/post-release@asf diff --git a/app/build.gradle b/app/build.gradle index fcfa329..d06fbf9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,66 +1,53 @@ -buildscript { - repositories { - maven { url "https://plugins.gradle.org/m2/" } - maven { url "https://repo.grails.org/grails/core" } - } - dependencies { - classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath "org.grails.plugins:hibernate5:$grailsHibernateGradlePluginVersion" - classpath "com.bertramlabs.plugins:asset-pipeline-gradle:$assetPipelineVersion" - } -} - plugins { id "groovy" - id "war" - id "idea" - id "com.bertramlabs.asset-pipeline" version "$assetPipelineVersion" - id "eclipse" + id "cloud.wondrify.asset-pipeline" } -apply plugin: "org.grails.grails-web" -apply plugin: "org.grails.grails-gsp" +apply plugin: "org.apache.grails.gradle.grails-web" +apply plugin: "org.apache.grails.gradle.grails-gsp" + +version = project.projectVersion group = "grails.app" dependencies { - implementation platform("org.grails:grails-bom:$grailsVersion") - - implementation("org.grails:grails-core") - implementation("org.grails:grails-logging") - implementation("org.grails:grails-plugin-databinding") - implementation("org.grails:grails-plugin-i18n") - implementation("org.grails:grails-plugin-interceptors") - implementation("org.grails:grails-plugin-rest") - implementation("org.grails:grails-plugin-services") - implementation("org.grails:grails-plugin-url-mappings") - implementation("org.grails:grails-web-boot") - implementation("org.grails.plugins:gsp") - implementation("org.grails.plugins:hibernate5") - implementation("org.grails.plugins:scaffolding") + implementation platform("org.apache.grails:grails-bom:$grailsVersion") + + implementation("org.apache.grails:grails-core") + implementation("org.apache.grails:grails-logging") + implementation("org.apache.grails:grails-databinding") + implementation("org.apache.grails:grails-i18n") + implementation("org.apache.grails:grails-interceptors") + implementation("org.apache.grails:grails-rest-transforms") + implementation("org.apache.grails:grails-services") + implementation("org.apache.grails:grails-url-mappings") + implementation("org.apache.grails:grails-web-boot") + implementation("org.apache.grails:grails-gsp") + implementation("org.apache.grails:grails-data-hibernate5") + implementation("org.apache.grails:grails-scaffolding") implementation("org.springframework.boot:spring-boot-autoconfigure") implementation("org.springframework.boot:spring-boot-starter") implementation("org.springframework.boot:spring-boot-starter-actuator") implementation("org.springframework.boot:spring-boot-starter-logging") implementation("org.springframework.boot:spring-boot-starter-tomcat") implementation("org.springframework.boot:spring-boot-starter-validation") - console("org.grails:grails-console") - runtimeOnly("com.bertramlabs.plugins:asset-pipeline-grails") + console("org.apache.grails:grails-console") + runtimeOnly("cloud.wondrify:asset-pipeline-grails") runtimeOnly("com.h2database:h2") runtimeOnly("org.apache.tomcat:tomcat-jdbc") runtimeOnly("org.fusesource.jansi:jansi") - testImplementation("org.grails:grails-gorm-testing-support") - testImplementation("org.grails:grails-web-testing-support") + testImplementation("org.apache.grails:grails-testing-support-datamapping") + testImplementation("org.apache.grails:grails-testing-support-web") - integrationTestImplementation testFixtures("org.grails.plugins:geb") + integrationTestImplementation testFixtures("org.apache.grails:grails-geb") testImplementation("org.spockframework:spock-core") implementation project(':grails-web-console') - } -tasks.withType(Test) { - useJUnitPlatform() +apply { + from project.rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from project.rootProject.layout.projectDirectory.file('gradle/test-config.gradle') } assets { diff --git a/build.gradle b/build.gradle index a520d2e..b3cac7d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,17 +1,18 @@ buildscript { repositories { - maven { url "https://plugins.gradle.org/m2/" } - maven { url "https://repo.grails.org/grails/core" } + maven { url 'https://plugins.gradle.org/m2/' } + maven { url 'https://repo.grails.org/grails/restricted' } } dependencies { - classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" + classpath platform("org.apache.grails:grails-bom:${grailsVersion}") + classpath 'org.apache.grails:grails-gradle-plugins' } } allprojects { repositories { + maven { url "https://repo.grails.org/grails/restricted" } mavenCentral() - maven { url "https://repo.grails.org/grails/core" } } } @@ -19,14 +20,8 @@ version project.projectVersion group "org.grails.plugins" subprojects { project -> - version project.projectVersion - - apply plugin: "groovy" - - project.compileJava.options.release = 17 - if(project.name.endsWith('grails-web-console')) { - apply plugin: "org.grails.grails-publish" + apply plugin: "org.apache.grails.gradle.grails-publish" grailsPublish { githubSlug = 'grails-plugins/grails-web-console' @@ -35,7 +30,7 @@ subprojects { project -> name = 'Apache-2.0' } title = "Grails Web Console Plugin" - desc = "A web-based Groovy console for interactive runtime application management and debugging" + desc = "A Grails Plugin that adds a web-based Groovy console for interactive runtime application management and debugging" developers = [ziegfried: 'Siegfried Puchbauer', mingfai: 'Mingfai Ma', burtbeckwith: 'Burt Beckwith', sheehan: 'Matt Sheehan', mjhugo: 'Mike Hugo', kdybicz: 'Kamil Dybicz', vsachinv: 'vsachinv' ] } } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle new file mode 100644 index 0000000..483cda1 --- /dev/null +++ b/buildSrc/build.gradle @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +plugins { + id 'groovy-gradle-plugin' +} + +file('../gradle.properties').withInputStream { + Properties props = new Properties() + props.load(it) + project.ext.gradleProperties = props +} + +compileJava.options.release = gradleProperties.javaVersion.toString().toInteger() + +repositories { + maven { url = 'https://repo.grails.org/grails/restricted' } + mavenCentral() + gradlePluginPortal() +} + +dependencies { + implementation platform("org.apache.grails:grails-gradle-bom:${gradleProperties.grailsVersion}") + implementation 'cloud.wondrify:asset-pipeline-gradle' + implementation 'org.apache.grails:grails-gradle-plugins' + implementation "com.adarshr.test-logger:com.adarshr.test-logger.gradle.plugin:${gradleProperties.testLoggerVersion}" +} diff --git a/gradle.properties b/gradle.properties index 0a70384..a7144c0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,7 @@ projectVersion=7.0.0-SNAPSHOT - -grailsVersion=7.0.0-M1 -grailsGradlePluginVersion=7.0.0-SNAPSHOT -grailsHibernateGradlePluginVersion=9.0.0-M2 -assetPipelineVersion=5.0.5 +grailsVersion=7.0.0-M5 +javaVersion=17 +testLoggerVersion=4.0.0 org.gradle.caching=true org.gradle.daemon=true diff --git a/gradle/java-config.gradle b/gradle/java-config.gradle new file mode 100644 index 0000000..4869b6d --- /dev/null +++ b/gradle/java-config.gradle @@ -0,0 +1,41 @@ +compileJava.options.release = javaVersion.toInteger() + +extensions.configure(JavaPluginExtension) { + // Explicit `it` is required here + it.withJavadocJar() + it.withSourcesJar() +} + +tasks.withType(Javadoc).configureEach { Javadoc it -> + it.options.noTimestamp true // prevent the file header with the date + it.options.bottom "Version: ${projectVersion}" +} + +tasks.withType(GroovyCompile).configureEach { + groovyOptions.encoding = 'UTF-8' // encoding needs to be the same since it's different across platforms + // Preserve method parameter names in Groovy classes for IDE parameter hints. + groovyOptions.parameters = true + options.encoding = 'UTF-8' // encoding needs to be the same since it's different across platforms + options.fork = true + options.forkOptions.jvmArgs = ['-Xms128M', '-Xmx2G'] +} + +tasks.withType(Jar).configureEach { + manifest.attributes( + 'Implementation-Title': 'Apache Grails', + 'Implementation-Version': grailsVersion, + 'Implementation-Vendor': 'grails.apache.org' + ) +} + +tasks.withType(AbstractArchiveTask).configureEach { + preserveFileTimestamps = false // to prevent timestamp mismatches + reproducibleFileOrder = true // to keep the same ordering + // to avoid platform specific defaults, set the permissions consistently + filePermissions { permissions -> + permissions.unix(0644) + } + dirPermissions { permissions -> + permissions.unix(0755) + } +} diff --git a/gradle/test-config.gradle b/gradle/test-config.gradle new file mode 100644 index 0000000..d2593d2 --- /dev/null +++ b/gradle/test-config.gradle @@ -0,0 +1,18 @@ +tasks.withType(Test) { + useJUnitPlatform() + + testLogging { + exceptionFormat = 'full' + events 'passed', 'skipped', 'failed'//, 'standardOut', 'standardError' + } +} + +apply plugin: 'com.adarshr.test-logger' +testlogger { + theme 'mocha' + showFullStackTraces true + showStandardStreams true + showPassedStandardStreams false + showSkippedStandardStreams false + showFailedStandardStreams true +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index df97d72..d4081da 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/plugin/build.gradle b/plugin/build.gradle index 355dfbe..ea2bd23 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -1,137 +1,40 @@ -buildscript { - repositories { - maven { url "https://plugins.gradle.org/m2/" } - maven { url "https://repo.grails.org/grails/core" } - } - dependencies { - classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath "org.grails.plugins:hibernate5:$grailsHibernateGradlePluginVersion" - classpath "com.bertramlabs.plugins:asset-pipeline-gradle:$assetPipelineVersion" - } -} - plugins { id "groovy" - id "war" - id "idea" - id "eclipse" - id "application" - id "com.gorylenko.gradle-git-properties" - id "com.adarshr.test-logger" version "4.0.0" } -apply plugin: "org.grails.grails-web" -apply plugin: "org.grails.grails-gsp" -apply plugin: "org.grails.grails-plugin" +apply plugin: "org.apache.grails.gradle.grails-web" +apply plugin: "org.apache.grails.gradle.grails-gsp" +apply plugin: "org.apache.grails.gradle.grails-plugin" -group "org.grails.plugins" +version = project.projectVersion +group = "org.grails.plugins" dependencies { - implementation platform("org.grails:grails-bom:$grailsVersion") - - implementation("org.grails:grails-core") - implementation("org.grails:grails-logging") - implementation("org.grails:grails-plugin-databinding") - implementation("org.grails:grails-plugin-i18n") - implementation("org.grails:grails-plugin-interceptors") - implementation("org.grails:grails-plugin-rest") - implementation("org.grails:grails-plugin-services") - implementation("org.grails:grails-plugin-url-mappings") - implementation("org.grails:grails-web-boot") - implementation("org.grails.plugins:hibernate5") - implementation("org.springframework.boot:spring-boot-autoconfigure") - implementation("org.springframework.boot:spring-boot-starter-logging") - implementation("org.springframework.boot:spring-boot-starter-validation") - console("org.grails:grails-console") - runtimeOnly("com.h2database:h2") - runtimeOnly("org.apache.tomcat:tomcat-jdbc") - testImplementation("org.grails:grails-gorm-testing-support") - testImplementation("org.grails:grails-web-testing-support") + compileOnly platform("org.apache.grails:grails-bom:$grailsVersion") + + compileOnly("org.apache.grails:grails-core") + compileOnly("org.apache.grails:grails-logging") + compileOnly("org.apache.grails:grails-databinding") + compileOnly("org.apache.grails:grails-interceptors") + compileOnly("org.apache.grails:grails-rest-transforms") + compileOnly("org.apache.grails:grails-services") + compileOnly("org.apache.grails:grails-url-mappings") + compileOnly("org.apache.grails:grails-web-boot") + compileOnly("org.apache.grails:grails-gsp") + + console("org.apache.grails:grails-console") + + testImplementation platform("org.apache.grails:grails-bom:$grailsVersion") + testImplementation("org.apache.grails:grails-testing-support-web") testImplementation("org.spockframework:spock-core") - compileOnly "jakarta.servlet:jakarta.servlet-api" - testImplementation "jakarta.servlet:jakarta.servlet-api" - implementation("org.grails.plugins:gsp") - implementation("org.grails.plugins:scaffolding") - - implementation 'commons-io:commons-io:2.16.1' - runtimeOnly("org.fusesource.jansi:jansi") -} - -application { - mainClass.set("grailsconsole.Application") -} - -bootRun { - ignoreExitValue true - jvmArgs( - '-Dspring.output.ansi.enabled=always', - '-noverify', - '-XX:TieredStopAtLevel=1', - '-Xmx1024m') - sourceResources sourceSets.main - String springProfilesActive = 'spring.profiles.active' - systemProperty springProfilesActive, System.getProperty(springProfilesActive) -} - -tasks.withType(GroovyCompile) { - configure(groovyOptions) { - forkOptions.jvmArgs = ['-Xmx1024m'] - } -} - -gitProperties { - keys = ['git.branch', 'git.commit.id', 'git.commit.time', 'git.commit.id.abbrev'] - failOnNoGitDirectory = true - extProperty = 'gitProps' // git properties will be put in a map at project.ext.gitProps -} - -generateGitProperties.outputs.upToDateWhen { - false -} // make sure the generateGitProperties task always executes (even when git.properties is not changed) - -jar { - dependsOn generateGitProperties, bootStartScripts, bootDistTar, bootDistZip - manifest { - attributes("Built-By": System.getProperty("user.name")) - attributes(["Plugin-Version" : version, - "Plugin-Title" : project.name, - "Plugin-Build-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), - "Git-Commit" : "${-> project.ext.gitProps['git.commit.id.abbrev']}", - "Git-Branch" : "${-> project.ext.gitProps['git.branch']}"]) - } - from sourceSets.main.output - exclude 'git.properties' -} - -task sourceJar(type: Jar) { - from sourceSets.main.allSource -} - -task packageJavadoc(type: Jar) { - from javadoc -} - -task packageGroovydoc(type: Jar) { - from groovydoc -} - -tasks.withType(Test) { - useJUnitPlatform() - - testLogging { - exceptionFormat = 'full' - events 'passed', 'skipped', 'failed'//, 'standardOut', 'standardError' - } + testRuntimeOnly 'net.bytebuddy:byte-buddy' } -testlogger { - theme 'mocha' - showFullStackTraces true - showStandardStreams true - showPassedStandardStreams false - showSkippedStandardStreams false - showFailedStandardStreams true +apply { + from project.rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from project.rootProject.layout.projectDirectory.file('gradle/test-config.gradle') } -// enable if you wish to package this plugin as a standalone application -bootJar.enabled = false +grails { + springDependencyManagement = false +} \ No newline at end of file diff --git a/plugin/grails-app/controllers/org/grails/plugins/console/ConsoleController.groovy b/plugin/grails-app/controllers/org/grails/plugins/console/ConsoleController.groovy index 744c7fb..36a443b 100644 --- a/plugin/grails-app/controllers/org/grails/plugins/console/ConsoleController.groovy +++ b/plugin/grails-app/controllers/org/grails/plugins/console/ConsoleController.groovy @@ -1,30 +1,32 @@ package org.grails.plugins.console +import grails.artefact.Controller import grails.converters.JSON -import org.apache.commons.io.FilenameUtils -class ConsoleController { +import java.nio.file.Paths + +class ConsoleController implements Controller { def consoleService def consoleConfig def index() { Map model = [ - json: [ - implicitVars: [ - config: 'the Grails configuration', - console: 'the browser console', - ctx: 'the Spring application context', - grailsApplication: 'the Grails application', - out: 'the output PrintStream', - request: 'the HTTP request', - session: 'the HTTP session', - ], - baseUrl: getBaseUrl(), - remoteFileStoreEnabled: consoleConfig.remoteFileStoreEnabled, - groovyVersion: GroovySystem.version, - grailsVersion: grailsApplication.metadata['app.grails.version'] - ] + json: [ + implicitVars : [ + config : 'the Grails configuration', + console : 'the browser console', + ctx : 'the Spring application context', + grailsApplication: 'the Grails application', + out : 'the output PrintStream', + request : 'the HTTP request', + session : 'the HTTP session', + ], + baseUrl : getBaseUrl(), + remoteFileStoreEnabled: consoleConfig.remoteFileStoreEnabled, + groovyVersion : GroovySystem.version, + grailsVersion : grailsApplication.metadata['app.grails.version'] + ] ] if (consoleConfig.newFileText != null) { @@ -68,12 +70,16 @@ class ConsoleController { return renderError("Directory not found or cannot be read: $path", 400) } Map result = [ - path: FilenameUtils.normalize(baseDir.absolutePath, true), - files: baseDir.listFiles().sort { it.name }.collect { fileToJson it, false } + path : normalizePath(baseDir), + files: baseDir.listFiles().sort { it.name }.collect { fileToJson it, false } ] render result as JSON } + private static String normalizePath(File file) { + Paths.get(file.absolutePath).normalize().toString().replace(File.separator, '/') + } + def file() { if (!consoleConfig.remoteFileStoreEnabled) { return renderError("Remote file store disabled", 403) @@ -187,10 +193,10 @@ class ConsoleController { private static Map fileToJson(File file, boolean includeText = true) { Map json = [ - id: FilenameUtils.normalize(file.absolutePath, true), - name: file.name, - type: file.isDirectory() ? 'dir' : 'file', - lastModified: file.lastModified() + id : normalizePath(file), + name : file.name, + type : file.isDirectory() ? 'dir' : 'file', + lastModified: file.lastModified() ] if (includeText && file.isFile()) { json.text = file.text diff --git a/plugin/grails-app/controllers/org/grails/plugins/console/ConsoleUrlMappings.groovy b/plugin/grails-app/controllers/org/grails/plugins/console/ConsoleUrlMappings.groovy deleted file mode 100644 index 752a44a..0000000 --- a/plugin/grails-app/controllers/org/grails/plugins/console/ConsoleUrlMappings.groovy +++ /dev/null @@ -1,8 +0,0 @@ -package org.grails.plugins.console - -class ConsoleUrlMappings { - - static mappings = { - "/console/$action?"(controller: 'console') - } -} diff --git a/plugin/grails-app/controllers/org/grails/plugins/console/EnabledInterceptor.groovy b/plugin/grails-app/controllers/org/grails/plugins/console/EnabledInterceptor.groovy index ff58fac..edfebe0 100644 --- a/plugin/grails-app/controllers/org/grails/plugins/console/EnabledInterceptor.groovy +++ b/plugin/grails-app/controllers/org/grails/plugins/console/EnabledInterceptor.groovy @@ -1,8 +1,9 @@ package org.grails.plugins.console +import grails.artefact.Interceptor import grails.util.Environment -class EnabledInterceptor { +class EnabledInterceptor implements Interceptor { def consoleConfig diff --git a/plugin/grails-app/controllers/org/grails/plugins/console/TokenInterceptor.groovy b/plugin/grails-app/controllers/org/grails/plugins/console/TokenInterceptor.groovy index 47b7c40..50916f4 100644 --- a/plugin/grails-app/controllers/org/grails/plugins/console/TokenInterceptor.groovy +++ b/plugin/grails-app/controllers/org/grails/plugins/console/TokenInterceptor.groovy @@ -1,8 +1,12 @@ package org.grails.plugins.console -class TokenInterceptor { +import grails.artefact.Interceptor +import org.springframework.beans.factory.annotation.Value - def consoleConfig +class TokenInterceptor implements Interceptor { + + @Value('${grails.plugin.console.csrfProtectionEnabled:true}') + boolean csrfProtectionEnabled TokenInterceptor() { match(controller: 'console').excludes(action: 'index') @@ -10,8 +14,8 @@ class TokenInterceptor { boolean before() { if (actionName - && consoleConfig.csrfProtectionEnabled - && (!session['CONSOLE_CSRF_TOKEN'] || request.getHeader('X-CSRFToken') != session['CONSOLE_CSRF_TOKEN'])) { + && csrfProtectionEnabled + && (!session['CONSOLE_CSRF_TOKEN'] || request.getHeader('X-CSRFToken') != session['CONSOLE_CSRF_TOKEN'])) { response.status = 403 response.writer.println "CSRF token doesn't match. Please refresh the page." return false diff --git a/plugin/grails-app/init/grailsconsole/Application.groovy b/plugin/grails-app/init/grailsconsole/Application.groovy index 3572c28..a028117 100644 --- a/plugin/grails-app/init/grailsconsole/Application.groovy +++ b/plugin/grails-app/init/grailsconsole/Application.groovy @@ -2,8 +2,11 @@ package grailsconsole import grails.boot.GrailsApp import grails.boot.config.GrailsAutoConfiguration +import grails.plugins.metadata.PluginSource +@PluginSource class Application extends GrailsAutoConfiguration { + static void main(String[] args) { GrailsApp.run(Application) } diff --git a/plugin/grails-app/services/org/grails/plugins/console/ConsoleService.groovy b/plugin/grails-app/services/org/grails/plugins/console/ConsoleService.groovy index ec3f5b5..3f5e8b2 100644 --- a/plugin/grails-app/services/org/grails/plugins/console/ConsoleService.groovy +++ b/plugin/grails-app/services/org/grails/plugins/console/ConsoleService.groovy @@ -1,5 +1,6 @@ package org.grails.plugins.console +import groovy.util.logging.Slf4j import org.codehaus.groovy.control.CompilerConfiguration import org.codehaus.groovy.control.customizers.ImportCustomizer import grails.core.GrailsApplication @@ -7,6 +8,7 @@ import org.grails.core.artefact.DomainClassArtefactHandler import java.nio.charset.StandardCharsets +@Slf4j class ConsoleService { GrailsApplication grailsApplication @@ -46,13 +48,13 @@ class ConsoleService { private Binding createBinding(request, PrintStream out, Console console) { new Binding([ - session : request.session, - request : request, - ctx : grailsApplication.mainContext, - grailsApplication: grailsApplication, - config : grailsApplication.config, - out : out, - console : console + session : request.session, + request : request, + ctx : grailsApplication.mainContext, + grailsApplication: grailsApplication, + config : grailsApplication.config, + out : out, + console : console ]) } 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 d154202..3e3c177 100644 --- a/plugin/src/test/groovy/org/grails/plugins/console/ConsoleControllerSpec.groovy +++ b/plugin/src/test/groovy/org/grails/plugins/console/ConsoleControllerSpec.groovy @@ -2,7 +2,6 @@ package org.grails.plugins.console import grails.converters.JSON import grails.testing.web.controllers.ControllerUnitTest -import org.apache.commons.io.FileUtils import spock.lang.Specification import java.nio.file.Files @@ -32,7 +31,7 @@ class ConsoleControllerSpec extends Specification implements ControllerUnitTest< } void cleanup() { - FileUtils.deleteDirectory tempDir + tempDir.deleteDir() config.clear() config.merge([ ("config.grails.plugin.console.fileStore.remote.enabled"): true, diff --git a/settings.gradle b/settings.gradle index f84178e..c1332ae 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,18 +1,3 @@ -pluginManagement { - repositories { - maven { url "https://repo.grails.org/grails/core/" } - gradlePluginPortal() - } - plugins { - id "org.grails.grails-web" version "${grailsGradlePluginVersion}" - id "org.grails.grails-gsp" version "${grailsGradlePluginVersion}" - id "org.grails.grails-plugin" version "${grailsGradlePluginVersion}" - id "org.grails.grails-publish" version "${grailsGradlePluginVersion}" - id "com.bertramlabs.asset-pipeline" version "${assetPipelineVersion}" - id "com.gorylenko.gradle-git-properties" version "2.4.2" - } -} - rootProject.name = 'grails-web-console-root' include 'plugin' From 9a03ce01a1cd9af691c1ab9ba485cfc81d630765 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Mon, 21 Jul 2025 13:21:45 -0400 Subject: [PATCH 10/17] fix: typo on reference --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 678b806..e506a10 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: uses: actions/checkout@v4 with: token: ${{ secrets.GITHUB_TOKEN }} - ref: v{{ steps.release_version.outputs.value }} + ref: v${{ steps.release_version.outputs.value }} - name: 'Ensure Common Build Date' # to ensure a reproducible build run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> "$GITHUB_ENV" - name: "Ensure source files use common date" From 0dd6430773cc2a59c934370c54c7ba2111eeaf9f Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Mon, 21 Jul 2025 13:26:24 -0400 Subject: [PATCH 11/17] build: there are no gradle plugins to publish in this project --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e506a10..331d4d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,7 +77,6 @@ jobs: ./gradlew -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishMavenPublicationToSonatypeRepository - publishPluginMavenPublicationToSonatypeRepository closeSonatypeStagingRepository - name: "Generate Build Date file" run: echo "$SOURCE_DATE_EPOCH" >> build/BUILD_DATE.txt From 0d51e7cae8e4cd5d234f8415aae25444f07d0337 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Mon, 21 Jul 2025 13:30:47 -0400 Subject: [PATCH 12/17] build: use correct publish secrets --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 331d4d3..0297c05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,8 +67,8 @@ jobs: - name: "πŸ“€ Publish to Maven Central" env: GRAILS_PUBLISH_RELEASE: 'true' - NEXUS_PUBLISH_USERNAME: ${{ secrets.MAVEN_USERNAME }} - NEXUS_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }} + NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }} NEXUS_PUBLISH_URL: 'https://ossrh-staging-api.central.sonatype.com/service/local/' NEXUS_PUBLISH_DESCRIPTION: '${{ steps.extract_repository_name.outputs.repository_name }}:${{ steps.release_version.outputs.value }}' SIGNING_KEY: ${{ secrets.SIGNING_KEY }} @@ -109,8 +109,8 @@ jobs: - name: "πŸ“€ Release staging repository" env: GRAILS_PUBLISH_RELEASE: 'true' - NEXUS_PUBLISH_USERNAME: ${{ secrets.MAVEN_USERNAME }} - NEXUS_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }} + NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }} NEXUS_PUBLISH_URL: 'https://ossrh-staging-api.central.sonatype.com/service/local/' NEXUS_PUBLISH_DESCRIPTION: '${{ needs.publish.outputs.extract_repository_name }}:${{ needs.publish.outputs.release_version }}' run: > From a09b28318398e67d19bf6a2ad89f80e03f988ec5 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Mon, 21 Jul 2025 13:30:47 -0400 Subject: [PATCH 13/17] build: fix secret name for signing passphrase --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0297c05..57f3c62 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,7 +72,7 @@ jobs: NEXUS_PUBLISH_URL: 'https://ossrh-staging-api.central.sonatype.com/service/local/' NEXUS_PUBLISH_DESCRIPTION: '${{ steps.extract_repository_name.outputs.repository_name }}:${{ steps.release_version.outputs.value }}' SIGNING_KEY: ${{ secrets.SIGNING_KEY }} - SIGNING_PASSPHRASE: ${{ secrets.SECRING_PASSPHRASE }} + SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} run: > ./gradlew -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg From 21770156e8f4288ba91648b07c8fd2634d2560a0 Mon Sep 17 00:00:00 2001 From: jdaugherty Date: Mon, 21 Jul 2025 18:02:37 +0000 Subject: [PATCH 14/17] [skip ci] Release v7.0.0-M3 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index a7144c0..4af4093 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=7.0.0-SNAPSHOT +projectVersion=7.0.0-M3 grailsVersion=7.0.0-M5 javaVersion=17 testLoggerVersion=4.0.0 From b7988f5a79dc8202f9292a2111bb6e65b25abe87 Mon Sep 17 00:00:00 2001 From: jdaugherty Date: Mon, 21 Jul 2025 18:13:57 +0000 Subject: [PATCH 15/17] [skip ci] Bump version to 7.0.0-SNAPSHOT --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 4af4093..a7144c0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=7.0.0-M3 +projectVersion=7.0.0-SNAPSHOT grailsVersion=7.0.0-M5 javaVersion=17 testLoggerVersion=4.0.0 From fc136b389d3c9e1ec8da35c685f6a26f0f8796b3 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Mon, 21 Jul 2025 14:14:11 -0400 Subject: [PATCH 16/17] ci: add release environment to delay future publishes --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57f3c62..29030f8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,6 +89,7 @@ jobs: release: needs: publish runs-on: ubuntu-latest + env: release permissions: contents: write issues: write From 4781e68c5d7a071f28954a313c3807795c03f653 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Tue, 29 Jul 2025 15:20:44 -0400 Subject: [PATCH 17/17] [skip ci] fix environment reference --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29030f8..1d6e3b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,7 +89,7 @@ jobs: release: needs: publish runs-on: ubuntu-latest - env: release + environment: release permissions: contents: write issues: write pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy