2014-06-23 23:17:31 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
2016-07-20 00:54:17 +02:00
|
|
|
var serveFavicon = require('serve-favicon');
|
|
|
|
|
var serveStatic = require('serve-static');
|
|
|
|
|
var serveIndex = require('serve-index');
|
2012-10-21 00:37:59 -06:00
|
|
|
var files = require('./angularFiles').files;
|
2018-12-10 16:33:01 +00:00
|
|
|
var mergeFilesFor = require('./angularFiles').mergeFilesFor;
|
2012-10-21 00:37:59 -06:00
|
|
|
var util = require('./lib/grunt/utils.js');
|
2014-03-11 06:34:09 +00:00
|
|
|
var versionInfo = require('./lib/versions/version-info');
|
2013-09-17 13:38:52 +01:00
|
|
|
var path = require('path');
|
2014-10-15 13:58:24 -04:00
|
|
|
var e2e = require('./test/e2e/tools');
|
2012-10-21 00:37:59 -06:00
|
|
|
|
2016-10-21 08:58:36 +01:00
|
|
|
var semver = require('semver');
|
2016-11-29 12:28:21 +00:00
|
|
|
var exec = require('shelljs').exec;
|
|
|
|
|
var pkg = require(__dirname + '/package.json');
|
2016-10-21 08:58:36 +01:00
|
|
|
|
2021-02-05 20:45:13 +02:00
|
|
|
var codeScriptFolder = util.codeScriptFolder;
|
2020-05-21 09:13:46 +01:00
|
|
|
var docsScriptFolder = util.docsScriptFolder;
|
2018-02-12 10:49:19 +01:00
|
|
|
|
2016-11-29 12:28:21 +00:00
|
|
|
// Node.js version checks
|
|
|
|
|
if (!semver.satisfies(process.version, pkg.engines.node)) {
|
|
|
|
|
reportOrFail('Invalid node version (' + process.version + '). ' +
|
|
|
|
|
'Please use a version that satisfies ' + pkg.engines.node);
|
2016-10-21 08:58:36 +01:00
|
|
|
}
|
|
|
|
|
|
2016-11-29 12:28:21 +00:00
|
|
|
// Yarn version checks
|
|
|
|
|
var expectedYarnVersion = pkg.engines.yarn;
|
|
|
|
|
var currentYarnVersion = exec('yarn --version', {silent: true}).stdout.trim();
|
|
|
|
|
if (!semver.satisfies(currentYarnVersion, expectedYarnVersion)) {
|
|
|
|
|
reportOrFail('Invalid yarn version (' + currentYarnVersion + '). ' +
|
|
|
|
|
'Please use a version that satisfies ' + expectedYarnVersion);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Grunt CLI version checks
|
2018-10-11 16:35:57 +02:00
|
|
|
var expectedGruntVersion = pkg.engines['grunt-cli'];
|
2016-11-29 12:28:21 +00:00
|
|
|
var currentGruntVersions = exec('grunt --version', {silent: true}).stdout;
|
|
|
|
|
var match = /^grunt-cli v(.+)$/m.exec(currentGruntVersions);
|
|
|
|
|
if (!match) {
|
|
|
|
|
reportOrFail('Unable to compute the current grunt-cli version. We found:\n' +
|
|
|
|
|
currentGruntVersions);
|
|
|
|
|
} else {
|
|
|
|
|
if (!semver.satisfies(match[1], expectedGruntVersion)) {
|
|
|
|
|
reportOrFail('Invalid grunt-cli version (' + match[1] + '). ' +
|
|
|
|
|
'Please use a version that satisfies ' + expectedGruntVersion);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Ensure Node.js dependencies have been installed
|
2020-05-21 09:13:46 +01:00
|
|
|
if (!process.env.CI) {
|
2016-11-29 12:28:21 +00:00
|
|
|
var yarnOutput = exec('yarn install');
|
|
|
|
|
if (yarnOutput.code !== 0) {
|
|
|
|
|
throw new Error('Yarn install failed: ' + yarnOutput.stderr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-10-21 00:37:59 -06:00
|
|
|
module.exports = function(grunt) {
|
2016-11-29 12:28:21 +00:00
|
|
|
|
|
|
|
|
// this loads all the node_modules that start with `grunt-` as plugins
|
2014-02-01 23:14:07 -08:00
|
|
|
require('load-grunt-tasks')(grunt);
|
|
|
|
|
|
2016-11-29 12:28:21 +00:00
|
|
|
// load additional grunt tasks
|
2012-10-21 00:37:59 -06:00
|
|
|
grunt.loadTasks('lib/grunt');
|
2014-08-13 23:00:00 -07:00
|
|
|
grunt.loadNpmTasks('angular-benchpress');
|
2012-10-21 00:37:59 -06:00
|
|
|
|
2016-11-29 12:28:21 +00:00
|
|
|
// compute version related info for this build
|
2014-03-11 06:34:09 +00:00
|
|
|
var NG_VERSION = versionInfo.currentVersion;
|
2014-03-26 15:51:11 -07:00
|
|
|
NG_VERSION.cdn = versionInfo.cdnVersion;
|
2016-07-20 15:45:04 +02:00
|
|
|
var dist = 'angular-' + NG_VERSION.full;
|
2012-10-21 00:37:59 -06:00
|
|
|
|
2017-10-19 14:24:19 +02:00
|
|
|
var deployVersion = NG_VERSION.full;
|
|
|
|
|
|
|
|
|
|
if (NG_VERSION.isSnapshot) {
|
|
|
|
|
deployVersion = NG_VERSION.distTag === 'latest' ? 'snapshot-stable' : 'snapshot';
|
|
|
|
|
}
|
2017-07-13 11:14:55 +02:00
|
|
|
|
2016-06-14 11:44:37 +01:00
|
|
|
if (versionInfo.cdnVersion == null) {
|
2016-11-29 12:28:21 +00:00
|
|
|
throw new Error('Unable to read CDN version, are you offline or has the CDN not been properly pushed?\n' +
|
|
|
|
|
'Perhaps you want to set the NG1_BUILD_NO_REMOTE_VERSION_REQUESTS environment variable?');
|
2016-06-14 11:44:37 +01:00
|
|
|
}
|
|
|
|
|
|
2012-10-21 00:37:59 -06:00
|
|
|
//config
|
|
|
|
|
grunt.initConfig({
|
|
|
|
|
NG_VERSION: NG_VERSION,
|
2014-08-13 23:00:00 -07:00
|
|
|
bp_build: {
|
|
|
|
|
options: {
|
|
|
|
|
buildPath: 'build/benchmarks',
|
|
|
|
|
benchmarksPath: 'benchmarks'
|
|
|
|
|
}
|
|
|
|
|
},
|
2013-07-01 16:21:56 -07:00
|
|
|
|
2012-10-21 00:37:59 -06:00
|
|
|
connect: {
|
|
|
|
|
devserver: {
|
|
|
|
|
options: {
|
|
|
|
|
port: 8000,
|
2013-03-11 15:07:51 -07:00
|
|
|
hostname: '0.0.0.0',
|
2012-10-21 00:37:59 -06:00
|
|
|
base: '.',
|
|
|
|
|
keepalive: true,
|
2016-07-20 15:45:04 +02:00
|
|
|
middleware: function(connect, options) {
|
2014-10-11 21:58:38 +02:00
|
|
|
var base = Array.isArray(options.base) ? options.base[options.base.length - 1] : options.base;
|
2012-10-21 00:37:59 -06:00
|
|
|
return [
|
2014-09-17 10:43:49 -07:00
|
|
|
util.conditionalCsp(),
|
2012-10-21 00:37:59 -06:00
|
|
|
util.rewrite(),
|
2014-10-15 13:58:24 -04:00
|
|
|
e2e.middleware(),
|
2016-07-20 00:54:17 +02:00
|
|
|
serveFavicon('images/favicon.ico'),
|
|
|
|
|
serveStatic(base),
|
|
|
|
|
serveIndex(base)
|
2012-10-21 00:37:59 -06:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2013-07-01 16:21:56 -07:00
|
|
|
testserver: {
|
|
|
|
|
options: {
|
2020-05-21 09:13:46 +01:00
|
|
|
// We start the webserver as a separate process from the E2E tests
|
2013-08-12 21:41:20 -07:00
|
|
|
port: 8000,
|
|
|
|
|
hostname: '0.0.0.0',
|
2016-07-20 15:45:04 +02:00
|
|
|
middleware: function(connect, options) {
|
2014-10-11 21:58:38 +02:00
|
|
|
var base = Array.isArray(options.base) ? options.base[options.base.length - 1] : options.base;
|
2013-07-01 16:21:56 -07:00
|
|
|
return [
|
|
|
|
|
function(req, resp, next) {
|
2020-05-21 09:13:46 +01:00
|
|
|
// cache GET requests to speed up tests
|
2013-07-01 16:21:56 -07:00
|
|
|
if (req.method === 'GET') {
|
|
|
|
|
resp.setHeader('Cache-control', 'public, max-age=3600');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
next();
|
|
|
|
|
},
|
2014-09-17 10:43:49 -07:00
|
|
|
util.conditionalCsp(),
|
2014-10-15 13:58:24 -04:00
|
|
|
e2e.middleware(),
|
2016-07-20 00:54:17 +02:00
|
|
|
serveFavicon('images/favicon.ico'),
|
|
|
|
|
serveStatic(base)
|
2013-07-01 16:21:56 -07:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-10-21 00:37:59 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
2013-08-01 16:14:52 -04:00
|
|
|
tests: {
|
2013-03-20 18:57:13 -07:00
|
|
|
jqlite: 'karma-jqlite.conf.js',
|
|
|
|
|
jquery: 'karma-jquery.conf.js',
|
2016-07-06 14:05:39 +02:00
|
|
|
'jquery-2.2': 'karma-jquery-2.2.conf.js',
|
2016-03-13 23:22:13 +01:00
|
|
|
'jquery-2.1': 'karma-jquery-2.1.conf.js',
|
2014-02-21 21:36:22 +00:00
|
|
|
docs: 'karma-docs.conf.js',
|
2018-12-10 16:33:01 +00:00
|
|
|
modules: 'karma-modules.conf.js',
|
|
|
|
|
'modules-ngAnimate': 'karma-modules-ngAnimate.conf.js',
|
|
|
|
|
'modules-ngMock': 'karma-modules-ngMock.conf.js'
|
2012-10-21 00:37:59 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
autotest: {
|
2013-03-20 18:57:13 -07:00
|
|
|
jqlite: 'karma-jqlite.conf.js',
|
2013-06-06 14:07:32 -07:00
|
|
|
jquery: 'karma-jquery.conf.js',
|
2016-07-06 14:05:39 +02:00
|
|
|
'jquery-2.2': 'karma-jquery-2.2.conf.js',
|
2016-03-13 23:22:13 +01:00
|
|
|
'jquery-2.1': 'karma-jquery-2.1.conf.js',
|
2013-06-05 14:31:32 -04:00
|
|
|
modules: 'karma-modules.conf.js',
|
2014-02-21 21:36:22 +00:00
|
|
|
docs: 'karma-docs.conf.js'
|
2012-10-21 00:37:59 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
2014-01-30 22:09:09 -08:00
|
|
|
protractor: {
|
2014-01-30 18:49:58 -08:00
|
|
|
normal: 'protractor-conf.js',
|
2020-05-21 09:13:46 +01:00
|
|
|
circleci: 'protractor-circleci-conf.js'
|
2014-01-07 11:51:32 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
2013-08-21 19:17:07 -04:00
|
|
|
clean: {
|
|
|
|
|
build: ['build'],
|
2018-02-08 23:43:00 +01:00
|
|
|
tmp: ['tmp'],
|
2018-02-12 10:47:42 +01:00
|
|
|
deploy: [
|
2021-02-05 20:45:13 +02:00
|
|
|
codeScriptFolder + '/deploy',
|
|
|
|
|
docsScriptFolder + '/deploy',
|
|
|
|
|
docsScriptFolder + '/functions/content'
|
2018-02-12 10:47:42 +01:00
|
|
|
]
|
2013-08-21 19:17:07 -04:00
|
|
|
},
|
2012-10-21 00:37:59 -06:00
|
|
|
|
2016-07-20 15:45:04 +02:00
|
|
|
eslint: {
|
|
|
|
|
all: {
|
|
|
|
|
src: [
|
|
|
|
|
'*.js',
|
|
|
|
|
'benchmarks/**/*.js',
|
|
|
|
|
'docs/**/*.js',
|
|
|
|
|
'lib/**/*.js',
|
|
|
|
|
'scripts/**/*.js',
|
2018-02-12 12:26:32 +01:00
|
|
|
'!scripts/*/*/node_modules/**',
|
2016-07-20 15:45:04 +02:00
|
|
|
'src/**/*.js',
|
|
|
|
|
'test/**/*.js',
|
|
|
|
|
'i18n/**/*.js',
|
|
|
|
|
'!docs/app/assets/js/angular-bootstrap/**',
|
|
|
|
|
'!docs/config/templates/**',
|
|
|
|
|
'!src/angular.bind.js',
|
|
|
|
|
'!i18n/closure/**',
|
|
|
|
|
'!src/ngParseExt/ucd.js'
|
|
|
|
|
]
|
2014-01-30 10:51:10 -08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2012-10-21 00:37:59 -06:00
|
|
|
build: {
|
|
|
|
|
angular: {
|
|
|
|
|
dest: 'build/angular.js',
|
2015-07-27 21:55:15 +01:00
|
|
|
src: util.wrap([files['angularSrc']], 'angular'),
|
2012-10-21 00:37:59 -06:00
|
|
|
styles: {
|
|
|
|
|
css: ['css/angular.css'],
|
2013-10-14 12:06:26 -07:00
|
|
|
generateCspCssFile: true,
|
2012-10-21 00:37:59 -06:00
|
|
|
minify: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
loader: {
|
|
|
|
|
dest: 'build/angular-loader.js',
|
2013-10-21 09:06:53 +01:00
|
|
|
src: util.wrap(files['angularLoader'], 'loader')
|
2012-10-21 00:37:59 -06:00
|
|
|
},
|
2013-08-09 10:02:48 -07:00
|
|
|
touch: {
|
|
|
|
|
dest: 'build/angular-touch.js',
|
2013-10-21 09:06:53 +01:00
|
|
|
src: util.wrap(files['angularModules']['ngTouch'], 'module')
|
2013-02-08 13:39:23 -05:00
|
|
|
},
|
2018-12-10 16:33:01 +00:00
|
|
|
touchModuleTestBundle: {
|
|
|
|
|
dest: 'build/test-bundles/angular-touch.js',
|
|
|
|
|
prefix: 'src/module.prefix',
|
|
|
|
|
src: mergeFilesFor('karmaModules-ngTouch'),
|
|
|
|
|
suffix: 'src/module.suffix'
|
|
|
|
|
},
|
2012-10-21 00:37:59 -06:00
|
|
|
mocks: {
|
|
|
|
|
dest: 'build/angular-mocks.js',
|
2013-11-21 19:50:23 -05:00
|
|
|
src: util.wrap(files['angularModules']['ngMock'], 'module'),
|
2012-10-21 00:37:59 -06:00
|
|
|
strict: false
|
|
|
|
|
},
|
|
|
|
|
sanitize: {
|
|
|
|
|
dest: 'build/angular-sanitize.js',
|
2013-10-21 09:06:53 +01:00
|
|
|
src: util.wrap(files['angularModules']['ngSanitize'], 'module')
|
2012-10-21 00:37:59 -06:00
|
|
|
},
|
2018-12-10 16:33:01 +00:00
|
|
|
sanitizeModuleTestBundle: {
|
|
|
|
|
dest: 'build/test-bundles/angular-sanitize.js',
|
|
|
|
|
prefix: 'src/module.prefix',
|
|
|
|
|
src: mergeFilesFor('karmaModules-ngSanitize'),
|
|
|
|
|
suffix: 'src/module.suffix'
|
|
|
|
|
},
|
2012-10-21 00:37:59 -06:00
|
|
|
resource: {
|
|
|
|
|
dest: 'build/angular-resource.js',
|
2013-10-21 09:06:53 +01:00
|
|
|
src: util.wrap(files['angularModules']['ngResource'], 'module')
|
2012-10-21 00:37:59 -06:00
|
|
|
},
|
2018-12-10 16:33:01 +00:00
|
|
|
resourceModuleTestBundle: {
|
|
|
|
|
dest: 'build/test-bundles/angular-resource.js',
|
|
|
|
|
prefix: 'src/module.prefix',
|
|
|
|
|
src: mergeFilesFor('karmaModules-ngResource'),
|
|
|
|
|
suffix: 'src/module.suffix'
|
|
|
|
|
},
|
feat($interpolate): extend interpolation with MessageFormat like syntax
For more detailed information refer to this document:
https://docs.google.com/a/google.com/document/d/1pbtW2yvtmFBikfRrJd8VAsabiFkKezmYZ_PbgdjQOVU/edit
**Example:**
```html
{{recipients.length, plural, offset:1
=0 {You gave no gifts}
=1 { {{ recipients[0].gender, select,
male {You gave him a gift.}
female {You gave her a gift.}
other {You gave them a gift.}
}}
}
one { {{ recipients[0].gender, select,
male {You gave him and one other person a gift.}
female {You gave her and one other person a gift.}
other {You gave them and one other person a gift.}
}}
}
other {You gave {{recipients[0].gender}} and # other people gifts. }
}}
```
This is a SEPARATE module so you MUST include `angular-messageformat.js`
or `angular-messageformat.min.js`.
In addition, your application module should depend on the "ngMessageFormat"
(e.g. angular.module('myApp', ['ngMessageFormat']);)
When you use the `ngMessageFormat`, the $interpolate gets overridden with
a new service that adds the new MessageFormat behavior.
**Syntax differences from MessageFormat:**
- MessageFormat directives are always inside `{{ }}` instead of
single `{ }`. This ensures a consistent interpolation syntax (else you
could interpolate in more than one way and have to pick one based on
the features availability for that syntax.)
- The first part of such a syntax can be an arbitrary Angular
expression instead of a single identifier.
- You can nest them as deep as you want. As mentioned earlier, you
would use `{{ }}` to start the nested interpolation that may optionally
include select/plural extensions.
- Only `select` and `plural` keywords are currently recognized.
- Quoting support is coming in a future commit.
- Positional arguments/placeholders are not supported. They don't make
sense in Angular templates anyway (they are only helpful when using
API calls from a programming language.)
- Redefining of the startSymbol (`{{`) and endSymbol (`}}`) used for
interpolation is not yet supported.
Closes #11152
2015-02-12 13:45:25 -08:00
|
|
|
messageformat: {
|
2015-04-14 18:10:13 -07:00
|
|
|
dest: 'build/angular-message-format.js',
|
feat($interpolate): extend interpolation with MessageFormat like syntax
For more detailed information refer to this document:
https://docs.google.com/a/google.com/document/d/1pbtW2yvtmFBikfRrJd8VAsabiFkKezmYZ_PbgdjQOVU/edit
**Example:**
```html
{{recipients.length, plural, offset:1
=0 {You gave no gifts}
=1 { {{ recipients[0].gender, select,
male {You gave him a gift.}
female {You gave her a gift.}
other {You gave them a gift.}
}}
}
one { {{ recipients[0].gender, select,
male {You gave him and one other person a gift.}
female {You gave her and one other person a gift.}
other {You gave them and one other person a gift.}
}}
}
other {You gave {{recipients[0].gender}} and # other people gifts. }
}}
```
This is a SEPARATE module so you MUST include `angular-messageformat.js`
or `angular-messageformat.min.js`.
In addition, your application module should depend on the "ngMessageFormat"
(e.g. angular.module('myApp', ['ngMessageFormat']);)
When you use the `ngMessageFormat`, the $interpolate gets overridden with
a new service that adds the new MessageFormat behavior.
**Syntax differences from MessageFormat:**
- MessageFormat directives are always inside `{{ }}` instead of
single `{ }`. This ensures a consistent interpolation syntax (else you
could interpolate in more than one way and have to pick one based on
the features availability for that syntax.)
- The first part of such a syntax can be an arbitrary Angular
expression instead of a single identifier.
- You can nest them as deep as you want. As mentioned earlier, you
would use `{{ }}` to start the nested interpolation that may optionally
include select/plural extensions.
- Only `select` and `plural` keywords are currently recognized.
- Quoting support is coming in a future commit.
- Positional arguments/placeholders are not supported. They don't make
sense in Angular templates anyway (they are only helpful when using
API calls from a programming language.)
- Redefining of the startSymbol (`{{`) and endSymbol (`}}`) used for
interpolation is not yet supported.
Closes #11152
2015-02-12 13:45:25 -08:00
|
|
|
src: util.wrap(files['angularModules']['ngMessageFormat'], 'module')
|
|
|
|
|
},
|
2018-12-10 16:33:01 +00:00
|
|
|
messageformatModuleTestBundle: {
|
|
|
|
|
dest: 'build/test-bundles/angular-message-format.js',
|
|
|
|
|
prefix: 'src/module.prefix',
|
|
|
|
|
src: mergeFilesFor('karmaModules-ngMessageFormat'),
|
|
|
|
|
suffix: 'src/module.suffix'
|
|
|
|
|
},
|
2014-04-22 02:15:01 -04:00
|
|
|
messages: {
|
|
|
|
|
dest: 'build/angular-messages.js',
|
|
|
|
|
src: util.wrap(files['angularModules']['ngMessages'], 'module')
|
|
|
|
|
},
|
2018-12-10 16:33:01 +00:00
|
|
|
messagesModuleTestBundle: {
|
|
|
|
|
dest: 'build/test-bundles/angular-messages.js',
|
|
|
|
|
prefix: 'src/module.prefix',
|
|
|
|
|
src: mergeFilesFor('karmaModules-ngMessages'),
|
|
|
|
|
suffix: 'src/module.suffix'
|
|
|
|
|
},
|
feat(ngAnimate): complete rewrite of animations
- ngAnimate directive is gone and was replaced with class based animations/transitions
- support for triggering animations on css class additions and removals
- done callback was added to all animation apis
- $animation and $animator where merged into a single $animate service with api:
- $animate.enter(element, parent, after, done);
- $animate.leave(element, done);
- $animate.move(element, parent, after, done);
- $animate.addClass(element, className, done);
- $animate.removeClass(element, className, done);
BREAKING CHANGE: too many things changed, we'll write up a separate doc with migration instructions
2013-06-18 13:59:57 -04:00
|
|
|
animate: {
|
|
|
|
|
dest: 'build/angular-animate.js',
|
2013-10-21 09:06:53 +01:00
|
|
|
src: util.wrap(files['angularModules']['ngAnimate'], 'module')
|
feat(ngAnimate): complete rewrite of animations
- ngAnimate directive is gone and was replaced with class based animations/transitions
- support for triggering animations on css class additions and removals
- done callback was added to all animation apis
- $animation and $animator where merged into a single $animate service with api:
- $animate.enter(element, parent, after, done);
- $animate.leave(element, done);
- $animate.move(element, parent, after, done);
- $animate.addClass(element, className, done);
- $animate.removeClass(element, className, done);
BREAKING CHANGE: too many things changed, we'll write up a separate doc with migration instructions
2013-06-18 13:59:57 -04:00
|
|
|
},
|
2013-06-05 15:30:31 -07:00
|
|
|
route: {
|
|
|
|
|
dest: 'build/angular-route.js',
|
2013-10-21 09:06:53 +01:00
|
|
|
src: util.wrap(files['angularModules']['ngRoute'], 'module')
|
2013-06-05 15:30:31 -07:00
|
|
|
},
|
2018-12-10 16:33:01 +00:00
|
|
|
routeModuleTestBundle: {
|
|
|
|
|
dest: 'build/test-bundles/angular-route.js',
|
|
|
|
|
prefix: 'src/module.prefix',
|
|
|
|
|
src: mergeFilesFor('karmaModules-ngRoute'),
|
|
|
|
|
suffix: 'src/module.suffix'
|
|
|
|
|
},
|
2012-10-21 00:37:59 -06:00
|
|
|
cookies: {
|
|
|
|
|
dest: 'build/angular-cookies.js',
|
2013-10-21 09:06:53 +01:00
|
|
|
src: util.wrap(files['angularModules']['ngCookies'], 'module')
|
2013-08-21 19:17:07 -04:00
|
|
|
},
|
2018-12-10 16:33:01 +00:00
|
|
|
cookiesModuleTestBundle: {
|
|
|
|
|
dest: 'build/test-bundles/angular-cookies.js',
|
|
|
|
|
prefix: 'src/module.prefix',
|
|
|
|
|
src: mergeFilesFor('karmaModules-ngCookies'),
|
|
|
|
|
suffix: 'src/module.suffix'
|
|
|
|
|
},
|
2014-07-26 01:15:19 +08:00
|
|
|
aria: {
|
|
|
|
|
dest: 'build/angular-aria.js',
|
|
|
|
|
src: util.wrap(files['angularModules']['ngAria'], 'module')
|
|
|
|
|
},
|
2018-12-10 16:33:01 +00:00
|
|
|
ariaModuleTestBundle: {
|
|
|
|
|
dest: 'build/test-bundles/angular-aria.js',
|
|
|
|
|
prefix: 'src/module.prefix',
|
|
|
|
|
src: mergeFilesFor('karmaModules-ngAria'),
|
|
|
|
|
suffix: 'src/module.suffix'
|
|
|
|
|
},
|
2015-09-20 21:29:59 +02:00
|
|
|
parseext: {
|
|
|
|
|
dest: 'build/angular-parse-ext.js',
|
|
|
|
|
src: util.wrap(files['angularModules']['ngParseExt'], 'module')
|
|
|
|
|
},
|
2016-08-10 12:13:14 +02:00
|
|
|
'promises-aplus-adapter': {
|
2013-08-21 19:17:07 -04:00
|
|
|
dest:'tmp/promises-aplus-adapter++.js',
|
2015-12-17 14:56:49 +00:00
|
|
|
src:['src/ng/q.js', 'lib/promises-aplus/promises-aplus-test-adapter.js']
|
2012-10-21 00:37:59 -06:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
min: {
|
|
|
|
|
angular: 'build/angular.js',
|
feat(ngAnimate): complete rewrite of animations
- ngAnimate directive is gone and was replaced with class based animations/transitions
- support for triggering animations on css class additions and removals
- done callback was added to all animation apis
- $animation and $animator where merged into a single $animate service with api:
- $animate.enter(element, parent, after, done);
- $animate.leave(element, done);
- $animate.move(element, parent, after, done);
- $animate.addClass(element, className, done);
- $animate.removeClass(element, className, done);
BREAKING CHANGE: too many things changed, we'll write up a separate doc with migration instructions
2013-06-18 13:59:57 -04:00
|
|
|
animate: 'build/angular-animate.js',
|
2012-10-21 00:37:59 -06:00
|
|
|
cookies: 'build/angular-cookies.js',
|
|
|
|
|
loader: 'build/angular-loader.js',
|
2015-04-14 18:10:13 -07:00
|
|
|
messageformat: 'build/angular-message-format.js',
|
2014-05-09 17:37:41 -04:00
|
|
|
messages: 'build/angular-messages.js',
|
2013-08-09 10:02:48 -07:00
|
|
|
touch: 'build/angular-touch.js',
|
2012-10-21 00:37:59 -06:00
|
|
|
resource: 'build/angular-resource.js',
|
2013-06-05 15:30:31 -07:00
|
|
|
route: 'build/angular-route.js',
|
2014-07-26 01:15:19 +08:00
|
|
|
sanitize: 'build/angular-sanitize.js',
|
2015-09-20 21:29:59 +02:00
|
|
|
aria: 'build/angular-aria.js',
|
|
|
|
|
parseext: 'build/angular-parse-ext.js'
|
2012-10-21 00:37:59 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
2015-12-17 21:59:31 +00:00
|
|
|
'ddescribe-iit': {
|
2013-07-03 11:10:23 -07:00
|
|
|
files: [
|
2014-05-22 18:08:07 -07:00
|
|
|
'src/**/*.js',
|
2013-07-03 11:10:23 -07:00
|
|
|
'test/**/*.js',
|
2014-06-09 14:51:35 -04:00
|
|
|
'!src/ng/directive/attrs.js', // legitimate xit here
|
2015-03-04 12:20:49 +00:00
|
|
|
'!test/helpers/privateMocks*.js'
|
|
|
|
|
],
|
|
|
|
|
options: {
|
|
|
|
|
disallowed: [
|
2016-03-19 00:11:50 +02:00
|
|
|
'fit',
|
2015-03-04 12:20:49 +00:00
|
|
|
'iit',
|
|
|
|
|
'xit',
|
2016-03-19 00:11:50 +02:00
|
|
|
'fthey',
|
2015-03-04 12:20:49 +00:00
|
|
|
'tthey',
|
|
|
|
|
'xthey',
|
2016-03-19 00:11:50 +02:00
|
|
|
'fdescribe',
|
2015-03-04 12:20:49 +00:00
|
|
|
'ddescribe',
|
2016-03-19 00:11:50 +02:00
|
|
|
'xdescribe',
|
|
|
|
|
'it.only',
|
|
|
|
|
'describe.only'
|
2015-03-04 12:20:49 +00:00
|
|
|
]
|
|
|
|
|
}
|
2013-07-03 11:10:23 -07:00
|
|
|
},
|
|
|
|
|
|
2015-12-17 21:59:31 +00:00
|
|
|
'merge-conflict': {
|
2013-07-03 11:10:23 -07:00
|
|
|
files: [
|
|
|
|
|
'src/**/*',
|
|
|
|
|
'test/**/*',
|
|
|
|
|
'docs/**/*',
|
|
|
|
|
'css/**/*'
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
|
2012-10-21 00:37:59 -06:00
|
|
|
copy: {
|
|
|
|
|
i18n: {
|
|
|
|
|
files: [
|
2017-08-22 12:16:04 +02:00
|
|
|
{
|
|
|
|
|
src: 'src/ngLocale/**',
|
|
|
|
|
dest: 'build/i18n/',
|
|
|
|
|
expand: true,
|
|
|
|
|
flatten: true
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
2018-01-19 13:40:34 +01:00
|
|
|
deployFirebaseCode: {
|
|
|
|
|
files: [
|
|
|
|
|
{
|
2018-02-09 20:18:29 +01:00
|
|
|
cwd: 'build',
|
2020-05-24 09:31:20 +01:00
|
|
|
src: '**',
|
2021-02-05 20:45:13 +02:00
|
|
|
dest: codeScriptFolder + '/deploy/' + deployVersion + '/',
|
2018-02-09 20:18:29 +01:00
|
|
|
expand: true
|
2018-01-19 13:40:34 +01:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
2017-08-22 12:16:04 +02:00
|
|
|
deployFirebaseDocs: {
|
|
|
|
|
files: [
|
|
|
|
|
// The source files are needed by the embedded examples in the docs app.
|
|
|
|
|
{
|
2018-02-08 23:43:00 +01:00
|
|
|
src: ['build/angular*.{js,js.map,min.js}', 'build/sitemap.xml'],
|
2021-02-05 20:45:13 +02:00
|
|
|
dest: docsScriptFolder + '/deploy/',
|
2017-08-22 12:16:04 +02:00
|
|
|
expand: true,
|
|
|
|
|
flatten: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
cwd: 'build/docs',
|
2018-02-18 20:35:55 +01:00
|
|
|
src: ['**', '!ptore2e/**', '!index*.html'],
|
2021-02-05 20:45:13 +02:00
|
|
|
dest: docsScriptFolder + '/deploy/',
|
2018-02-12 10:47:42 +01:00
|
|
|
expand: true
|
2018-02-12 10:49:19 +01:00
|
|
|
},
|
|
|
|
|
{
|
2018-02-18 20:35:55 +01:00
|
|
|
src: 'build/docs/index-production.html',
|
2021-02-05 20:45:13 +02:00
|
|
|
dest: docsScriptFolder + '/deploy/index.html'
|
2018-02-18 20:35:55 +01:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
src: 'build/docs/index-production.html',
|
|
|
|
|
dest: docsScriptFolder + '/functions/content/index.html'
|
2018-02-12 10:49:19 +01:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
cwd: 'build/docs',
|
|
|
|
|
src: 'partials/**',
|
2021-02-05 20:45:13 +02:00
|
|
|
dest: docsScriptFolder + '/functions/content/',
|
2017-08-22 12:16:04 +02:00
|
|
|
expand: true
|
|
|
|
|
}
|
2012-10-21 00:37:59 -06:00
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
compress: {
|
|
|
|
|
build: {
|
2016-07-20 15:45:04 +02:00
|
|
|
options: {archive: 'build/' + dist + '.zip', mode: 'zip'},
|
2014-06-23 23:17:31 +02:00
|
|
|
src: ['**'],
|
|
|
|
|
cwd: 'build',
|
|
|
|
|
expand: true,
|
|
|
|
|
dot: true,
|
|
|
|
|
dest: dist + '/'
|
2012-10-21 00:37:59 -06:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2014-10-11 21:58:38 +02:00
|
|
|
shell: {
|
2016-11-29 13:16:30 +00:00
|
|
|
'install-node-dependencies': {
|
|
|
|
|
command: 'yarn'
|
2015-02-21 17:40:33 -08:00
|
|
|
},
|
2015-12-17 21:59:31 +00:00
|
|
|
'promises-aplus-tests': {
|
2014-10-11 21:58:38 +02:00
|
|
|
options: {
|
|
|
|
|
stdout: false,
|
|
|
|
|
stderr: true,
|
|
|
|
|
failOnError: true
|
2013-08-21 19:17:07 -04:00
|
|
|
},
|
2016-11-11 12:34:25 +00:00
|
|
|
command: path.normalize('./node_modules/.bin/promises-aplus-tests tmp/promises-aplus-adapter++.js --timeout 2000')
|
2013-08-21 19:17:07 -04:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2012-10-21 00:37:59 -06:00
|
|
|
|
|
|
|
|
write: {
|
|
|
|
|
versionTXT: {file: 'build/version.txt', val: NG_VERSION.full},
|
|
|
|
|
versionJSON: {file: 'build/version.json', val: JSON.stringify(NG_VERSION)}
|
2013-12-13 12:49:42 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
bump: {
|
|
|
|
|
options: {
|
|
|
|
|
files: ['package.json'],
|
|
|
|
|
commit: false,
|
|
|
|
|
createTag: false,
|
|
|
|
|
push: false
|
|
|
|
|
}
|
2012-10-21 00:37:59 -06:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//alias tasks
|
2017-06-11 22:02:50 +02:00
|
|
|
grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', [
|
|
|
|
|
'eslint',
|
|
|
|
|
'package',
|
|
|
|
|
'test:unit',
|
|
|
|
|
'test:promises-aplus',
|
|
|
|
|
'tests:docs',
|
|
|
|
|
'test:protractor'
|
|
|
|
|
]);
|
2013-08-04 11:40:24 -04:00
|
|
|
grunt.registerTask('test:jqlite', 'Run the unit tests with Karma' , ['tests:jqlite']);
|
2016-03-13 23:22:13 +01:00
|
|
|
grunt.registerTask('test:jquery', 'Run the jQuery (latest) unit tests with Karma', ['tests:jquery']);
|
2016-07-06 14:05:39 +02:00
|
|
|
grunt.registerTask('test:jquery-2.2', 'Run the jQuery 2.2 unit tests with Karma', ['tests:jquery-2.2']);
|
2016-03-13 23:22:13 +01:00
|
|
|
grunt.registerTask('test:jquery-2.1', 'Run the jQuery 2.1 unit tests with Karma', ['tests:jquery-2.1']);
|
2017-06-11 22:02:50 +02:00
|
|
|
grunt.registerTask('test:modules', 'Run the Karma module tests with Karma', [
|
|
|
|
|
'build',
|
2018-12-10 16:33:01 +00:00
|
|
|
'tests:modules',
|
2018-10-15 15:10:10 +02:00
|
|
|
'tests:modules-ngAnimate',
|
2018-12-10 16:33:01 +00:00
|
|
|
'tests:modules-ngMock'
|
2017-06-11 22:02:50 +02:00
|
|
|
]);
|
2014-02-21 21:36:22 +00:00
|
|
|
grunt.registerTask('test:docs', 'Run the doc-page tests with Karma', ['package', 'tests:docs']);
|
2017-06-11 22:02:50 +02:00
|
|
|
grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', [
|
|
|
|
|
'test:jqlite',
|
|
|
|
|
'test:jquery',
|
|
|
|
|
'test:jquery-2.2',
|
|
|
|
|
'test:jquery-2.1',
|
|
|
|
|
'test:modules'
|
|
|
|
|
]);
|
|
|
|
|
grunt.registerTask('test:protractor', 'Run the end to end tests with Protractor and keep a test server running in the background', [
|
|
|
|
|
'webdriver',
|
|
|
|
|
'connect:testserver',
|
|
|
|
|
'protractor:normal'
|
|
|
|
|
]);
|
2020-05-21 09:13:46 +01:00
|
|
|
grunt.registerTask('test:circleci-protractor', 'Run the end to end tests with Protractor for CircleCI builds', [
|
2017-06-11 22:02:50 +02:00
|
|
|
'connect:testserver',
|
2020-05-21 09:13:46 +01:00
|
|
|
'protractor:circleci'
|
2017-06-11 22:02:50 +02:00
|
|
|
]);
|
2014-01-11 16:59:15 -08:00
|
|
|
grunt.registerTask('test:e2e', 'Alias for test:protractor', ['test:protractor']);
|
2017-06-11 22:02:50 +02:00
|
|
|
grunt.registerTask('test:promises-aplus',[
|
|
|
|
|
'build:promises-aplus-adapter',
|
|
|
|
|
'shell:promises-aplus-tests'
|
|
|
|
|
]);
|
|
|
|
|
grunt.registerTask('minify', [
|
|
|
|
|
'clean',
|
|
|
|
|
'build',
|
|
|
|
|
'minall'
|
|
|
|
|
]);
|
2012-10-21 00:37:59 -06:00
|
|
|
grunt.registerTask('webserver', ['connect:devserver']);
|
2017-06-11 22:02:50 +02:00
|
|
|
grunt.registerTask('package', [
|
|
|
|
|
'validate-angular-files',
|
|
|
|
|
'clean',
|
|
|
|
|
'buildall',
|
|
|
|
|
'minall',
|
|
|
|
|
'collect-errors',
|
|
|
|
|
'write',
|
|
|
|
|
'docs',
|
2017-08-22 12:16:04 +02:00
|
|
|
'copy:i18n',
|
2017-07-13 11:14:55 +02:00
|
|
|
'compress:build'
|
2017-06-11 22:02:50 +02:00
|
|
|
]);
|
|
|
|
|
grunt.registerTask('ci-checks', [
|
|
|
|
|
'ddescribe-iit',
|
|
|
|
|
'merge-conflict',
|
|
|
|
|
'eslint'
|
|
|
|
|
]);
|
2018-02-12 10:47:42 +01:00
|
|
|
grunt.registerTask('prepareDeploy', [
|
2018-01-19 13:40:34 +01:00
|
|
|
'copy:deployFirebaseCode',
|
2017-08-22 12:16:04 +02:00
|
|
|
'copy:deployFirebaseDocs'
|
|
|
|
|
]);
|
2012-10-21 00:37:59 -06:00
|
|
|
grunt.registerTask('default', ['package']);
|
|
|
|
|
};
|
2016-11-29 12:28:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
function reportOrFail(message) {
|
2020-05-21 09:13:46 +01:00
|
|
|
if (process.env.CI) {
|
2016-11-29 12:28:21 +00:00
|
|
|
throw new Error(message);
|
|
|
|
|
} else {
|
|
|
|
|
console.log('===============================================================================');
|
|
|
|
|
console.log(message);
|
|
|
|
|
console.log('===============================================================================');
|
|
|
|
|
}
|
|
|
|
|
}
|