mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
beae37a26c
Summary: Almost there ... Test Plan: ... run the build Reviewers: evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D3597
71 lines
2.3 KiB
JavaScript
71 lines
2.3 KiB
JavaScript
/* eslint global-require: 0 */
|
|
const path = require('path');
|
|
|
|
module.exports = (grunt) => {
|
|
if (!grunt.option('platform')) {
|
|
grunt.option('platform', process.platform);
|
|
}
|
|
|
|
// This allows all subsequent paths to the relative to the root of the repo
|
|
grunt.config.init({
|
|
'appDir': path.resolve('..'),
|
|
'outputDir': path.resolve('../dist'),
|
|
'appJSON': grunt.file.readJSON('../package.json'),
|
|
'source:coffeescript': [
|
|
'internal_packages/**/*.cjsx',
|
|
'internal_packages/**/*.coffee',
|
|
'dot-nylas/**/*.coffee',
|
|
'src/**/*.coffee',
|
|
'src/**/*.cjsx',
|
|
'spec/**/*.cjsx',
|
|
'spec/**/*.coffee',
|
|
'!src/**/node_modules/**/*.coffee',
|
|
'!internal_packages/**/node_modules/**/*.coffee',
|
|
],
|
|
'source:es6': [
|
|
'internal_packages/**/*.jsx',
|
|
'internal_packages/**/*.es6',
|
|
'internal_packages/**/*.es',
|
|
'dot-nylas/**/*.es6',
|
|
'dot-nylas/**/*.es',
|
|
'src/**/*.es6',
|
|
'src/**/*.es',
|
|
'src/**/*.jsx',
|
|
'src/K2/**/*.js', // K2 doesn't use ES6 extension, lint it anyway!
|
|
'spec/**/*.es6',
|
|
'spec/**/*.es',
|
|
'spec/**/*.jsx',
|
|
'!src/K2/packages/local-private/src/error-logger-extensions/*.js',
|
|
'!src/**/node_modules/**/*.es6',
|
|
'!src/**/node_modules/**/*.es',
|
|
'!src/**/node_modules/**/*.jsx',
|
|
'!src/K2/**/node_modules/**/*.js',
|
|
'!internal_packages/**/node_modules/**/*.es6',
|
|
'!internal_packages/**/node_modules/**/*.es',
|
|
'!internal_packages/**/node_modules/**/*.jsx',
|
|
],
|
|
});
|
|
|
|
grunt.loadTasks('./tasks');
|
|
grunt.file.setBase(path.resolve('..'));
|
|
|
|
// Register CI Tasks
|
|
const postBuildSteps = [];
|
|
if (grunt.option('platform') === 'win32') {
|
|
postBuildSteps.push('create-windows-installer')
|
|
} else if (grunt.option('platform') === 'darwin') {
|
|
postBuildSteps.push('create-mac-installer')
|
|
} else if (grunt.option('platform') === 'linux') {
|
|
postBuildSteps.push('create-deb-installer');
|
|
postBuildSteps.push('create-rpm-installer');
|
|
}
|
|
|
|
const {shouldPublishBuild} = require('./tasks/task-helpers')(grunt);
|
|
if (shouldPublishBuild()) {
|
|
postBuildSteps.push('publish');
|
|
}
|
|
|
|
grunt.registerTask('build', ['setup-travis-keychain', 'packager']);
|
|
grunt.registerTask('lint', ['eslint', 'lesslint', 'nylaslint', 'coffeelint', 'csslint']);
|
|
grunt.registerTask('ci', ['build'].concat(postBuildSteps));
|
|
}
|