From c39d8d9aa711a37994fc60090594096f81eb0fab Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 10 Jan 2014 11:32:40 -0800 Subject: [PATCH] Precompile pegjs parsers --- build/Gruntfile.coffee | 13 ++++++++++++- build/package.json | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index 7833ac0ac..85edc9c49 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -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']) diff --git a/build/package.json b/build/package.json index 221dc69c2..1f74aaf3c 100644 --- a/build/package.json +++ b/build/package.json @@ -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" } }