Skip to content

Commit

Permalink
chore: clean up angularFiles.js
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtajina committed Jun 28, 2013
1 parent 29f96c8 commit 976edc1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 45 deletions.
59 changes: 19 additions & 40 deletions angularFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ angularFiles = {
'test/ngMobile/**/*.js'
],

'jstd': [
'karma': [
'components/jquery/jquery.js',
'test/jquery_remove.js',
'@angularSrc',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -178,37 +164,30 @@ angularFiles = {
'example/personalLog/test/*.js'
],

'jstdJqueryExclude': [
'karmaJqueryExclude': [
'src/angular-bootstrap.js',
'src/ngScenario/angular-bootstrap.js',
'test/jquery_remove.js'
]
};

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;
}
};
}
4 changes: 2 additions & 2 deletions karma-jqlite.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions karma-jquery.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion karma-modules.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 976edc1

Please sign in to comment.