Skip to content

Commit

Permalink
build updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sheehan committed May 17, 2015
1 parent 68a9a39 commit 127c962
Show file tree
Hide file tree
Showing 12 changed files with 121 additions and 102 deletions.
7 changes: 3 additions & 4 deletions README.md
Expand Up @@ -12,15 +12,15 @@ The [1.X](https://grails.org/plugin/console) version is for Grails 2, while the
Add a dependency in BuildConfig.groovy:

```groovy
runtime ':console:1.5.4'
runtime ':console:1.5.5'
```

### Grails 3

Add a dependency in build.gradle

```groovy
runtime 'org.grails.plugins:grails-console:2.0.1'
runtime 'org.grails.plugins:grails-console:2.0.2'
```

## Usage
Expand Down Expand Up @@ -76,8 +76,7 @@ The following configuration options are available:
| `grails.plugin.console.baseUrl` | Base URL for the console controller. Default uses createLink(). |
| `grails.plugin.console.fileStore.remote.enabled` | Whether to include the remote file store functionality. Default is true. |
| `grails.plugin.console.layout` | Used to override the plugin's GSP layout. |
| `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. |
| `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. |

## Security

Expand Down
2 changes: 1 addition & 1 deletion grails2/ConsoleGrailsPlugin.groovy
Expand Up @@ -2,7 +2,7 @@ import grails.converters.JSON
import java.lang.reflect.Method

class ConsoleGrailsPlugin {
String version = '1.5.5-SNAPSHOT'
String version = '1.5.5'
String grailsVersion = '2.0 > *'
String title = 'Console Plugin'
String description = 'A web-based Groovy console for interactive runtime application management and debugging'
Expand Down
79 changes: 43 additions & 36 deletions grails2/Gruntfile.coffee
Expand Up @@ -6,6 +6,29 @@ module.exports = (grunt) ->
webSrcDir = '../web'
targetDir = 'web-app/target'

vendorJs = [
'/js/libs/jquery-1.7.1.min.js'
'/jquery-ui-1.10.3/jquery-ui.min.js'
'/bootstrap/js/bootstrap.min.js'
'/js/libs/underscore-min.js'
'/js/libs/backbone-min.js'
'/js/libs/backbone.marionette.min.js'
'/js/libs/handlebars.runtime-v3.0.1.js'
'/jquery-layout/js/jquery.layout-latest.min.js'
'/js/plugins/jquery.hotkeys.js'
'/codemirror-5.2/lib/codemirror.js'
'/codemirror-5.2/mode/groovy/groovy.js'
]

vendorCss = [
'/bootstrap/css/bootstrap.min.css'
'/font-awesome-4.0.3/css/font-awesome.css'
'/codemirror-5.2/lib/codemirror.css'
'/codemirror-5.2/theme/lesser-dark.css'
'/jquery-layout/css/jquery.layout.css'
'/jquery-ui-1.10.3/jquery-ui.min.css'
]

grunt.initConfig

pkg: grunt.file.readJSON 'package.json'
Expand All @@ -28,27 +51,10 @@ module.exports = (grunt) ->
"#{releaseDir}/app.css"

vendor:
js: [
"#{vendorDir}/js/libs/jquery-1.7.1.min.js"
"#{vendorDir}/jquery-ui-1.10.3/jquery-ui.min.js"
"#{vendorDir}/bootstrap/js/bootstrap.min.js"
"#{vendorDir}/js/libs/underscore-min.js"
"#{vendorDir}/js/libs/backbone-min.js"
"#{vendorDir}/js/libs/backbone.marionette.min.js"
"#{vendorDir}/js/libs/handlebars.runtime-v3.0.1.js"
"#{vendorDir}/jquery-layout/js/jquery.layout-latest.min.js"
"#{vendorDir}/js/plugins/jquery.hotkeys.js"
"#{vendorDir}/codemirror-5.2/lib/codemirror.js"
"#{vendorDir}/codemirror-5.2/mode/groovy/groovy.js"
]
css: [
"#{vendorDir}/bootstrap/css/bootstrap.min.css"
"#{vendorDir}/font-awesome-4.0.3/css/font-awesome.css"
"#{vendorDir}/codemirror-5.2/lib/codemirror.css"
"#{vendorDir}/codemirror-5.2/theme/lesser-dark.css"
"#{vendorDir}/jquery-layout/css/jquery.layout.css"
"#{vendorDir}/jquery-ui-1.10.3/jquery-ui.min.css"
]
js: vendorJs.map (it) -> "#{debugDir}/vendor#{it}"
css:
debug: vendorCss.map (it) -> "#{debugDir}/vendor#{it}"
release: vendorCss.map (it) -> "#{releaseDir}/vendor#{it}"

concat:
js:
Expand Down Expand Up @@ -76,7 +82,7 @@ module.exports = (grunt) ->
helpers: "#{webSrcDir}/spec/*helper.js"
keepRunner: true
outfile: "#{targetDir}/spec/SpecRunner.html"
vendor: ['<%= vendor.js %>', "#{vendorDir}/js/plugins/jasmine-jquery.js"]
vendor: ['<%= vendor.js %>', "#{debugDir}/vendor/js/plugins/jasmine-jquery.js"]

coffee:
app:
Expand All @@ -99,25 +105,21 @@ module.exports = (grunt) ->
]

copy:
vendor:
expand: true,
cwd: "#{webSrcDir}/vendor"
src: '**/*'
dest: vendorDir
debug:
expand: true,
cwd: 'web-app/src/img'
src: '**/*'
dest: "#{debugDir}/img"
files: [
{expand: true, cwd: "#{webSrcDir}/img", src: '**/*', dest: "#{debugDir}/img"}
{expand: true, cwd: "#{webSrcDir}/vendor", src: '**/*', dest: "#{debugDir}/vendor"}
]
release:
files: [
{ expand: true, cwd: "#{webSrcDir}/img", src: '**/*', dest: "#{releaseDir}/img" }
{ expand: true, cwd: "#{vendorDir}", src: '**/*', dest: "#{releaseDir}/vendor" }
{ expand: true, cwd: "#{webSrcDir}/vendor", src: '**/*', dest: "#{releaseDir}/vendor" }
{ src: "#{debugDir}/app.css", dest: '<%= app.css.release %>' }
]

clean:
dist: ['web-app/dist']
debug: [debugDir]
spec: "#{targetDir}/spec/"

watch:
Expand Down Expand Up @@ -149,21 +151,26 @@ module.exports = (grunt) ->

if env is 'debug'
js = grunt.file.expand(vendor.js).concat grunt.file.expand(app.js.debug)
css = grunt.file.expand(vendor.css).concat grunt.file.expand(app.css.debug)
css = grunt.file.expand(vendor.css.debug).concat grunt.file.expand(app.css.debug)
dir = debugDir
else
js = grunt.file.expand(app.js.release)
css = grunt.file.expand(vendor.css).concat grunt.file.expand(app.css.release)
css = grunt.file.expand(vendor.css.release).concat grunt.file.expand(app.css.release)
dir = releaseDir

scriptTags = js.map (file) ->
"""<script type="text/javascript" src="${resource(file: '#{file.replace 'web-app/', ''}', plugin: 'console')}" ></script>"""

linkTags = css.map (file) ->
"""<link rel="stylesheet" media="screen" href="${resource(file: '#{file.replace 'web-app/', ''}', plugin: 'console')}" />"""

favicon = """<link rel="icon" type="image/png" href="${resource(file: '#{dir.replace 'web-app/', ''}/img/grails.logo.png', plugin: 'console')}" />"""

grunt.file.write 'grails-app/views/console/_js.gsp', scriptTags.join '\n'
grunt.file.write 'grails-app/views/console/_css.gsp', linkTags.join '\n'
grunt.file.write 'grails-app/views/console/_favicon.gsp', favicon

grunt.registerTask 'default', ['debug']
grunt.registerTask 'test', ['debug', 'clean:spec', 'coffee:spec', 'jasmine']
grunt.registerTask 'debug', ['clean:dist', 'handlebars:compile', 'coffee:app', 'copy:debug', 'copy:vendor', 'less:app', 'resources:debug']
grunt.registerTask 'release', ['debug', 'copy:release', 'concat:js', 'resources:release']
grunt.registerTask 'debug', ['clean:dist', 'handlebars:compile', 'coffee:app', 'copy:debug', 'less:app', 'resources:debug']
grunt.registerTask 'release', ['debug', 'copy:release', 'concat:js', 'resources:release', 'clean:debug']
5 changes: 5 additions & 0 deletions grails2/changelog.md
@@ -1,3 +1,8 @@
### v1.5.5

* Fix #32 add newFileText config param.
* Fix #31 disable hotkeys for layout.

### v1.5.4

* Fix #25.
Expand Down
4 changes: 2 additions & 2 deletions grails2/grails-app/views/console/index.gsp
Expand Up @@ -6,9 +6,9 @@
<head>
<title>Grails Debug Console</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link rel="icon" type="image/png" href="${resource(dir: 'src/img', file: 'grails.logo.png', plugin: 'console')}" />
<g:render template="favicon" />
<g:render template="css" />

<meta name="layout" content="${grailsApplication.config.grails.plugin.console.layout ?: 'console-plugin-layout'}"/>
</head>

Expand Down
6 changes: 1 addition & 5 deletions grails2/release.sh
Expand Up @@ -2,16 +2,12 @@ rm -rf target/release
mkdir target/release
cd target/release
git clone git@github.com:sheehan/grails-console.git
cd grails-console
cd grails-console/grails2
grails clean
grails compile

npm install
grunt release

rm -rf web-app/dist/debug/
rm -rf web-app/spec/
rm -rf web-app/src/

#grails publish-plugin --snapshot --stacktrace
grails publish-plugin --stacktrace
96 changes: 51 additions & 45 deletions grails3/Gruntfile.coffee
@@ -1,16 +1,38 @@
module.exports = (grunt) ->

staticDir = 'src/main/resources/static'
debugDir = "#{staticDir}/dist/debug"
releaseDir = "#{staticDir}/dist/release"
vendorDir = "#{staticDir}/vendor"
webSrcDir = '../web'
targetDir = 'target/web'
pkg = grunt.file.readJSON 'package.json'

staticDir = 'src/main/resources/static'
debugDir = "#{staticDir}/console-#{pkg.version}/debug"
releaseDir = "#{staticDir}/console-#{pkg.version}/release"
webSrcDir = '../web'
targetDir = 'target/web'

vendorJs = [
'/js/libs/jquery-1.7.1.min.js'
'/jquery-ui-1.10.3/jquery-ui.min.js'
'/bootstrap/js/bootstrap.min.js'
'/js/libs/underscore-min.js'
'/js/libs/backbone-min.js'
'/js/libs/backbone.marionette.min.js'
'/js/libs/handlebars.runtime-v3.0.1.js'
'/jquery-layout/js/jquery.layout-latest.min.js'
'/js/plugins/jquery.hotkeys.js'
'/codemirror-5.2/lib/codemirror.js'
'/codemirror-5.2/mode/groovy/groovy.js'
]

vendorCss = [
'/bootstrap/css/bootstrap.min.css'
'/font-awesome-4.0.3/css/font-awesome.css'
'/codemirror-5.2/lib/codemirror.css'
'/codemirror-5.2/theme/lesser-dark.css'
'/jquery-layout/css/jquery.layout.css'
'/jquery-ui-1.10.3/jquery-ui.min.css'
]

grunt.initConfig

pkg: grunt.file.readJSON 'package.json'

app:
js:
debug: [
Expand All @@ -29,27 +51,10 @@ module.exports = (grunt) ->
"#{releaseDir}/app.css"

vendor:
js: [
"#{vendorDir}/js/libs/jquery-1.7.1.min.js"
"#{vendorDir}/jquery-ui-1.10.3/jquery-ui.min.js"
"#{vendorDir}/bootstrap/js/bootstrap.min.js"
"#{vendorDir}/js/libs/underscore-min.js"
"#{vendorDir}/js/libs/backbone-min.js"
"#{vendorDir}/js/libs/backbone.marionette.min.js"
"#{vendorDir}/js/libs/handlebars.runtime-v3.0.1.js"
"#{vendorDir}/jquery-layout/js/jquery.layout-latest.min.js"
"#{vendorDir}/js/plugins/jquery.hotkeys.js"
"#{vendorDir}/codemirror-5.2/lib/codemirror.js"
"#{vendorDir}/codemirror-5.2/mode/groovy/groovy.js"
]
css: [
"#{vendorDir}/bootstrap/css/bootstrap.min.css"
"#{vendorDir}/font-awesome-4.0.3/css/font-awesome.css"
"#{vendorDir}/codemirror-5.2/lib/codemirror.css"
"#{vendorDir}/codemirror-5.2/theme/lesser-dark.css"
"#{vendorDir}/jquery-layout/css/jquery.layout.css"
"#{vendorDir}/jquery-ui-1.10.3/jquery-ui.min.css"
]
js: vendorJs.map (it) -> "#{debugDir}/vendor#{it}"
css:
debug: vendorCss.map (it) -> "#{debugDir}/vendor#{it}"
release: vendorCss.map (it) -> "#{releaseDir}/vendor#{it}"

concat:
js:
Expand Down Expand Up @@ -77,7 +82,7 @@ module.exports = (grunt) ->
helpers: "#{webSrcDir}/spec/*helper.js"
keepRunner: true
outfile: "#{targetDir}/spec/SpecRunner.html"
vendor: ['<%= vendor.js %>', "#{vendorDir}/js/plugins/jasmine-jquery.js"]
vendor: ['<%= vendor.js %>', "#{debugDir}/vendor/js/plugins/jasmine-jquery.js"]

coffee:
app:
Expand All @@ -100,25 +105,21 @@ module.exports = (grunt) ->
]

copy:
vendor:
expand: true,
cwd: "#{webSrcDir}/vendor"
src: '**/*'
dest: vendorDir
debug:
expand: true,
cwd: "#{webSrcDir}/img"
src: '**/*'
dest: "#{debugDir}/img"
files: [
{expand: true, cwd: "#{webSrcDir}/img", src: '**/*', dest: "#{debugDir}/img"}
{expand: true, cwd: "#{webSrcDir}/vendor", src: '**/*', dest: "#{debugDir}/vendor"}
]
release:
files: [
{ expand: true, cwd: "#{webSrcDir}/img", src: '**/*', dest: "#{releaseDir}/img" }
{ expand: true, cwd: "#{vendorDir}", src: '**/*', dest: "#{releaseDir}/vendor" }
{ expand: true, cwd: "#{webSrcDir}/vendor", src: '**/*', dest: "#{releaseDir}/vendor" }
{ src: "#{debugDir}/app.css", dest: '<%= app.css.release %>' }
]

clean:
dist: ["#{staticDir}/dist"]
dist: ["#{staticDir}/console*"]
debug: [debugDir]
spec: "#{targetDir}/spec/"

watch:
Expand Down Expand Up @@ -150,21 +151,26 @@ module.exports = (grunt) ->

if env is 'debug'
js = grunt.file.expand(vendor.js).concat grunt.file.expand(app.js.debug)
css = grunt.file.expand(vendor.css).concat grunt.file.expand(app.css.debug)
css = grunt.file.expand(vendor.css.debug).concat grunt.file.expand(app.css.debug)
dir = debugDir
else
js = grunt.file.expand(app.js.release)
css = grunt.file.expand(vendor.css).concat grunt.file.expand(app.css.release)
css = grunt.file.expand(vendor.css.release).concat grunt.file.expand(app.css.release)
dir = releaseDir

scriptTags = js.map (file) ->
"""<script type="text/javascript" src="${resource(file: '#{file.replace staticDir, ''}')}" ></script>"""

linkTags = css.map (file) ->
"""<link rel="stylesheet" media="screen" href="${resource(file: '#{file.replace staticDir, ''}')}" />"""

favicon = """<link rel="icon" type="image/png" href="${resource(file: '#{dir.replace staticDir, ''}/img/grails.logo.png')}" />"""

grunt.file.write 'grails-app/views/console/_js.gsp', scriptTags.join '\n'
grunt.file.write 'grails-app/views/console/_css.gsp', linkTags.join '\n'
grunt.file.write 'grails-app/views/console/_favicon.gsp', favicon

grunt.registerTask 'default', ['debug']
grunt.registerTask 'test', ['debug', 'clean:spec', 'coffee:spec', 'jasmine']
grunt.registerTask 'debug', ['clean:dist', 'handlebars:compile', 'coffee:app', 'copy:debug', 'copy:vendor', 'less:app', 'resources:debug']
grunt.registerTask 'release', ['debug', 'copy:release', 'concat:js', 'resources:release']
grunt.registerTask 'debug', ['clean:dist', 'handlebars:compile', 'coffee:app', 'copy:debug', 'less:app', 'resources:debug']
grunt.registerTask 'release', ['debug', 'copy:release', 'concat:js', 'resources:release', 'clean:debug']
2 changes: 1 addition & 1 deletion grails3/build.gradle
Expand Up @@ -16,7 +16,7 @@ plugins {
id "com.jfrog.bintray" version "1.1"
}

version "2.0.1"
version "2.0.2"
group "org.grails.plugins"

apply plugin: 'maven-publish'
Expand Down
9 changes: 9 additions & 0 deletions grails3/changelog.md
@@ -1,3 +1,12 @@
### v2.0.2

* Fix #32 add newFileText config param.
* Fix #31 disable hotkeys for layout.

### v2.0.1

* Fix font-awesome resources.

### v2.0.0

* Update for Grails 3.
Expand Down
2 changes: 1 addition & 1 deletion grails3/grails-app/views/console/index.gsp
Expand Up @@ -6,7 +6,7 @@
<head>
<title>Grails Debug Console</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link rel="icon" type="image/png" href="${resource(dir: 'src/img', file: 'grails.logo.png', plugin: 'console')}" />
<g:render template="favicon" />
<g:render template="css" />

<meta name="layout" content="${grailsApplication.config.grails.plugin.console.layout ?: 'console-plugin-layout'}"/>
Expand Down

0 comments on commit 127c962

Please sign in to comment.