Skip to content

Commit 5572b70

Browse files
authored
Merge pull request #1 from vsachinv/6.x-upgrade
Upgrade grails console plugin to Grails 6.x
2 parents 122f3bf + e893a96 commit 5572b70

File tree

397 files changed

+127385
-417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

397 files changed

+127385
-417
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
6+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
7+
8+
name: Gradle Package
9+
10+
on:
11+
release:
12+
types: [created]
13+
14+
jobs:
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Setup up node
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: '20.5.1'
28+
- run: npm install
29+
- run: npm install --global gulp-cli
30+
- run: npm gulp grails5Release
31+
- name: Set up JDK 11
32+
uses: actions/setup-java@v3
33+
with:
34+
java-version: '11'
35+
distribution: 'zulu'
36+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
37+
settings-path: ${{ github.workspace }} # location for the settings.xml file
38+
- name: Setup Gradle
39+
uses: gradle/gradle-build-action@v2
40+
- name: Run build with Gradle Wrapper
41+
run: ./gradlew build
42+
working-directory: grails6/plugin
43+
- name: Publish to GitHub Packages
44+
run: ./gradlew publishMavenJarPublicationToGitHubPackagesRepository
45+
working-directory: grails6/plugin
46+
env:
47+
GITHUB_USERNAME: ${{ github.actor }}
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ This plugin uses [Gulp](http://gulpjs.com/) to build its resources.
66

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

11-
## Gulp tasks
11+
## NPM tasks
1212

1313
| Task | Description |
1414
| --- | --- |

LOCALDEPLOYMENT.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## Local Deployment
2+
3+
This page is meant for people not willing to wait for an official plugin release.
4+
5+
### Build
6+
7+
```shell
8+
npm run grails3:release
9+
10+
cd grails3/plugin
11+
12+
./gradlew clean
13+
./gradlew build
14+
```
15+
16+
### Public local
17+
18+
Steps to use new version locally:
19+
* Add mavenLocal() as a repository location in the main build.gradle
20+
* Make sure mavenLocal() is in the first position of the list.
21+
* Make sure you are using the correct version of your library.
22+
23+
```
24+
buildscript {
25+
repositories {
26+
mavenLocal()
27+
...
28+
```
29+
30+
Now, every time you change a line in the Library you need to execute within library project path, the following gradle command:
31+
32+
```shell
33+
./gradlew build publishToMavenLocal
34+
```
35+
36+
### Publish to S3
37+
38+
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).

README.md

