This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resource-editor.git
commit 713b45cdbba0a6b6cf91463ffeddebe7d0e1a5bc Author: Sandro Boehme <[email protected]> AuthorDate: Sun Mar 29 12:57:02 2015 +0000 SLING-4462 Resource Editor: o removed 'grunt-contrib-jasmine' as its phantomjs configuration is broken. See https://github.com/gruntjs/grunt-contrib-jasmine/issues/156 karma-jasmine via phantomjs is equivalent and good. o configured the env var 'PHANTOMJS_BIN' for the 'karma-phantomjs-launcher' o extracted the static content folder to a variable in the gruntfile o separated the Karma task in a desktop_build target with Firefox and Chrome that can be triggered manually and into a target that will be used be default in the build git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1669906 13f79535-47bb-0310-9956-ffa450edef68 --- frontend/Gruntfile.js | 67 +++++++++++++++++++++------------------------------ frontend/package.json | 5 ++-- pom.xml | 3 +++ 3 files changed, 32 insertions(+), 43 deletions(-) diff --git a/frontend/Gruntfile.js b/frontend/Gruntfile.js index d7db9e6..c2e1aea 100644 --- a/frontend/Gruntfile.js +++ b/frontend/Gruntfile.js @@ -1,5 +1,13 @@ module.exports = function(grunt) { + + var staticContentFolder = '../src/main/resources/SLING-INF/libs/sling/resource-editor-static-content'; + grunt.initConfig({ + env : { + build : { + PHANTOMJS_BIN : 'node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs', + } + }, less: { compileCore: { options: { @@ -7,10 +15,10 @@ module.exports = function(grunt) { sourceMap: true, outputSourceFiles: true, sourceMapURL: 'bootstrap.css.map', - sourceMapFilename: '../src/main/resources/SLING-INF/libs/sling/resource-editor-static-content/css/bootstrap.css.map' + sourceMapFilename: staticContentFolder+'/css/bootstrap.css.map' }, src: '../src/main/less/reseditor.less', - dest: '../src/main/resources/SLING-INF/libs/sling/resource-editor-static-content/css/bootstrap.css' + dest: staticContentFolder+'/css/bootstrap.css' } }, watch: { @@ -33,7 +41,7 @@ module.exports = function(grunt) { 'bootbox/bootbox.min.js', 'jstree/dist/jstree.min.js' ], // Actual pattern(s) to match. - dest: '../src/main/resources/SLING-INF/libs/sling/resource-editor-static-content/js/3rd_party', // Destination path prefix. + dest: staticContentFolder+'/js/3rd_party', // Destination path prefix. flatten: true }, ], @@ -48,49 +56,31 @@ module.exports = function(grunt) { 'select2/select2.png', 'animate.css/animate.min.css', ], // Actual pattern(s) to match. - dest: '../src/main/resources/SLING-INF/libs/sling/resource-editor-static-content/css/3rd_party', // Destination path prefix. + dest: staticContentFolder+'/css/3rd_party', // Destination path prefix. flatten: true }, ], } }, - jasmine: { - main: { - src: ['../src/main/resources/SLING-INF/libs/sling/resource-editor-static-content/js/jquery.min.js', - '../src/main/resources/SLING-INF/libs/sling/resource-editor-static-content/js/**/*.js'], - options: { - specs: '../src/test/javascript/spec/*spec.js', - helpers: '../src/test/javascript/spec/*Helper.js', - version: '2.2.1', - summary: true - } - } - }, karma: { options: { runnerPort: 9999, singleRun: true, - browsers: ['PhantomJS'], - plugins : ['karma-jasmine', 'karma-phantomjs-launcher'], - frameworks: ['jasmine'] - }, - build: { + browsers: ['Chrome', 'Firefox', 'PhantomJS'], + plugins : ['karma-jasmine', 'karma-phantomjs-launcher', 'karma-chrome-launcher', 'karma-firefox-launcher', 'karma-ie-launcher'], + frameworks: ['jasmine'], + files: ['../src/test/javascript/spec/*spec.js', + staticContentFolder+'/js/3rd_party/jquery.min.js', + staticContentFolder+'/js/**/*.js' + ] + }, + desktop_build: { singleRun: true, - files: [ - { src: ['../src/main/resources/SLING-INF/libs/sling/resource-editor-static-content/js/3rd_party/jquery.min.js']}, - { src: ['../src/test/javascript/spec/*spec.js']}, - { src: ['../src/main/resources/SLING-INF/libs/sling/resource-editor-static-content/js/**/*.js']} - ] + browsers: ['Chrome', 'Firefox'] }, - local_build: { + build: { singleRun: true, - browsers: ['Chrome', 'Firefox', 'PhantomJS'], - plugins : ['karma-jasmine', 'karma-phantomjs-launcher', 'karma-chrome-launcher', 'karma-firefox-launcher', 'karma-ie-launcher'], - files: [ - { src: ['../src/test/javascript/spec/*spec.js']}, - { src: ['../src/main/resources/SLING-INF/libs/sling/resource-editor-static-content/js/3rd_party/jquery.min.js']}, - { src: ['../src/main/resources/SLING-INF/libs/sling/resource-editor-static-content/js/**/*.js']} - ] + browsers: ['PhantomJS'] }, watch: { reporters: 'dots', @@ -101,9 +91,6 @@ module.exports = function(grunt) { }, webdriver: { options: { -// desiredCapabilities: { -// browserName: 'chrome' -// } }, chrome: { tests: ['../src/test/javascript/e2e/spec/**/*spec.js'], @@ -129,11 +116,11 @@ module.exports = function(grunt) { // These plugins provide necessary tasks. require('load-grunt-tasks')(grunt, { scope: 'devDependencies' }); -// grunt.registerTask('build', ['less', 'copy', 'jasmine', 'karma:build']); - grunt.registerTask('build', ['less', 'copy', 'karma:build']); + grunt.registerTask('setup', ['env:build']); + grunt.registerTask('build', ['setup', 'less', 'copy', 'karma:build']); grunt.registerTask('default', ['build']); - grunt.registerTask('local_build', ['less', 'copy', 'karma:local_build', 'webdriver:chrome', 'webdriver:firefox', 'build']); + grunt.registerTask('desktop_build', ['setup', 'less', 'copy', 'karma:desktop_build', 'webdriver:chrome', 'webdriver:firefox']); }; \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index d537f1f..eddceae 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -17,14 +17,13 @@ "grunt": "0.4.5", "load-grunt-tasks": "2.0.0", "grunt-cli": "0.1.13", + "grunt-env": "0.4.4", "grunt-contrib-less": "1.0.0", "grunt-contrib-copy": "0.8.0", "grunt-contrib-watch": "0.6.1", - "jasmine":"2.2.1", - "grunt-contrib-jasmine":"0.8.2", "grunt-karma": "0.10.1", - "karma-phantomjs-launcher": "0.1.2", "karma-jasmine": "0.3.5", + "karma-phantomjs-launcher": "~0.1.4", "karma-chrome-launcher": "0.1.7", "karma-firefox-launcher": "0.1.4", "karma-ie-launcher": "0.1.5", diff --git a/pom.xml b/pom.xml index fc59a58..1b5e409 100644 --- a/pom.xml +++ b/pom.xml @@ -35,6 +35,9 @@ <resource> <directory>src/main/resources</directory> </resource> + <resource> + <directory>src/test/javascript</directory> + </resource> </resources> <plugins> <plugin> -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
