mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-29 05:15:38 +08:00
chore: clean up angularFiles.js
This commit is contained in:
59
angularFiles.js
vendored
59
angularFiles.js
vendored
@@ -108,7 +108,7 @@ angularFiles = {
|
|||||||
'test/ngMock/*.js'
|
'test/ngMock/*.js'
|
||||||
],
|
],
|
||||||
|
|
||||||
'jstd': [
|
'karma': [
|
||||||
'lib/jquery/jquery.js',
|
'lib/jquery/jquery.js',
|
||||||
'test/jquery_remove.js',
|
'test/jquery_remove.js',
|
||||||
'@angularSrc',
|
'@angularSrc',
|
||||||
@@ -120,18 +120,18 @@ angularFiles = {
|
|||||||
'example/personalLog/test/*.js'
|
'example/personalLog/test/*.js'
|
||||||
],
|
],
|
||||||
|
|
||||||
'jstdExclude': [
|
'karmaExclude': [
|
||||||
'test/jquery_alias.js',
|
'test/jquery_alias.js',
|
||||||
'src/angular-bootstrap.js',
|
'src/angular-bootstrap.js',
|
||||||
'src/ngScenario/angular-bootstrap.js'
|
'src/ngScenario/angular-bootstrap.js'
|
||||||
],
|
],
|
||||||
|
|
||||||
'jstdScenario': [
|
'karmaScenario': [
|
||||||
'build/angular-scenario.js',
|
'build/angular-scenario.js',
|
||||||
'build/docs/docs-scenario.js'
|
'build/docs/docs-scenario.js'
|
||||||
],
|
],
|
||||||
|
|
||||||
"jstdModules": [
|
"karmaModules": [
|
||||||
'build/angular.js',
|
'build/angular.js',
|
||||||
'src/ngMock/angular-mocks.js',
|
'src/ngMock/angular-mocks.js',
|
||||||
'src/ngCookies/cookies.js',
|
'src/ngCookies/cookies.js',
|
||||||
@@ -148,21 +148,7 @@ angularFiles = {
|
|||||||
'test/ngSanitize/filter/*.js'
|
'test/ngSanitize/filter/*.js'
|
||||||
],
|
],
|
||||||
|
|
||||||
'jstdPerf': [
|
'karmaJquery': [
|
||||||
'@angularSrc',
|
|
||||||
'@angularSrcModules',
|
|
||||||
'src/ngMock/angular-mocks.js',
|
|
||||||
'perf/data/*.js',
|
|
||||||
'perf/testUtils.js',
|
|
||||||
'perf/*.js'
|
|
||||||
],
|
|
||||||
|
|
||||||
'jstdPerfExclude': [
|
|
||||||
'src/ng/angular-bootstrap.js',
|
|
||||||
'src/ngScenario/angular-bootstrap.js'
|
|
||||||
],
|
|
||||||
|
|
||||||
'jstdJquery': [
|
|
||||||
'lib/jquery/jquery.js',
|
'lib/jquery/jquery.js',
|
||||||
'test/jquery_alias.js',
|
'test/jquery_alias.js',
|
||||||
'@angularSrc',
|
'@angularSrc',
|
||||||
@@ -175,7 +161,7 @@ angularFiles = {
|
|||||||
'example/personalLog/test/*.js'
|
'example/personalLog/test/*.js'
|
||||||
],
|
],
|
||||||
|
|
||||||
'jstdJqueryExclude': [
|
'karmaJqueryExclude': [
|
||||||
'src/angular-bootstrap.js',
|
'src/angular-bootstrap.js',
|
||||||
'src/ngScenario/angular-bootstrap.js',
|
'src/ngScenario/angular-bootstrap.js',
|
||||||
'test/jquery_remove.js'
|
'test/jquery_remove.js'
|
||||||
@@ -183,29 +169,22 @@ angularFiles = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (exports) {
|
if (exports) {
|
||||||
exports.files = angularFiles
|
exports.files = angularFiles;
|
||||||
exports.mergeFiles = function mergeFiles() {
|
exports.mergeFilesFor = function() {
|
||||||
var files = [];
|
var files = [];
|
||||||
|
|
||||||
[].splice.call(arguments, 0).forEach(function(file) {
|
Array.prototype.slice.call(arguments, 0).forEach(function(filegroup) {
|
||||||
if (file.match(/karma/)) {
|
angularFiles[filegroup].forEach(function(file) {
|
||||||
files.push(file);
|
// replace @ref
|
||||||
} else {
|
var match = file.match(/^\@(.*)/);
|
||||||
angularFiles[file].forEach(function(f) {
|
if (match) {
|
||||||
// replace @ref
|
files = files.concat(angularFiles[match[1]]);
|
||||||
var match = f.match(/^\@(.*)/);
|
} else {
|
||||||
if (match) {
|
files.push(file);
|
||||||
var deps = angularFiles[match[1]];
|
}
|
||||||
files = files.concat(deps);
|
});
|
||||||
} else {
|
|
||||||
if (!/jstd|jasmine/.test(f)) { //TODO(i): remove once we don't have jstd/jasmine in repo
|
|
||||||
files.push(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return files;
|
return files;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ module.exports = function(config) {
|
|||||||
sharedConfig(config);
|
sharedConfig(config);
|
||||||
|
|
||||||
config.set({
|
config.set({
|
||||||
files: angularFiles.mergeFiles('jstd'),
|
files: angularFiles.mergeFilesFor('karma'),
|
||||||
exclude: angularFiles.files.jstdExclude,
|
exclude: angularFiles.mergeFilesFor('karmaExclude'),
|
||||||
|
|
||||||
junitReporter: {
|
junitReporter: {
|
||||||
outputFile: 'test_out/jqlite.xml',
|
outputFile: 'test_out/jqlite.xml',
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ module.exports = function(config) {
|
|||||||
sharedConfig(config);
|
sharedConfig(config);
|
||||||
|
|
||||||
config.set({
|
config.set({
|
||||||
files: angularFiles.mergeFiles('jstdJquery'),
|
files: angularFiles.mergeFilesFor('karmaJquery'),
|
||||||
exclude: angularFiles.files.jstdJqueryExclude,
|
exclude: angularFiles.mergeFilesFor('karmaJqueryExclude'),
|
||||||
|
|
||||||
junitReporter: {
|
junitReporter: {
|
||||||
outputFile: 'test_out/jquery.xml',
|
outputFile: 'test_out/jquery.xml',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ module.exports = function(config) {
|
|||||||
sharedConfig(config);
|
sharedConfig(config);
|
||||||
|
|
||||||
config.set({
|
config.set({
|
||||||
files: angularFiles.mergeFiles('jstdModules', 'angularSrcModules'),
|
files: angularFiles.mergeFilesFor('karmaModules', 'angularSrcModules'),
|
||||||
|
|
||||||
junitReporter: {
|
junitReporter: {
|
||||||
outputFile: 'test_out/modules.xml',
|
outputFile: 'test_out/modules.xml',
|
||||||
|
|||||||
Reference in New Issue
Block a user