Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bare minimum sanity check for GCC #1125

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var exec = require('child_process').exec;
var jsxTask = require('./grunt/tasks/jsx');
var browserifyTask = require('./grunt/tasks/browserify');
var closureTask = require('./grunt/tasks/closure');
var populistTask = require('./grunt/tasks/populist');
var webdriverPhantomJSTask = require('./grunt/tasks/webdriver-phantomjs');
var webdriverJasmineTasks = require('./grunt/tasks/webdriver-jasmine');
Expand Down Expand Up @@ -55,6 +56,8 @@ module.exports = function(grunt) {
// Our own browserify-based tasks to build a single JS file build
grunt.registerMultiTask('browserify', browserifyTask);

grunt.registerTask('closure', closureTask);

grunt.registerMultiTask('populist', populistTask);

grunt.registerTask('sauce-tunnel', sauceTunnelTask);
Expand All @@ -71,22 +74,24 @@ module.exports = function(grunt) {

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

grunt.registerTask('build:basic', ['jsx:normal', 'version-check', 'browserify:basic']);
grunt.registerTask('build:addons', ['jsx:normal', 'browserify:addons']);
grunt.registerTask('build:basic', ['jsx:normal', 'version-check', 'browserify:basic', 'closure']);
grunt.registerTask('build:addons', ['jsx:normal', 'browserify:addons', 'closure']);
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:min', ['jsx:normal', 'version-check', 'browserify:min', 'closure']);
grunt.registerTask('build:addons-min', ['jsx:normal', 'browserify:addonsMin', 'closure']);
grunt.registerTask('build:withCodeCoverageLogging', [
'jsx:normal',
'version-check',
'browserify:withCodeCoverageLogging'
'browserify:withCodeCoverageLogging',
'closure'
]);
grunt.registerTask('build:perf', [
'jsx:normal',
'version-check',
'browserify:transformer',
'browserify:basic',
'browserify:min',
'closure',
'download-previous-version'
]);
grunt.registerTask('build:test', [
Expand Down
14 changes: 14 additions & 0 deletions grunt/tasks/closure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var execSync = require('execSync');

var CLOSURE_CMD = 'java -jar ./vendor/closure/compiler.jar --js_output_file ./build/react.closure.js --externs ./vendor/closure/externs_react.js --compilation_level ADVANCED_OPTIMIZATIONS ./build/modules/*.js';
module.exports = function() {
var deps = JSON.parse(
execSync.exec('module-deps ./build/modules/React.js').stdout
).map(function(dep) {
return dep.id;
});

if (execSync.exec(CLOSURE_CMD).code !== 0) {
grunt.log.error('Closure compiler did not exit with status 0');
}
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"envify": "~1.2.0",
"es3ify": "~0.1.2",
"es5-shim": "~2.3.0",
"execSync": "~1.0.1-pre",
"grunt": "~0.4.2",
"grunt-cli": "~0.1.9",
"grunt-compare-size": "~0.4.0",
Expand All @@ -56,6 +57,7 @@
"jasmine-tapreporter": "~0.2.2",
"lodash": "~2.4.1",
"microtime": "~0.5.1",
"module-deps": "~1.7.0",
"optimist": "~0.6.0",
"phantomjs": "~1.9",
"platform": "~1.0.0",
Expand Down
Binary file added vendor/closure/compiler.jar
Binary file not shown.
Loading