mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-03 09:54:54 +08:00
feat(build): add nylas resources
This commit is contained in:
parent
2f1a6c3dd8
commit
1fb58d5c52
6 changed files with 54 additions and 24 deletions
|
@ -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)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit cb0e2078ba200d05984f67d93b635c824d6c337b
|
||||
Subproject commit 2c6ed69565b82a5f9bdd6f3ae675070a797f5cdd
|
34
build/tasks/add-nylas-build-resources-task.coffee
Normal file
34
build/tasks/add-nylas-build-resources-task.coffee
Normal file
|
@ -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()
|
|
@ -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...)
|
|
@ -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())
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Reference in a new issue