diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index 0fd3ab9..cbd520d 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: '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
new file mode 100644
index 0000000..1d6e3b2
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,122 @@
+name: Release
+on:
+ release:
+ types: [published]
+env:
+ 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-24.04
+ outputs:
+ release_version: ${{ steps.release_version.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.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:
+ 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: ${{ env.JAVA_VERSION }}
+ - name: "🐘 Setup Gradle"
+ uses: gradle/actions/setup-gradle@v4
+ - name: "⚙️ Run pre-release"
+ uses: grails/github-actions/pre-release@asf
+ env:
+ RELEASE_VERSION: ${{ steps.release_version.outputs.value }}
+ - name: "🧩 Run Assemble"
+ id: assemble
+ run: ./gradlew -U assemble
+ - 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 Maven Central"
+ env:
+ GRAILS_PUBLISH_RELEASE: 'true'
+ 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 }}
+ SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
+ run: >
+ ./gradlew
+ -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
+ publishMavenPublicationToSonatypeRepository
+ 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
+ environment: release
+ permissions:
+ 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: ${{ env.JAVA_VERSION }}
+ - name: "🐘 Setup Gradle"
+ uses: gradle/actions/setup-gradle@v4
+ - name: "📤 Release staging repository"
+ env:
+ GRAILS_PUBLISH_RELEASE: 'true'
+ 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: >
+ ./gradlew
+ findSonatypeStagingRepository
+ releaseSonatypeStagingRepository
+ - name: "⚙️ Run post-release"
+ uses: apache/grails-github-actions/post-release@asf
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 26c0a99..4d03311 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-[](https://github.com/gpc/grails-web-console/actions/workflows/gradle.yml)
+[](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-M1'
}
```
@@ -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..d06fbf9 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,92 +1,55 @@
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"
- id "application"
- id "eclipse"
+ id "cloud.wondrify.asset-pipeline"
}
-group = "grails.app"
+apply plugin: "org.apache.grails.gradle.grails-web"
+apply plugin: "org.apache.grails.gradle.grails-gsp"
-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')
- }
- }
- }
-}
+version = project.projectVersion
+group = "grails.app"
dependencies {
- 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:5.0.1")
+ 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: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")
- 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")
+ runtimeOnly("org.fusesource.jansi:jansi")
+ testImplementation("org.apache.grails:grails-testing-support-datamapping")
+ testImplementation("org.apache.grails:grails-testing-support-web")
- implementation project(':plugin')
-
-}
+ integrationTestImplementation testFixtures("org.apache.grails:grails-geb")
+ testImplementation("org.spockframework:spock-core")
-application {
- mainClass.set("grails.app.Application")
+ implementation project(':grails-web-console')
}
-java {
- sourceCompatibility = JavaVersion.toVersion("17")
+apply {
+ from project.rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
+ from project.rootProject.layout.projectDirectory.file('gradle/test-config.gradle')
}
-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/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/gradle.properties b/app/gradle.properties
deleted file mode 100644
index 9443be9..0000000
--- a/app/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/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
new file mode 100644
index 0000000..b3cac7d
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,37 @@
+buildscript {
+ repositories {
+ maven { url 'https://plugins.gradle.org/m2/' }
+ maven { url 'https://repo.grails.org/grails/restricted' }
+ }
+ dependencies {
+ 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()
+ }
+}
+
+version project.projectVersion
+group "org.grails.plugins"
+
+subprojects { project ->
+ if(project.name.endsWith('grails-web-console')) {
+ apply plugin: "org.apache.grails.gradle.grails-publish"
+
+ grailsPublish {
+ githubSlug = 'grails-plugins/grails-web-console'
+
+ license {
+ name = 'Apache-2.0'
+ }
+ title = "Grails Web Console Plugin"
+ 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' ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
index de24bc5..483cda1 100644
--- a/buildSrc/build.gradle
+++ b/buildSrc/build.gradle
@@ -1,12 +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()
- maven { url "https://repo1.maven.org/maven2/" }
- maven { url "https://repo.grails.org/grails/core" }
+ gradlePluginPortal()
}
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
+ 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/plugin/gradle.properties b/gradle.properties
similarity index 56%
rename from plugin/gradle.properties
rename to gradle.properties
index 9443be9..a7144c0 100644
--- a/plugin/gradle.properties
+++ b/gradle.properties
@@ -1,6 +1,8 @@
-grailsVersion=7.0.0-SNAPSHOT
-grailsGradlePluginVersion=7.0.0-SNAPSHOT
-version=7.0.0-SNAPSHOT
+projectVersion=7.0.0-SNAPSHOT
+grailsVersion=7.0.0-M5
+javaVersion=17
+testLoggerVersion=4.0.0
+
org.gradle.caching=true
org.gradle.daemon=true
org.gradle.parallel=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 6440622..ea2bd23 100644
--- a/plugin/build.gradle
+++ b/plugin/build.gradle
@@ -1,130 +1,40 @@
plugins {
id "groovy"
- id "idea"
- id "org.grails.grails-web"
- id "org.grails.grails-gsp"
- id "org.grails.grails-plugin"
- id "application"
- id "eclipse"
- id "com.gorylenko.gradle-git-properties"
- id "org.grails.internal.grails-plugin-publish"
}
-group "org.grails.plugins"
+apply plugin: "org.apache.grails.gradle.grails-web"
+apply plugin: "org.apache.grails.gradle.grails-gsp"
+apply plugin: "org.apache.grails.gradle.grails-plugin"
-repositories {
- maven { url "https://repo.grails.org/grails/core" }
-}
-
-configurations {
- all {
- }
-}
+version = project.projectVersion
+group = "org.grails.plugins"
dependencies {
- 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:1.18")
-}
-
-application {
- mainClass.set("grailsconsole.Application")
-}
-
-java {
- sourceCompatibility = JavaVersion.toVersion(17)
-}
-
-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']
- }
+ testRuntimeOnly 'net.bytebuddy:byte-buddy'
}
-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
+apply {
+ from project.rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
+ from project.rootProject.layout.projectDirectory.file('gradle/test-config.gradle')
}
-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()
-}
-// enable if you wish to package this plugin as a standalone application
-bootJar.enabled = false
-
-grailsPublish {
- userOrg = "grails"
- githubSlug = 'gpc/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' ]
-}
+grails {
+ springDependencyManagement = false
+}
\ No newline at end of file
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/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/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 559d76b..49e9871 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 = [
@@ -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/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 52f32b3..c1332ae 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,14 +1,6 @@
-pluginManagement {
- repositories {
- maven { url "https://repo.grails.org/grails/core/" }
- 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"
- }
-}
+rootProject.name = 'grails-web-console-root'
-include 'app', 'plugin'
+include 'plugin'
+findProject(":plugin").name = "grails-web-console"
+
+include 'app'
\ No newline at end of file
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