From 70c14eb4f559ad5ae87a5d0fcc4b86614cafd1d4 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 21 Nov 2013 10:39:31 -0800 Subject: [PATCH] Move tasks to build directory --- Gruntfile.coffee => build/Gruntfile.coffee | 27 ++++++++++--------- {tasks => build}/package.json | 0 {tasks => build/tasks}/build-task.coffee | 0 {tasks => build/tasks}/clean-task.coffee | 0 {tasks => build/tasks}/codesign-task.coffee | 0 {tasks => build/tasks}/convert-theme.coffee | 0 .../tasks}/copy-info-plist-task.coffee | 0 {tasks => build/tasks}/docs-task.coffee | 0 {tasks => build/tasks}/install-task.coffee | 0 {tasks => build/tasks}/nof-task.coffee | 0 .../tasks}/prebuild-less-task.coffee | 0 .../tasks}/publish-packages.coffee | 0 .../set-development-version-task.coffee | 0 .../tasks}/set-exe-icon-task.coffee | 2 +- {tasks => build/tasks}/spec-task.coffee | 0 {tasks => build/tasks}/task-helpers.coffee | 0 script/build | 7 ++--- script/cibuild | 4 +-- 18 files changed, 22 insertions(+), 18 deletions(-) rename Gruntfile.coffee => build/Gruntfile.coffee (97%) rename {tasks => build}/package.json (100%) rename {tasks => build/tasks}/build-task.coffee (100%) rename {tasks => build/tasks}/clean-task.coffee (100%) rename {tasks => build/tasks}/codesign-task.coffee (100%) rename {tasks => build/tasks}/convert-theme.coffee (100%) rename {tasks => build/tasks}/copy-info-plist-task.coffee (100%) rename {tasks => build/tasks}/docs-task.coffee (100%) rename {tasks => build/tasks}/install-task.coffee (100%) rename {tasks => build/tasks}/nof-task.coffee (100%) rename {tasks => build/tasks}/prebuild-less-task.coffee (100%) rename {tasks => build/tasks}/publish-packages.coffee (100%) rename {tasks => build/tasks}/set-development-version-task.coffee (100%) rename {tasks => build/tasks}/set-exe-icon-task.coffee (80%) rename {tasks => build/tasks}/spec-task.coffee (100%) rename {tasks => build/tasks}/task-helpers.coffee (100%) diff --git a/Gruntfile.coffee b/build/Gruntfile.coffee similarity index 97% rename from Gruntfile.coffee rename to build/Gruntfile.coffee index c2d7bb1a9..0f9063e0f 100644 --- a/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -5,7 +5,7 @@ os = require 'os' fm = require 'json-front-matter' _ = require 'underscore-plus' -packageJson = require './package.json' +packageJson = require '../package.json' # OAuth token for atom-bot # TODO Remove once all repositories are public @@ -16,6 +16,20 @@ process.env.ATOM_ACCESS_TOKEN ?= '362295be4c5258d3f7b967bbabae662a455ca2a7' _.extend(global, require('harmony-collections')) unless global.WeakMap? module.exports = (grunt) -> + grunt.loadNpmTasks('grunt-coffeelint') + grunt.loadNpmTasks('grunt-lesslint') + grunt.loadNpmTasks('grunt-cson') + grunt.loadNpmTasks('grunt-contrib-csslint') + grunt.loadNpmTasks('grunt-contrib-coffee') + grunt.loadNpmTasks('grunt-contrib-less') + grunt.loadNpmTasks('grunt-markdown') + grunt.loadNpmTasks('grunt-shell') + grunt.loadNpmTasks('grunt-download-atom-shell') + grunt.loadTasks('tasks') + + # This allows all subsequent paths to the relative to the root of the repo + grunt.file.setBase(path.resolve('..')) + if not grunt.option('verbose') grunt.log.writeln = (args...) -> grunt.log grunt.log.write = (args...) -> grunt.log @@ -194,17 +208,6 @@ module.exports = (grunt) -> stderr: false failOnError: false - grunt.loadNpmTasks('grunt-coffeelint') - grunt.loadNpmTasks('grunt-lesslint') - grunt.loadNpmTasks('grunt-cson') - grunt.loadNpmTasks('grunt-contrib-csslint') - grunt.loadNpmTasks('grunt-contrib-coffee') - grunt.loadNpmTasks('grunt-contrib-less') - grunt.loadNpmTasks('grunt-markdown') - grunt.loadNpmTasks('grunt-download-atom-shell') - grunt.loadNpmTasks('grunt-shell') - grunt.loadTasks('tasks') - grunt.registerTask('compile', ['coffee', 'prebuild-less', 'cson']) grunt.registerTask('lint', ['coffeelint', 'csslint', 'lesslint']) grunt.registerTask('test', ['shell:kill-atom', 'run-specs']) diff --git a/tasks/package.json b/build/package.json similarity index 100% rename from tasks/package.json rename to build/package.json diff --git a/tasks/build-task.coffee b/build/tasks/build-task.coffee similarity index 100% rename from tasks/build-task.coffee rename to build/tasks/build-task.coffee diff --git a/tasks/clean-task.coffee b/build/tasks/clean-task.coffee similarity index 100% rename from tasks/clean-task.coffee rename to build/tasks/clean-task.coffee diff --git a/tasks/codesign-task.coffee b/build/tasks/codesign-task.coffee similarity index 100% rename from tasks/codesign-task.coffee rename to build/tasks/codesign-task.coffee diff --git a/tasks/convert-theme.coffee b/build/tasks/convert-theme.coffee similarity index 100% rename from tasks/convert-theme.coffee rename to build/tasks/convert-theme.coffee diff --git a/tasks/copy-info-plist-task.coffee b/build/tasks/copy-info-plist-task.coffee similarity index 100% rename from tasks/copy-info-plist-task.coffee rename to build/tasks/copy-info-plist-task.coffee diff --git a/tasks/docs-task.coffee b/build/tasks/docs-task.coffee similarity index 100% rename from tasks/docs-task.coffee rename to build/tasks/docs-task.coffee diff --git a/tasks/install-task.coffee b/build/tasks/install-task.coffee similarity index 100% rename from tasks/install-task.coffee rename to build/tasks/install-task.coffee diff --git a/tasks/nof-task.coffee b/build/tasks/nof-task.coffee similarity index 100% rename from tasks/nof-task.coffee rename to build/tasks/nof-task.coffee diff --git a/tasks/prebuild-less-task.coffee b/build/tasks/prebuild-less-task.coffee similarity index 100% rename from tasks/prebuild-less-task.coffee rename to build/tasks/prebuild-less-task.coffee diff --git a/tasks/publish-packages.coffee b/build/tasks/publish-packages.coffee similarity index 100% rename from tasks/publish-packages.coffee rename to build/tasks/publish-packages.coffee diff --git a/tasks/set-development-version-task.coffee b/build/tasks/set-development-version-task.coffee similarity index 100% rename from tasks/set-development-version-task.coffee rename to build/tasks/set-development-version-task.coffee diff --git a/tasks/set-exe-icon-task.coffee b/build/tasks/set-exe-icon-task.coffee similarity index 80% rename from tasks/set-exe-icon-task.coffee rename to build/tasks/set-exe-icon-task.coffee index 09bc2b67b..0d9e2c0f6 100644 --- a/tasks/set-exe-icon-task.coffee +++ b/build/tasks/set-exe-icon-task.coffee @@ -6,7 +6,7 @@ module.exports = (grunt) -> shellAppDir = grunt.config.get('atom.shellAppDir') shellExePath = path.join(shellAppDir, 'atom.exe') - iconPath = path.resolve(__dirname, '..', 'resources', 'win', 'atom.ico') + iconPath = path.resolve('resources', 'win', 'atom.ico') rcedit = require('rcedit') rcedit(shellExePath, {'icon': iconPath}, done) diff --git a/tasks/spec-task.coffee b/build/tasks/spec-task.coffee similarity index 100% rename from tasks/spec-task.coffee rename to build/tasks/spec-task.coffee diff --git a/tasks/task-helpers.coffee b/build/tasks/task-helpers.coffee similarity index 100% rename from tasks/task-helpers.coffee rename to build/tasks/task-helpers.coffee diff --git a/script/build b/script/build index 3a738ee84..b2a93d025 100755 --- a/script/build +++ b/script/build @@ -5,7 +5,8 @@ var path = require('path'); process.chdir(path.dirname(__dirname)); cp.safeExec('node script/bootstrap', function() { - // node_modules/.bin/grunt "$@" - var gruntPath = path.join('tasks', 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : ''); - cp.safeSpawn(gruntPath, process.argv.slice(2), process.exit); + var gruntPath = path.join('build', 'node_modules', 'grunt-cli', 'bin', 'grunt'); + var args = [gruntPath, '--gruntfile', path.resolve('build', 'Gruntfile.coffee')]; + args = args.concat(process.argv.slice(2)); + cp.safeSpawn(process.execPath, args, process.exit); }); diff --git a/script/cibuild b/script/cibuild index 4a81a8025..341d929b6 100755 --- a/script/cibuild +++ b/script/cibuild @@ -29,11 +29,11 @@ cp.safeExec.bind(global, 'node script/bootstrap', function(error) { if (error) process.exit(1); var async = require('async'); - var gruntPath = path.join('node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : ''); + var gruntPath = path.join('build' 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : ''); var tasks = [ require('rimraf').bind(global, path.join(homeDir, '.atom')), cp.safeExec.bind(global, 'git clean -dff'), - cp.safeExec.bind(global, gruntPath + ' ci --stack --no-color'), + cp.safeExec.bind(global, gruntPath + ' ci --gruntfile build/Gruntfile.coffee --stack --no-color'), ] if (process.platform === 'darwin') { tasks.push(cp.safeExec.bind(global, 'build/node_modules/.bin/coffee script/upload-release'))