Precompile pegjs parsers

This commit is contained in:
Kevin Sawicki 2014-01-10 11:32:40 -08:00
parent 8cb565ad2a
commit c39d8d9aa7
2 changed files with 14 additions and 2 deletions

View File

@ -25,6 +25,7 @@ module.exports = (grunt) ->
grunt.loadNpmTasks('grunt-markdown')
grunt.loadNpmTasks('grunt-shell')
grunt.loadNpmTasks('grunt-download-atom-shell')
grunt.loadNpmTasks('grunt-peg')
grunt.loadTasks('tasks')
# This allows all subsequent paths to the relative to the root of the repo
@ -102,6 +103,13 @@ module.exports = (grunt) ->
dest: appDir
ext: '.json'
pegConfig =
glob_to_multiple:
expand: true
src: ['src/**/*.pegjs']
dest: appDir
ext: '.js'
for child in fs.readdirSync('node_modules') when child isnt '.bin'
directory = path.join('node_modules', child)
{engines, theme} = grunt.file.readJSON(path.join(directory, 'package.json'))
@ -110,6 +118,7 @@ module.exports = (grunt) ->
lessConfig.glob_to_multiple.src.push("#{directory}/**/*.less")
prebuildLessConfig.src.push("#{directory}/**/*.less") unless theme
csonConfig.glob_to_multiple.src.push("#{directory}/**/*.cson")
pegConfig.glob_to_multiple.src.push("#{directory}/**/*.pegjs")
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
@ -124,6 +133,8 @@ module.exports = (grunt) ->
cson: csonConfig
peg: pegConfig
coffeelint:
options:
no_empty_param_list:
@ -207,7 +218,7 @@ module.exports = (grunt) ->
stderr: false
failOnError: false
grunt.registerTask('compile', ['coffee', 'prebuild-less', 'cson'])
grunt.registerTask('compile', ['coffee', 'prebuild-less', 'cson', 'peg'])
grunt.registerTask('lint', ['coffeelint', 'csslint', 'lesslint'])
grunt.registerTask('test', ['shell:kill-atom', 'run-specs'])
grunt.registerTask('ci', ['output-disk-space', 'download-atom-shell', 'build', 'set-development-version', 'lint', 'test', 'publish-build'])

View File

@ -28,6 +28,7 @@
"request": "~2.27.0",
"rimraf": "~2.2.2",
"unzip": "~0.1.9",
"walkdir": "0.0.7"
"walkdir": "0.0.7",
"grunt-peg": "~1.1.0"
}
}