chore: clean up angularFiles.js

This commit is contained in:
Vojta Jina
2013-06-28 01:47:35 -07:00
parent 29f96c852c
commit 976edc1fc4
4 changed files with 24 additions and 45 deletions

59
angularFiles.js vendored
View File

@@ -114,7 +114,7 @@ angularFiles = {
'test/ngMobile/**/*.js'
],
'jstd': [
'karma': [
'components/jquery/jquery.js',
'test/jquery_remove.js',
'@angularSrc',
@@ -126,18 +126,18 @@ angularFiles = {
'example/personalLog/test/*.js'
],
'jstdExclude': [
'karmaExclude': [
'test/jquery_alias.js',
'src/angular-bootstrap.js',
'src/ngScenario/angular-bootstrap.js'
],
'jstdScenario': [
'karmaScenario': [
'build/angular-scenario.js',
'build/docs/docs-scenario.js'
],
"jstdModules": [
"karmaModules": [
'build/angular.js',
'@angularSrcModules',
'src/ngScenario/browserTrigger.js',
@@ -151,21 +151,7 @@ angularFiles = {
'test/ngMobile/**/*.js'
],
'jstdPerf': [
'@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': [
'karmaJquery': [
'components/jquery/jquery.js',
'test/jquery_alias.js',
'@angularSrc',
@@ -178,7 +164,7 @@ angularFiles = {
'example/personalLog/test/*.js'
],
'jstdJqueryExclude': [
'karmaJqueryExclude': [
'src/angular-bootstrap.js',
'src/ngScenario/angular-bootstrap.js',
'test/jquery_remove.js'
@@ -186,29 +172,22 @@ angularFiles = {
};
if (exports) {
exports.files = angularFiles
exports.mergeFiles = function mergeFiles() {
exports.files = angularFiles;
exports.mergeFilesFor = function() {
var files = [];
[].splice.call(arguments, 0).forEach(function(file) {
if (file.match(/karma/)) {
files.push(file);
} else {
angularFiles[file].forEach(function(f) {
// replace @ref
var match = f.match(/^\@(.*)/);
if (match) {
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);
}
}
});
}
Array.prototype.slice.call(arguments, 0).forEach(function(filegroup) {
angularFiles[filegroup].forEach(function(file) {
// replace @ref
var match = file.match(/^\@(.*)/);
if (match) {
files = files.concat(angularFiles[match[1]]);
} else {
files.push(file);
}
});
});
return files;
}
};
}

View File

@@ -5,8 +5,8 @@ module.exports = function(config) {
sharedConfig(config);
config.set({
files: angularFiles.mergeFiles('jstd'),
exclude: angularFiles.files.jstdExclude,
files: angularFiles.mergeFilesFor('karma'),
exclude: angularFiles.mergeFilesFor('karmaExclude'),
junitReporter: {
outputFile: 'test_out/jqlite.xml',

View File

@@ -5,8 +5,8 @@ module.exports = function(config) {
sharedConfig(config);
config.set({
files: angularFiles.mergeFiles('jstdJquery'),
exclude: angularFiles.files.jstdJqueryExclude,
files: angularFiles.mergeFilesFor('karmaJquery'),
exclude: angularFiles.mergeFilesFor('karmaJqueryExclude'),
junitReporter: {
outputFile: 'test_out/jquery.xml',

View File

@@ -5,7 +5,7 @@ module.exports = function(config) {
sharedConfig(config);
config.set({
files: angularFiles.mergeFiles('jstdModules', 'angularSrcModules'),
files: angularFiles.mergeFilesFor('karmaModules', 'angularSrcModules'),
junitReporter: {
outputFile: 'test_out/modules.xml',