Skip to content
This repository was archived by the owner on May 25, 2019. It is now read-only.

Commit 057ef2c

Browse files
committed
feat(grunt): add build and publish tasks
1 parent e04a6ad commit 057ef2c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

gruntFile.js

+19
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,25 @@ module.exports = function (grunt) {
77
grunt.registerTask('build-doc', ['uglify', 'copy']);
88
grunt.registerTask('server', ['karma:start']);
99

10+
// HACK TO ACCESS TO THE COMPONENT-PUBLISHER
11+
function fakeTargetTask(prefix){
12+
return function(){
13+
14+
if (this.args.length !== 1) return grunt.log.fail('Just give the name of the ' + prefix + ' you want like :\ngrunt ' + prefix + ':bower');
15+
16+
var done = this.async();
17+
var spawn = require('child_process').spawn;
18+
spawn('./node_modules/.bin/gulp', [ prefix, '--branch='+this.args[0] ].concat(grunt.option.flags()), {
19+
cwd : './node_modules/angular-ui-publisher',
20+
stdio: 'inherit'
21+
}).on('close', done);
22+
};
23+
}
24+
25+
grunt.registerTask('build', fakeTargetTask('build'));
26+
grunt.registerTask('publish', fakeTargetTask('publish'));
27+
//
28+
1029
var testConfig = function (configFile, customOptions) {
1130
var options = { configFile: configFile, singleRun: true };
1231
var travisOptions = process.env.TRAVIS && { browsers: [ 'Firefox', 'PhantomJS'], reporters: ['dots'] };

0 commit comments

Comments
 (0)