build: faster building of tests (#4509)

This commit is contained in:
Paul Gschwendtner
2017-05-12 23:30:12 +02:00
committed by Kara
parent 3953d6eb37
commit 32c3ef4a69
6 changed files with 15 additions and 11 deletions
+1 -2
View File
@@ -11,6 +11,5 @@
},
"include": [
"**/*.spec.ts"
],
"files": null
]
}
+1 -2
View File
@@ -11,6 +11,5 @@
},
"include": [
"**/*.spec.ts"
],
"files": null
]
}
+2 -2
View File
@@ -42,8 +42,8 @@ System.config({
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
// Path mappings for local packages that can be imported inside of tests.
'@angular/material': 'dist/bundles/material.umd.js',
'@angular/cdk': 'dist/bundles/cdk.umd.js',
'@angular/material': 'dist/packages/material/index.js',
'@angular/cdk': 'dist/packages/cdk/index.js',
},
packages: {
// Thirdparty barrels.
-1
View File
@@ -38,7 +38,6 @@ module.exports = (config) => {
// Includes all package tests and source files into karma. Those files will be watched.
// This pattern also matches all all sourcemap files and TypeScript files for debugging.
{pattern: 'dist/packages/**/*', included: false, watched: true},
{pattern: 'dist/bundles/*.umd.js', included: false, watched: true},
],
customLaunchers: customLaunchers,
+2 -4
View File
@@ -9,10 +9,8 @@ const runSequence = require('run-sequence');
/** Builds everything that is necessary for karma. */
task(':test:build', sequenceTask(
'clean',
// Build the material bundles without any test files. (CDK will be also built)
'material:build',
// Additionally build the test files for material and the CDK.
['material:build:esm:tests', 'cdk:build:esm:tests']
// Build ESM output of Material that also includes all test files.
'material:build-tests',
));
/**
+9
View File
@@ -44,6 +44,15 @@ export function createPackageBuildTasks(packageName: string, requiredPackages: s
`${packageName}:build:bundles`,
));
task(`${packageName}:build-tests`, sequenceTask(
// Build all required tests before building.
...requiredPackages.map(pkgName => `${pkgName}:build-tests`),
// Build the ESM output that includes all test files. Also build assets for the package.
[`${packageName}:build:esm:tests`, `${packageName}:assets`],
// Inline assets into ESM output.
`${packageName}:assets:inline`
));
/**
* Release tasks for the package. Tasks compose the release output for the package.
*/