commit
554b65f848
@ -0,0 +1,24 @@ |
||||
app/assets/javascripts/raphael.js |
||||
app/assets/javascripts/raphael-min.js |
||||
app/assets/javascripts/date-de-DE.js |
||||
app/assets/javascripts/date-en-US.js |
||||
app/assets/javascripts/jstoolbar/**/* |
||||
app/assets/javascripts/jquery_noconflict.js |
||||
app/assets/javascripts/pages/**/* |
||||
app/assets/javascripts/project/**/* |
||||
app/assets/javascripts/jquery.menu_expand.js |
||||
app/assets/javascripts/jquery-ui-i18n.js |
||||
|
||||
#we sould fix this ones |
||||
app/assets/javascripts/select_list_move.js |
||||
app/assets/javascripts/context_menu.js |
||||
app/assets/javascripts/breadcrumb.js |
||||
app/assets/javascripts/keyboard_shortcuts.js |
||||
app/assets/javascripts/openproject.js |
||||
app/assets/javascripts/top-shelf.js |
||||
app/assets/javascripts/top_menu.js |
||||
app/assets/javascripts/findDomElement.js |
||||
app/assets/javascripts/application.js |
||||
app/assets/javascripts/action_menu.js |
||||
app/assets/javascripts/accessibility.js |
||||
app/assets/javascripts/repository_navigation.js |
@ -0,0 +1,100 @@ |
||||
module.exports = function(grunt) { |
||||
|
||||
var jsPath = "app/assets/javascripts/"; |
||||
var testSource = "mocha/index.html"; |
||||
// Project configuration.
|
||||
grunt.initConfig({ |
||||
pkg: grunt.file.readJSON('package.json'), |
||||
jshint: { |
||||
all: { |
||||
files: { |
||||
src: [jsPath] |
||||
} |
||||
} |
||||
}, |
||||
mocha_phantomjs: { |
||||
all: [testSource], |
||||
small: { |
||||
src:[testSource], |
||||
options: { |
||||
reporter: "dot" |
||||
} |
||||
}, |
||||
cov: { |
||||
src:[testSource], |
||||
options: { |
||||
output: "coverage.json", |
||||
reporter: "json-cov" |
||||
} |
||||
}, |
||||
jenkins: { |
||||
src:[testSource], |
||||
options: { |
||||
reporter: "XUnit" |
||||
} |
||||
} |
||||
}, |
||||
jscoverage: { |
||||
options: { |
||||
inputDirectory: 'app/assets/javascripts/', |
||||
outputDirectory: 'app/assets/javascripts_cov/' |
||||
} |
||||
}, |
||||
watch: { |
||||
scripts: { |
||||
files: [jsPath] , |
||||
tasks: ['jshint', 'mocha_phantomjs:small'], |
||||
options: { |
||||
spawn: false, |
||||
}, |
||||
}, |
||||
}, |
||||
}); |
||||
|
||||
grunt.loadNpmTasks("grunt-jscoverage"); |
||||
grunt.loadNpmTasks('grunt-contrib-jshint'); |
||||
grunt.loadNpmTasks('grunt-contrib-watch'); |
||||
grunt.loadNpmTasks('grunt-mocha-phantomjs'); |
||||
|
||||
// Default task(s).
|
||||
grunt.registerTask('default', ['jshint']); |
||||
|
||||
var tempPath = "app/assets/javascripts_temp/"; |
||||
var covPath = "app/assets/javascripts_cov/"; |
||||
|
||||
grunt.registerTask('moveFiles', 'switch directories for coverage-enabled files and normal files', function () { |
||||
var fs = require("fs"); |
||||
fs.renameSync(jsPath, tempPath); |
||||
fs.renameSync(covPath, jsPath); |
||||
|
||||
|
||||
fs.renameSync(tempPath + "date-en-US.js", jsPath + "date-en-US.js"); |
||||
}); |
||||
|
||||
grunt.registerTask('cleanUpCoverage', 'undo moveFiles', function () { |
||||
var done = this.async(); |
||||
|
||||
var fs = require("fs"); |
||||
if (fs.existsSync(tempPath)) { |
||||
fs.renameSync(jsPath, covPath); |
||||
fs.renameSync(tempPath, jsPath); |
||||
} |
||||
|
||||
if (fs.existsSync("coverage.json")) { |
||||
fs.unlinkSync("coverage.json"); |
||||
} |
||||
|
||||
rmdir = require("rimraf"); |
||||
rmdir(covPath, function (e) { |
||||
done(e); |
||||
}); |
||||
}); |
||||
|
||||
grunt.registerTask('jsonCov2Html', 'convert coverage to html', function () { |
||||
var exec = require("exec"); |
||||
exec("cat coverage.json | node_modules/json2htmlcov/bin/json2htmlcov > coverage.html"); |
||||
}); |
||||
|
||||
grunt.registerTask('coverage', ['jscoverage', 'moveFiles', 'mocha_phantomjs:cov', 'jsonCov2Html', 'cleanUpCoverage']); |
||||
|
||||
}; |
@ -0,0 +1,16 @@ |
||||
{ |
||||
"name": "OpenProject", |
||||
"version": "0.1.0", |
||||
"devDependencies": { |
||||
"grunt": "~0.4.2", |
||||
"grunt-contrib-jshint": "~0.8.0", |
||||
"mocha-phantomjs": "~3.1.6", |
||||
"phantomjs": "~1.9.2", |
||||
"grunt-contrib-watch": "~0.5.3", |
||||
"grunt-mocha-phantomjs": "~0.3.2", |
||||
"grunt-jscoverage": "0.0.3", |
||||
"rimraf": "~2.2.5", |
||||
"json2htmlcov": "~0.1.1", |
||||
"exec": "0.0.6" |
||||
} |
||||
} |
Loading…
Reference in new issue