Skip to content

Commit

Permalink
Merge pull request #1 from vsachinv/6.x-upgrade
Browse files Browse the repository at this point in the history
Upgrade grails console plugin to Grails 6.x
  • Loading branch information
sbglasius authored Sep 10, 2024
2 parents 122f3bf + e893a96 commit 5572b70
Show file tree
Hide file tree
Showing 397 changed files with 127,385 additions and 417 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle

name: Gradle Package

on:
release:
types: [created]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- name: Setup up node
uses: actions/setup-node@v3
with:
node-version: '20.5.1'
- run: npm install
- run: npm install --global gulp-cli
- run: npm gulp grails5Release
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run build with Gradle Wrapper
run: ./gradlew build
working-directory: grails6/plugin
- name: Publish to GitHub Packages
run: ./gradlew publishMavenJarPublicationToGitHubPackagesRepository
working-directory: grails6/plugin
env:
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ This plugin uses [Gulp](http://gulpjs.com/) to build its resources.

1. Change to the project's root directory.
1. Install project dependencies with `npm install`.
1. Build the resources with `gulp release-all`.
1. Build the resources with `npm run release-all`.

## Gulp tasks
## NPM tasks

| Task | Description |
| --- | --- |
Expand Down
38 changes: 38 additions & 0 deletions LOCALDEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Local Deployment

This page is meant for people not willing to wait for an official plugin release.

### Build

```shell
npm run grails3:release

cd grails3/plugin

./gradlew clean
./gradlew build
```

### Public local

Steps to use new version locally:
* Add mavenLocal() as a repository location in the main build.gradle
* Make sure mavenLocal() is in the first position of the list.
* Make sure you are using the correct version of your library.

```
buildscript {
repositories {
mavenLocal()
...
```

Now, every time you change a line in the Library you need to execute within library project path, the following gradle command:

```shell
./gradlew build publishToMavenLocal
```

### Publish to S3

You can follow one of the guides on how to deploy to S3 bucket you can find in [Google](https://www.google.com/search?q=maven+publish+to+s3).
131 changes: 128 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ The [1.X](https://grails.org/plugin/console) version is for Grails 2.

The [2.0.X](http://plugins.grails.org/plugin/sheehan/console) version is for Grails 3.0 - 3.2.

The [2.1.X](http://plugins.grails.org/plugin/sheehan/console) version is for Grails 3.3+.
The [2.X.X](http://plugins.grails.org/plugin/sheehan/console) version is for Grails 3.3+.

The [4.X.X](http://plugins.grails.org/plugin/sheehan/console) version is for Grails 4+.

The [5.X.X](http://plugins.grails.org/plugin/sheehan/console) version is for Grails 5+.

### Grails 2

Expand Down Expand Up @@ -37,6 +41,122 @@ Add a dependency in build.gradle
runtime 'org.grails.plugins:grails-console:2.1.1'
```

For upgraded handler version use below version.

```groovy
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.vsachinv:grails-console:2.2.0'
}
```


### Grails 4+

Add a dependency in build.gradle

```groovy
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.vsachinv:grails-console:4.0-M1'
}
```

In addition if you don't want to use jitpack.io then use following github package registry:

```groovy
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/vsachinv/grails-console")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
dependencies {
compile 'org.grails.plugins:grails-console:4.0-M1'
}
```

### Grails 5+

Add a dependency in build.gradle

```groovy
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.vsachinv:grails-console:5.0-M1'
}
```

In addition if you don't want to use jitpack.io then use following github package registry:

```groovy
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/vsachinv/grails-console")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
dependencies {
compile 'org.grails.plugins:grails-console:5.0-M1'
}
```


### Grails 6+

Add a dependency in build.gradle

```groovy
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.vsachinv:grails-console:6.0-M2'
}
```

In addition if you don't want to use jitpack.io then use following github package registry:

```groovy
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/vsachinv/grails-console")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
dependencies {
compile 'org.grails.plugins:grails-console:6.0-M2'
}
```

## Usage

Use a browser to navigate to the /console page of your running app, e.g. http://localhost:8080/{app-name}/console
Expand Down Expand Up @@ -117,7 +237,7 @@ Spring Security Core example:
grails.plugin.springsecurity.controllerAnnotations.staticRules = [
[pattern:"/console/**", access:['ROLE_ADMIN']],
[pattern:"/plugins/console*/**", access:['ROLE_ADMIN']], // Grails 2.x
[pattern:"/static/console/**", access:['ROLE_ADMIN']], // Grails 3.x
[pattern:"/static/console/**", access:['ROLE_ADMIN']], // Grails 3+
]
```

Expand All @@ -127,7 +247,7 @@ Another example restricting access to localhost IPs:
grails.plugin.springsecurity.controllerAnnotations.staticRules = [
[pattern:"/console/**", access:["hasRole('ROLE_ADMIN') && (hasIpAddress('127.0.0.1') || hasIpAddress('::1'))"]],
[pattern:"/plugins/console*/**", access:["hasRole('ROLE_ADMIN') && (hasIpAddress('127.0.0.1') || hasIpAddress('::1'))"]], // Grails 2.x
[pattern:"/static/console/**", access:["hasRole('ROLE_ADMIN') && (hasIpAddress('127.0.0.1') || hasIpAddress('::1'))"]], // Grails 3.x
[pattern:"/static/console/**", access:["hasRole('ROLE_ADMIN') && (hasIpAddress('127.0.0.1') || hasIpAddress('::1'))"]], // Grails 3+
]
```

Expand All @@ -137,7 +257,12 @@ grails.plugin.springsecurity.controllerAnnotations.staticRules = [
* [Burt Beckwith](https://github.com/burtbeckwith)
* [Matt Sheehan](https://github.com/sheehan)
* [Mike Hugo](https://github.com/mjhugo)
* [Kamil Dybicz](https://github.com/kdybicz)

## Development

Please see [CONTRIBUTING.md](CONTRIBUTING.md)

## Local deployment

Please see [LOCALDEPLOYMENT.md](LOCALDEPLOYMENT.md)
47 changes: 47 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
npm install

# for Grails 3

npx gulp grails3Release

cd grails3/plugin
./gradlew clean
./gradlew jar

echo
realpath build/libs/grails-console-*.jar

# for Grails 4

npx gulp grails4Release

cd grails4/plugin
./gradlew clean
./gradlew jar

echo
realpath build/libs/grails-console-*.jar


# for Grails 5

npx gulp grails5Release

cd grails5/plugin
./gradlew clean
./gradlew jar

echo
realpath build/libs/grails-console-*.jar


# for Grails 6

npx gulp grails6Release

cd grails6/plugin
./gradlew clean
./gradlew jar

echo
realpath build/libs/grails-console-*.jar
18 changes: 18 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
### v6.0-M1
* Upgrade to Grails 6.2

### v5.0-M1
* Upgrade to Grails 5.3.6

### v4.0-M1
* Upgrade for Grails 4.1.4

### v2.2.0
* Fix for Console hijacking `System.out` and breaking system logs
* Fix for `NullPointerException` when running empty script on server with `grails.databinding.convertEmptyStringsToNull` set to default value `true`
* Fix for `grails3/plugin` structure and code refactoring to match Grails v3.3+ recommendations
* Updated Handlebar Runtime to 4.7.6
* Updating most of Node project dev-dependencies
* Updating structure and format of `gulpfile.js` to match Gulp v4 recommendations
* Build with Java 8

### v2.1.1
* Fix #65 build with Java 7

Expand Down
4 changes: 3 additions & 1 deletion grails3/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.gradle
build
classes
classes

out
Loading

0 comments on commit 5572b70

Please sign in to comment.