Lines changed: 128 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ The [1.X](https://grails.org/plugin/console) version is for Grails 2.
99

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

12-
The [2.1.X](http://plugins.grails.org/plugin/sheehan/console) version is for Grails 3.3+.
12+
The [2.X.X](http://plugins.grails.org/plugin/sheehan/console) version is for Grails 3.3+.
13+
14+
The [4.X.X](http://plugins.grails.org/plugin/sheehan/console) version is for Grails 4+.
15+
16+
The [5.X.X](http://plugins.grails.org/plugin/sheehan/console) version is for Grails 5+.
1317

1418
### Grails 2
1519

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

44+
For upgraded handler version use below version.
45+
46+
```groovy
47+
repositories {
48+
maven { url "https://jitpack.io" }
49+
}
50+
51+
dependencies {
52+
compile 'com.github.vsachinv:grails-console:2.2.0'
53+
}
54+
```
55+
56+
57+
### Grails 4+
58+
59+
Add a dependency in build.gradle
60+
61+
```groovy
62+
repositories {
63+
maven { url "https://jitpack.io" }
64+
}
65+
66+
dependencies {
67+
compile 'com.github.vsachinv:grails-console:4.0-M1'
68+
}
69+
```
70+
71+
In addition if you don't want to use jitpack.io then use following github package registry:
72+
73+
```groovy
74+
repositories {
75+
maven {
76+
name = "GitHubPackages"
77+
url = uri("https://maven.pkg.github.com/vsachinv/grails-console")
78+
credentials {
79+
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
80+
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
81+
}
82+
}
83+
}
84+
85+
dependencies {
86+
compile 'org.grails.plugins:grails-console:4.0-M1'
87+
}
88+
89+
```
90+
91+
### Grails 5+
92+
93+
Add a dependency in build.gradle
94+
95+
```groovy
96+
repositories {
97+
maven { url "https://jitpack.io" }
98+
}
99+
100+
dependencies {
101+
compile 'com.github.vsachinv:grails-console:5.0-M1'
102+
}
103+
```
104+
105+
In addition if you don't want to use jitpack.io then use following github package registry:
106+
107+
```groovy
108+
repositories {
109+
maven {
110+
name = "GitHubPackages"
111+
url = uri("https://maven.pkg.github.com/vsachinv/grails-console")
112+
credentials {
113+
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
114+
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
115+
}
116+
}
117+
}
118+
119+
dependencies {
120+
compile 'org.grails.plugins:grails-console:5.0-M1'
121+
}
122+
123+
```
124+
125+
126+
### Grails 6+
127+
128+
Add a dependency in build.gradle
129+
130+
```groovy
131+
repositories {
132+
maven { url "https://jitpack.io" }
133+
}
134+
135+
dependencies {
136+
compile 'com.github.vsachinv:grails-console:6.0-M2'
137+
}
138+
```
139+
140+
In addition if you don't want to use jitpack.io then use following github package registry:
141+
142+
```groovy
143+
repositories {
144+
maven {
145+
name = "GitHubPackages"
146+
url = uri("https://maven.pkg.github.com/vsachinv/grails-console")
147+
credentials {
148+
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
149+
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
150+
}
151+
}
152+
}
153+
154+
dependencies {
155+
compile 'org.grails.plugins:grails-console:6.0-M2'
156+
}
157+
158+
```
159+
40160
## Usage
41161

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

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

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

141262
## Development
142263

143264
Please see [CONTRIBUTING.md](CONTRIBUTING.md)
265+
266+
## Local deployment
267+
268+
Please see [LOCALDEPLOYMENT.md](LOCALDEPLOYMENT.md)

build.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
npm install
2+
3+
# for Grails 3
4+
5+
npx gulp grails3Release
6+
7+
cd grails3/plugin
8+
./gradlew clean
9+
./gradlew jar
10+
11+
echo
12+
realpath build/libs/grails-console-*.jar
13+
14+
# for Grails 4
15+
16+
npx gulp grails4Release
17+
18+
cd grails4/plugin
19+
./gradlew clean
20+
./gradlew jar
21+
22+
echo
23+
realpath build/libs/grails-console-*.jar
24+
25+
26+
# for Grails 5
27+
28+
npx gulp grails5Release
29+
30+
cd grails5/plugin
31+
./gradlew clean
32+
./gradlew jar
33+
34+
echo
35+
realpath build/libs/grails-console-*.jar
36+
37+
38+
# for Grails 6
39+
40+
npx gulp grails6Release
41+
42+
cd grails6/plugin
43+
./gradlew clean
44+
./gradlew jar
45+
46+
echo
47+
realpath build/libs/grails-console-*.jar

changelog.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
### v6.0-M1
2+
* Upgrade to Grails 6.2
3+
4+
### v5.0-M1
5+
* Upgrade to Grails 5.3.6
6+
7+
### v4.0-M1
8+
* Upgrade for Grails 4.1.4
9+
10+
### v2.2.0
11+
* Fix for Console hijacking `System.out` and breaking system logs
12+
* Fix for `NullPointerException` when running empty script on server with `grails.databinding.convertEmptyStringsToNull` set to default value `true`
13+
* Fix for `grails3/plugin` structure and code refactoring to match Grails v3.3+ recommendations
14+
* Updated Handlebar Runtime to 4.7.6
15+
* Updating most of Node project dev-dependencies
16+
* Updating structure and format of `gulpfile.js` to match Gulp v4 recommendations
17+
* Build with Java 8
18+
119
### v2.1.1
220
* Fix #65 build with Java 7
321

grails3/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.gradle
22
build
3-
classes
3+
classes
4+
5+
out

0 commit comments

Comments
 (0)