Jelajahi Sumber

Add the 'build' grunt task

- it calls 'bower update' and then 'make normal' inside the strophe dir.
JC Brand 12 tahun lalu
induk
melakukan
716ecc1b86
1 mengubah file dengan 17 tambahan dan 1 penghapusan
  1. 17 1
      Gruntfile.js

+ 17 - 1
Gruntfile.js

@@ -32,7 +32,23 @@ module.exports = function(grunt) {
                 done();
                 done();
         });
         });
     });
     });
-    grunt.registerTask('default', 'Perform all checks (e.g. before releasing)', function () {
+
+    grunt.registerTask('build', 'Set up the development environment', function () {
+        var done = this.async();
+        var child_process = require('child_process');
+        var exec = child_process.exec;
+        exec('bower update && cd ./components/strophe && make normal',
+             function (err, stdout, stderr) {
+                if (err) {
+                    grunt.log.write('build failed with error code '+err.code);
+                    grunt.log.write(stderr);
+                }
+                grunt.log.write(stdout);
+                done();
+        });
+    });
+
+    grunt.registerTask('check', 'Perform all checks (e.g. before releasing)', function () {
         grunt.task.run('jshint', 'test');
         grunt.task.run('jshint', 'test');
     });
     });
 };
 };