Commit 1cda1120 authored by Mike Sherov's avatar Mike Sherov Committed by Timmy Willison

Remove the Makefile and replace the submodule update with a grunt task. Thanks...

Remove the Makefile and replace the submodule update with a grunt task. Thanks to @ryanneufeld. Closes gh-953.
parent 077989e8
all: update_submodules
submoduleclean: clean
@@echo "Removing submodules"
@@rm -rf test/qunit src/sizzle
# change pointers for submodules and update them to what is specified in jQuery
# --merge doesn't work when doing an initial clone, thus test if we have non-existing
# submodules, then do an real update
update_submodules:
@@if [ -d .git ]; then \
if git submodule status | grep -q -E '^-'; then \
git submodule update --init --recursive; \
else \
git submodule update --init --recursive --merge; \
fi; \
fi;
# update the submodules to the latest at the most logical branch
pull_submodules:
@@git submodule foreach "git pull \$$(git config remote.origin.url)"
#@@git submodule summary
.PHONY: all submoduleclean update_submodules pull_submodules
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
/*jshint node: true */ /*jshint node: true */
/*global config:true, task:true, process:true*/ /*global config:true, task:true, process:true*/
var child_process = require("child_process");
module.exports = function( grunt ) { module.exports = function( grunt ) {
// readOptionalJSON // readOptionalJSON
...@@ -379,22 +382,29 @@ module.exports = function( grunt ) { ...@@ -379,22 +382,29 @@ module.exports = function( grunt ) {
}); });
grunt.registerTask( "submodules", function() { grunt.registerTask( "submodules", function() {
var done = this.async(); var done = this.async(),
// change pointers for submodules and update them to what is specified in jQuery
// --merge doesn't work when doing an initial clone, thus test if we have non-existing
// submodules, then do an real update
cmd = "if [ -d .git ]; then \n" +
"if git submodule status | grep -q -E '^-'; then \n" +
"git submodule update --init --recursive; \n" +
"else \n" +
"git submodule update --init --recursive --merge; \n" +
"fi; \n" +
"fi;";
grunt.verbose.write( "Updating submodules..." ); grunt.verbose.write( "Updating submodules..." );
// TODO: migrate remaining `make` to grunt tasks child_process.exec( cmd, function( err, stdout, stderr ) {
// if ( stderr ) {
grunt.utils.spawn({ console.log(stderr);
cmd: "make"
}, function( err, result ) {
if ( err ) {
grunt.verbose.error(); grunt.verbose.error();
done( err ); done( stderr );
return; return;
} }
grunt.log.writeln( result ); grunt.log.writeln( stdout );
done(); done();
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment