Skip to content

Commit 1c0c2f4

Browse files
committed
switch to gulp. merge build script. fix #45.
1 parent e1bca04 commit 1c0c2f4

36 files changed

+2082
-2403
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
.DS_Store
22
.idea
33
*.iml
4+
build
5+
node_modules
6+
.grunt

CONTRIBUTING.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Contributing
2+
3+
This plugin uses [Grunt](http://gruntjs.com/) to build its resources. To install the Grunt CLI run:
4+
5+
npm install -g grunt-cli
6+
7+
## Building
8+
9+
1. Change to the project's root directory.
10+
1. Install project dependencies with `npm install`.
11+
1. Build the resources with `grunt release`.
12+
13+
## Grunt tasks
14+
15+
| Task | Description |
16+
| --- | --- |
17+
| watch | Watches for file changes and updates `web-app/dist/debug`.|
18+
| test | Runs all jasmine tests. |
19+
| debug | Builds all debug resources to `web-app/dist/debug`.|
20+
| release | Builds all release resources to `web-app/dist/release`.|
21+
22+
## File structure
23+
24+
.
25+
├── grails2
26+
│ ├── app # grails2 test app
27+
│ └── plugin # grails2 plugin
28+
├── grails3
29+
│ ├── app # grails3 test app
30+
│ └── plugin # grails3 plugin
31+
├── web # shared web resources
32+
│ ├── app # coffeescript
33+
│ ├── img
34+
│ ├── spec # jasmine
35+
│ ├── styles # less
36+
│ ├── templates # handlebars templates
37+
│ └── vendor # vendor libs
38+
├── gulpfile.js
39+
└── package.json
40+
41+
## Running
42+
43+
When developing, use `grails2/app` and `grails3/app`.
44+
45+
File renamed without changes.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Add a dependency in BuildConfig.groovy:
1515
grails.project.dependency.resolution = {
1616
// ...
1717
plugins {
18-
runtime ':console:1.5.6'
18+
runtime ':console:1.5.7'
1919
// ...
2020
}
2121
}
@@ -28,7 +28,7 @@ grails.project.dependency.resolution = {
2828
Add a dependency in build.gradle
2929

3030
```groovy
31-
runtime 'org.grails.plugins:grails-console:2.0.3'
31+
runtime 'org.grails.plugins:grails-console:2.0.4'
3232
```
3333

3434
## Usage
@@ -82,7 +82,7 @@ The following configuration options are available:
8282
| Property | Description |
8383
|---|---|
8484
| `grails.plugin.console.enabled` | Whether to enable the plugin. Default is true for the development environment, false otherwise. |
85-
| `grails.plugin.console.baseUrl` | Base URL for the console controller. Default uses createLink(). |
85+
| `grails.plugin.console.baseUrl` | Base URL for the console controller. Can be a String or a List of Strings if having multiple URLs is desired. Default uses createLink(). |
8686
| `grails.plugin.console.fileStore.remote.enabled` | Whether to include the remote file store functionality. Default is true. |
8787
| `grails.plugin.console.layout` | Used to override the plugin's GSP layout. |
8888
| `grails.plugin.console.newFileText` | Text to display as a template for new files. Can be used to add frequently used imports, environment specific warnings, etc... Defaults to empty. |

grails2/plugin/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ target
33
*.zip
44
plugin.xml
55
.settings/
6-
web-app/WEB-INF/tld
6+
/web-app/
77
.idea
88
/node_modules/
99
/.grunt/

grails2/plugin/CONTRIBUTING.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

grails2/plugin/ConsoleGrailsPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import grails.converters.JSON
22
import java.lang.reflect.Method
33

44
class ConsoleGrailsPlugin {
5-
String version = '1.5.6'
5+
String version = '1.5.7'
66
String grailsVersion = '2.0 > *'
77
String title = 'Console Plugin'
88
String description = 'A web-based Groovy console for interactive runtime application management and debugging'

grails2/plugin/Gruntfile.coffee

Lines changed: 0 additions & 176 deletions
This file was deleted.

grails2/plugin/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### v1.5.7
2+
3+
* New build script
4+
* Add support for multiple base URLs (#44)
5+
16
### v1.5.6
27

38
* Add `out` binding.

grails2/plugin/grails-app/controllers/org/grails/plugins/console/ConsoleController.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class ConsoleController {
1818
}
1919

2020
def index() {
21-
String serverName = request.serverName
2221
Map model = [
2322
json: [
2423
implicitVars: [
@@ -29,7 +28,7 @@ class ConsoleController {
2928
session: 'the HTTP session',
3029
out: 'the output PrintStream'
3130
],
32-
baseUrl: getBaseUrl(serverName),
31+
baseUrl: getBaseUrl(),
3332
remoteFileStoreEnabled: isRemoteFileStoreEnabled(),
3433
groovyVersion: GroovySystem.version,
3534
grailsVersion: grailsApplication.metadata['app.grails.version']
@@ -205,9 +204,10 @@ class ConsoleController {
205204
grailsApplication.config.grails.plugin.console.fileStore.remote.enabled != false
206205
}
207206

208-
private String getBaseUrl(String serverName) {
207+
private String getBaseUrl() {
209208
def baseUrl = grailsApplication.config.grails.plugin.console.baseUrl
210209
if (baseUrl instanceof List) {
210+
String serverName = request.serverName
211211
baseUrl = baseUrl.find { String baseUrlFromConfig ->
212212
baseUrlFromConfig.contains(serverName)
213213
}

grails2/plugin/package.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

grails2/plugin/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ grails clean
77
grails compile
88

99
npm install
10-
grunt release
10+
gulp release-all
1111

1212
#grails publish-plugin --snapshot --stacktrace
1313
grails publish-plugin --stacktrace

0 commit comments

Comments
 (0)