Skip to content

Commit

Permalink
Cleanup jsx tasks
Browse files Browse the repository at this point in the history
debug and release are now identical, so there's no need to have both.
  • Loading branch information
zpao committed Feb 7, 2014
1 parent bc27325 commit b199de2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 46 deletions.
23 changes: 11 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = function(grunt) {
}
});

// Register jsx:debug and :release tasks.
// Register jsx:normal and :release tasks.
grunt.registerMultiTask('jsx', jsxTask);

// Our own browserify-based tasks to build a single JS file build
Expand All @@ -69,18 +69,18 @@ module.exports = function(grunt) {

grunt.registerTask('version-check', versionCheckTask);

grunt.registerTask('build:basic', ['jsx:debug', 'version-check', 'browserify:basic']);
grunt.registerTask('build:addons', ['jsx:debug', 'browserify:addons']);
grunt.registerTask('build:transformer', ['jsx:debug', 'browserify:transformer']);
grunt.registerTask('build:min', ['jsx:release', 'version-check', 'browserify:min']);
grunt.registerTask('build:addons-min', ['jsx:debug', 'browserify:addonsMin']);
grunt.registerTask('build:basic', ['jsx:normal', 'version-check', 'browserify:basic']);
grunt.registerTask('build:addons', ['jsx:normal', 'browserify:addons']);
grunt.registerTask('build:transformer', ['jsx:normal', 'browserify:transformer']);
grunt.registerTask('build:min', ['jsx:normal', 'version-check', 'browserify:min']);
grunt.registerTask('build:addons-min', ['jsx:normal', 'browserify:addonsMin']);
grunt.registerTask('build:withCodeCoverageLogging', [
'jsx:debug',
'jsx:normal',
'version-check',
'browserify:withCodeCoverageLogging'
]);
grunt.registerTask('build:perf', [
'jsx:release',
'jsx:normal',
'version-check',
'browserify:transformer',
'browserify:basic',
Expand All @@ -93,7 +93,7 @@ module.exports = function(grunt) {
'version-check',
'populist:test'
]);
grunt.registerTask('build:npm-react', ['version-check', 'jsx:release', 'npm-react:release']);
grunt.registerTask('build:npm-react', ['version-check', 'jsx:normal', 'npm-react:release']);

grunt.registerTask('webdriver-phantomjs', webdriverPhantomJSTask);

Expand Down Expand Up @@ -182,15 +182,14 @@ module.exports = function(grunt) {
grunt.registerTask('npm:test', ['build', 'npm:pack']);

// Optimized build task that does all of our builds. The subtasks will be run
// in order so we can take advantage of that and only run jsx:debug once.
// in order so we can take advantage of that and only run jsx:normal once.
grunt.registerTask('build', [
'delete-build-modules',
'jsx:debug',
'jsx:normal',
'version-check',
'browserify:basic',
'browserify:transformer',
'browserify:addons',
'jsx:release',
'browserify:min',
'browserify:addonsMin',
'npm-react:release',
Expand Down
49 changes: 15 additions & 34 deletions grunt/config/jsx.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
'use strict';

var grunt = require('grunt');
var _ = require('lodash');

var rootIDs = [
"React",
"ReactWithAddons"
];

var getDebugConfig = function() {
return {
"commonerConfig": grunt.config.data.pkg.commonerConfig,
"constants": {
"__VERSION__": grunt.config.data.pkg.version
}
};
};

var debug = {
var normal = {
rootIDs: rootIDs,
getConfig: getDebugConfig,
sourceDir: "src",
outputDir: "build/modules"
};

var test = {
rootIDs: rootIDs.concat([
"test/all.js",
"**/__tests__/*.js"
]),
getConfig: function() {
return {
"mocking": true,
"commonerConfig": grunt.config.data.pkg.commonerConfig,
"constants": {
"__VERSION__": grunt.config.data.pkg.version
commonerConfig: grunt.config.data.pkg.commonerConfig,
constants: {
__VERSION__: grunt.config.data.pkg.version
}
};
},
Expand All @@ -42,23 +24,22 @@ var test = {
};


var release = {
rootIDs: rootIDs,
var test = {
rootIDs: rootIDs.concat([
"test/all.js",
"**/__tests__/*.js"
]),
getConfig: function() {
return {
"commonerConfig": grunt.config.data.pkg.commonerConfig,
"constants": {
"__VERSION__": grunt.config.data.pkg.version
}
};
return _.merge({}, normal.getConfig(), {
mocking: true
});
},
sourceDir: "src",
outputDir: "build/modules"
};


module.exports = {
debug: debug,
test: test,
release: release
normal: normal,
test: test
};

0 comments on commit b199de2

Please sign in to comment.