e47dead052
Bower was used to install multiple versions of jQuery which is now handled using Yarn aliases. The remaining two packages, closure-compiler and ng-closure-compiler were installed from zip files which is not supported by Yarn (see https://github.com/yarnpkg/yarn/issues/1483); the first of them exists on npm as the google-closure-compiler but only versions newer than we used are published and they don't work with ng-closure-compiler so - instead - both were checked in to the repository. Fixes #16268 Fixes #14961 Ref yarnpkg/yarn#1483
66 lines
1.9 KiB
JavaScript
66 lines
1.9 KiB
JavaScript
'use strict';
|
|
|
|
/* eslint-disable no-invalid-this */
|
|
|
|
var util = require('./utils.js');
|
|
var npmRun = require('npm-run');
|
|
|
|
module.exports = function(grunt) {
|
|
|
|
grunt.registerMultiTask('min', 'minify JS files', function() {
|
|
util.min(this.data, this.async());
|
|
});
|
|
|
|
|
|
grunt.registerTask('minall', 'minify all the JS files in parallel', function() {
|
|
var files = grunt.config('min');
|
|
files = Object.keys(files).map(function(key) { return files[key]; });
|
|
grunt.util.async.forEach(files, util.min.bind(util), this.async());
|
|
});
|
|
|
|
|
|
grunt.registerMultiTask('build', 'build JS files', function() {
|
|
util.build(this.data, this.async());
|
|
});
|
|
|
|
|
|
grunt.registerTask('buildall', 'build all the JS files in parallel', function() {
|
|
var builds = grunt.config('build');
|
|
builds = Object.keys(builds).map(function(key) { return builds[key]; });
|
|
grunt.util.async.forEach(builds, util.build.bind(util), this.async());
|
|
});
|
|
|
|
|
|
grunt.registerMultiTask('write', 'write content to a file', function() {
|
|
grunt.file.write(this.data.file, this.data.val);
|
|
grunt.log.ok('wrote to ' + this.data.file);
|
|
});
|
|
|
|
|
|
grunt.registerTask('docs', 'create angular docs', function() {
|
|
npmRun.execSync('gulp --gulpfile docs/gulpfile.js', {stdio: 'inherit'});
|
|
});
|
|
|
|
|
|
grunt.registerMultiTask('tests', '**Use `grunt test` instead**', function() {
|
|
util.startKarma(this.data, true, this.async());
|
|
});
|
|
|
|
|
|
grunt.registerMultiTask('autotest', 'Run and watch the unit tests with Karma', function() {
|
|
util.startKarma(this.data, false, this.async());
|
|
});
|
|
|
|
grunt.registerTask('webdriver', 'Update webdriver', function() {
|
|
util.updateWebdriver(this.async());
|
|
});
|
|
|
|
grunt.registerMultiTask('protractor', 'Run Protractor integration tests', function() {
|
|
util.startProtractor(this.data, this.async());
|
|
});
|
|
|
|
grunt.registerTask('collect-errors', 'Combine stripped error files', function() {
|
|
util.collectErrors();
|
|
});
|
|
};
|