Skip to content

Commit

Permalink
[build] stick with grunt:task naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Aug 14, 2015
1 parent af30b58 commit afb283d
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 28 deletions.
28 changes: 14 additions & 14 deletions tasks/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@ module.exports = function (grunt) {
let { flatten } = require('lodash');

grunt.registerTask('build', flatten([
'build-getProps',
'build:getProps',
'clean:build',
'clean:target',
'downloadNodes:start',
'build:downloadNodes:start',
'copy:devSource',
'babel:build',
'build-cliIndex',
'build-installedPlugins',
'build-packageJson',
'build-readme',
'build-installNpmDeps',
'build:cliIndex',
'build:installedPlugins',
'build:packageJson',
'build:readme',
'build:installNpmDeps',
'run:optimizeBuild',
'stop:optimizeBuild',
'downloadNodes:finish',
'build:downloadNodes:finish',
'clean:testsFromModules',
'build-versionedLinks',
'build-archives',
'build:versionedLinks',
'build:archives',
!grunt.option('os-packages') ? [] : [
'build-pleaseRun',
'build-pleaseManageUser',
'build-osPackages',
'build:pleaseRun',
'build:pleaseManageUser',
'build:osPackages',
],
'build-shasums'
'build:shasums'
]));
};
2 changes: 1 addition & 1 deletion tasks/build/cliIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = function (grunt) {
var file = 'build/kibana/src/cli/index.js';
var blurb = `require('babel/register')(require('../optimize/babelOptions'));\n`;

grunt.registerTask('build-cliIndex', function () {
grunt.registerTask('build:cliIndex', function () {
var before = grunt.file.read(file);
var after = before.replace(blurb, '');

Expand Down
4 changes: 2 additions & 2 deletions tasks/build/downloadNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ module.exports = function (grunt) {
let current = null;
let start = () => current || (current = run());

grunt.registerTask('downloadNodes:start', start);
grunt.registerTask('downloadNodes:finish', function () {
grunt.registerTask('build:downloadNodes:start', start);
grunt.registerTask('build:downloadNodes:finish', function () {
start().then(() => {
grunt.log.ok(`node binaries for ${platforms.join(', ')} downloaded`);
})
Expand Down
2 changes: 1 addition & 1 deletion tasks/build/getProps.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function (grunt) {
var exec = require('child_process').execSync;
grunt.registerTask('build-getProps', function () {
grunt.registerTask('build:getProps', function () {
grunt.config.set('buildSha', String(exec('git rev-parse HEAD')).trim());
grunt.config.set('buildNum', parseFloat(String(exec('git log --format="%h" | wc -l')).trim()));
});
Expand Down
2 changes: 1 addition & 1 deletion tasks/build/installNpmDeps.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = function (grunt) {
var { execSync } = require('child_process');
var { resolve } = require('path');

grunt.registerTask('build-installNpmDeps', function () {
grunt.registerTask('build:installNpmDeps', function () {
grunt.file.mkdir('build/kibana/node_modules');

execSync('npm install --production --no-optional', {
Expand Down
2 changes: 1 addition & 1 deletion tasks/build/installedPlugins.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = function (grunt) {
grunt.registerTask('build-installedPlugins', function () {
grunt.registerTask('build:installedPlugins', function () {
grunt.file.mkdir('build/kibana/installedPlugins');
});
};
2 changes: 1 addition & 1 deletion tasks/build/linkNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = function (grunt) {
let { basename, resolve } = require('path');
let { forOwn } = require('lodash');

grunt.registerTask('build-versionedLinks', function () {
grunt.registerTask('build:versionedLinks', function () {
let buildFiles = grunt.file.expand('build/kibana/{*,.*}');
let rootDir = grunt.config.get('root');

Expand Down
2 changes: 1 addition & 1 deletion tasks/build/osPackages.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function (grunt) {
let userScriptsDir = config.get('userScriptsDir');
let servicesByName = indexBy(config.get('services'), 'id');

grunt.registerTask('build-osPackages', function () {
grunt.registerTask('build:osPackages', function () {
grunt.config.get('platforms').forEach(({ name, buildDir }) => {

let arch = /x64$/.test(name) ? 'x86_64' : 'i686';
Expand Down
2 changes: 1 addition & 1 deletion tasks/build/packageJson.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = function (grunt) {
grunt.registerTask('build-packageJson', function () {
grunt.registerTask('build:packageJson', function () {
var pkg = grunt.config.get('pkg');

grunt.file.write(
Expand Down
2 changes: 1 addition & 1 deletion tasks/build/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = function createPackages(grunt) {
}
};

grunt.registerTask('build-archives', function () {
grunt.registerTask('build:archives', function () {

all(
grunt.config.get('platforms')
Expand Down
2 changes: 1 addition & 1 deletion tasks/build/pleaseManageUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = function (grunt) {
let { resolve } = require('path');
let userScriptsDir = grunt.config.get('userScriptsDir');

grunt.registerTask('build-pleaseManageUser', function () {
grunt.registerTask('build:pleaseManageUser', function () {
grunt.file.mkdir(userScriptsDir);
execFileSync('please-manage-user', ['--output', userScriptsDir, 'kibana']);
});
Expand Down
2 changes: 1 addition & 1 deletion tasks/build/pleaserun.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var { resolve } = require('path');
var { execFileSync } = require('child_process');

module.exports = function createServices(grunt) {
grunt.registerTask('build-pleaserun', function () {
grunt.registerTask('build:pleaserun', function () {
// TODO(sissel): Detect if 'pleaserun' is found, and provide a useful error
// to the user if it is missing.

Expand Down
2 changes: 1 addition & 1 deletion tasks/build/readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ TextRenderer.prototype.heading = function (text, level, raw) {

module.exports = function (grunt) {

grunt.registerTask('build-readme', function () {
grunt.registerTask('build:readme', function () {
let transform = function (input) {
let output = input.replace(/<\!\-\- [^\-]+ \-\->/g, '\n');
output = marked(output);
Expand Down
2 changes: 1 addition & 1 deletion tasks/build/shasums.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var readdir = promisify(require('fs').readdir);
var exec = promisify(require('child_process').exec);

module.exports = function (grunt) {
grunt.registerTask('build-shasums', function () {
grunt.registerTask('build:shasums', function () {
var targetDir = grunt.config.get('target');

readdir(targetDir)
Expand Down

0 comments on commit afb283d

Please sign in to comment.