diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index de6240965..990e04ddb 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -354,11 +354,27 @@ module.exports = (grunt) -> stderr: false failOnError: false - grunt.registerTask('compile', ['coffee', 'cjsx', 'babel', 'prebuild-less', 'cson', 'peg']) - grunt.registerTask('lint', ['coffeelint', 'csslint', 'lesslint', 'nylaslint', 'eslint']) + grunt.registerTask('compile', + ['coffee', 'cjsx', 'babel', 'prebuild-less', 'cson', 'peg']) + + grunt.registerTask('lint', + ['coffeelint', 'csslint', 'lesslint', 'nylaslint', 'eslint']) + grunt.registerTask('test', ['shell:kill-n1', 'run-unit-tests']) + grunt.registerTask('docs', ['build-docs', 'render-docs']) + buildTasks = [ + 'add-nylas-build-resources', + 'copy-files-for-build', + 'compile', + 'generate-license:save', + 'generate-module-cache', + 'compile-packages-slug'] + buildTasks.push('copy-info-plist') if process.platform is 'darwin' + buildTasks.push('set-exe-icon') if process.platform is 'win32' + grunt.registerTask('build', buildTasks) + ciTasks = ['output-disk-space', 'download-electron', 'build'] ciTasks.push('dump-symbols') if process.platform isnt 'win32' ciTasks.push('set-version', 'lint', 'generate-asar') @@ -374,11 +390,3 @@ module.exports = (grunt) -> ciTasks.push('publish-nylas-build') grunt.registerTask('ci', ciTasks) - - defaultTasks = ['download-electron', 'build', 'set-version', 'generate-asar'] - # We don't run `install` on linux because you need to run `sudo`. - # See docs/build-instructions/linux.md - # `sudo script/grunt install` - defaultTasks.push 'mkdmg' if process.platform is 'darwin' - defaultTasks.push 'install' unless process.platform is 'linux' - grunt.registerTask('default', defaultTasks) diff --git a/build/resources/nylas b/build/resources/nylas index cb0e2078b..2c6ed6956 160000 --- a/build/resources/nylas +++ b/build/resources/nylas @@ -1 +1 @@ -Subproject commit cb0e2078ba200d05984f67d93b635c824d6c337b +Subproject commit 2c6ed69565b82a5f9bdd6f3ae675070a797f5cdd diff --git a/build/tasks/add-nylas-build-resources-task.coffee b/build/tasks/add-nylas-build-resources-task.coffee new file mode 100644 index 000000000..e7422b7df --- /dev/null +++ b/build/tasks/add-nylas-build-resources-task.coffee @@ -0,0 +1,34 @@ +fs = require 'fs-plus' +path = require 'path' + +module.exports = (grunt) -> + {cp, mkdir, rm} = require('./task-helpers')(grunt) + rootDir = path.resolve(path.join('resources', 'nylas')) + + copyArcFiles = -> + cp path.join(rootDir, 'arc-N1', '.arcconfig'), '.arcconfig' + cp path.join(rootDir, 'arc-N1', '.arclint'), '.arclint' + cp path.join(rootDir, 'arc-N1', 'arclib'), 'arclib' + + copySourceExtensions = -> + cp path.join(rootDir, 'src'), 'src' + + linkPlugins = -> + for plugin in fs.readdirSync(path.join(rootDir, 'packages')) + from = path.join(rootDir, 'packages', plugin) + to = path.join(path.resolve('internal_packages'), plugin) + if not fs.existsSync(to) + grunt.log.writeln "Adding '#{plugin}' to internal_packages" + fs.symlinkSync(from, to, 'dir') + + desc = 'Adds in proprietary Nylas packages, fonts, and sounds to N1' + grunt.registerTask 'add-nylas-build-resources', desc, -> + canaryFileExists = fs.existsSync(path.join(rootDir, "README.md")) + if not canaryFileExists + grunt.log.writeln "No extra Nylas resources added" + return + else + grunt.log.writeln "Found proprietary Nylas plugins" + copyArcFiles() + copySourceExtensions() + linkPlugins() diff --git a/build/tasks/build-task.coffee b/build/tasks/copy-files-for-build-task.coffee similarity index 96% rename from build/tasks/build-task.coffee rename to build/tasks/copy-files-for-build-task.coffee index 2c1405c1b..8a4612a16 100644 --- a/build/tasks/build-task.coffee +++ b/build/tasks/copy-files-for-build-task.coffee @@ -11,7 +11,7 @@ module.exports = (grunt) -> else return '' - grunt.registerTask 'build', 'Build the application', -> + grunt.registerTask 'copy-files-for-build', 'Copy files for build', -> shellAppDir = grunt.config.get('nylasGruntConfig.shellAppDir') buildDir = grunt.config.get('nylasGruntConfig.buildDir') appDir = grunt.config.get('nylasGruntConfig.appDir') @@ -188,8 +188,3 @@ module.exports = (grunt) -> if process.platform is 'linux' cp path.join('build', 'resources', 'linux', 'icons'), path.join(buildDir, 'icons') - - dependencies = ['compile', 'generate-license:save', 'generate-module-cache', 'compile-packages-slug'] - dependencies.push('copy-info-plist') if process.platform is 'darwin' - dependencies.push('set-exe-icon') if process.platform is 'win32' - grunt.task.run(dependencies...) diff --git a/build/tasks/nof-task.coffee b/build/tasks/nof-task.coffee deleted file mode 100644 index 6eb7623dd..000000000 --- a/build/tasks/nof-task.coffee +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = (grunt) -> - {spawn} = require('./task-helpers')(grunt) - - grunt.registerTask 'nof', 'Un-focus all specs', -> - nof = require.resolve('.bin/nof') - spawn({cmd: nof, args: ['spec']}, @async()) diff --git a/package.json b/package.json index 2a8aa9e12..d13dd9660 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,6 @@ "source-map-support": "^0.3.2", "space-pen": "3.8.2", "spellchecker": "^3.1.2", - "sqlite3": "https://github.com/mapbox/node-sqlite3/archive/v3.1.1.tar.gz", "temp": "^0.8", "theorist": "^1.0", "underscore": "^1.8",