mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: add empty material-moment-adapter package (#6086)
This commit is contained in:
committed by
Jeremy Elbourn
parent
ec4ea060a5
commit
412c9fc4bc
@@ -1,9 +1,10 @@
|
||||
import {createPackageBuildTasks} from 'material2-build-tools';
|
||||
import {cdkPackage, examplesPackage, materialPackage} from './packages';
|
||||
import {cdkPackage, examplesPackage, materialPackage, momentAdapterPackage} from './packages';
|
||||
|
||||
createPackageBuildTasks(cdkPackage);
|
||||
createPackageBuildTasks(materialPackage);
|
||||
createPackageBuildTasks(examplesPackage);
|
||||
createPackageBuildTasks(momentAdapterPackage);
|
||||
|
||||
import './tasks/ci';
|
||||
import './tasks/clean';
|
||||
|
||||
@@ -4,6 +4,8 @@ import {join} from 'path';
|
||||
export const cdkPackage = new BuildPackage('cdk');
|
||||
export const materialPackage = new BuildPackage('material', [cdkPackage]);
|
||||
export const examplesPackage = new BuildPackage('material-examples', [materialPackage, cdkPackage]);
|
||||
export const momentAdapterPackage = new BuildPackage('material-moment-adapter',
|
||||
[materialPackage, cdkPackage]);
|
||||
|
||||
// To avoid refactoring of the project the material package will map to the source path `lib/`.
|
||||
materialPackage.packageRoot = join(buildConfig.packagesDir, 'lib');
|
||||
|
||||
@@ -34,7 +34,7 @@ const examplesPath = path.join(packagesDir, 'material-examples');
|
||||
/** Output path of the module that is being created */
|
||||
const outputModuleFilename = path.join(examplesPath, 'example-module.ts');
|
||||
|
||||
/** Build ecmascript module import statements */
|
||||
/** Build ES module import statements */
|
||||
function buildImportsTemplate(metadata: ExampleMetadata): string {
|
||||
const components = metadata.additionalComponents.concat(metadata.component);
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import * as minimist from 'minimist';
|
||||
export const releasePackages = [
|
||||
'cdk',
|
||||
'material',
|
||||
'material-moment-adapter'
|
||||
];
|
||||
|
||||
/** Parse command-line arguments for release task. */
|
||||
|
||||
@@ -10,8 +10,9 @@ const {packagesDir, projectDir} = buildConfig;
|
||||
/** Builds everything that is necessary for karma. */
|
||||
task(':test:build', sequenceTask(
|
||||
'clean',
|
||||
// Build ESM output of Material that also includes all test files.
|
||||
'material:build-tests',
|
||||
// Build tests for all different packages by just building the tests of the moment-adapter
|
||||
// package. All dependencies of that package (material, cdk) will be built as well.
|
||||
'material-moment-adapter:build-tests'
|
||||
));
|
||||
|
||||
/**
|
||||
@@ -20,7 +21,7 @@ task(':test:build', sequenceTask(
|
||||
*/
|
||||
task('test:single-run', [':test:build'], (done: () => void) => {
|
||||
// Load karma not outside. Karma pollutes Promise with a different implementation.
|
||||
let karma = require('karma');
|
||||
const karma = require('karma');
|
||||
|
||||
new karma.Server({
|
||||
configFile: join(projectDir, 'test/karma.conf.js'),
|
||||
@@ -44,12 +45,12 @@ task('test:single-run', [':test:build'], (done: () => void) => {
|
||||
* This task should be used when running unit tests locally.
|
||||
*/
|
||||
task('test', [':test:build'], () => {
|
||||
let patternRoot = join(packagesDir, '**/*');
|
||||
const patternRoot = join(packagesDir, '**/*');
|
||||
// Load karma not outside. Karma pollutes Promise with a different implementation.
|
||||
let karma = require('karma');
|
||||
const karma = require('karma');
|
||||
|
||||
// Configure the Karma server and override the autoWatch and singleRun just in case.
|
||||
let server = new karma.Server({
|
||||
const server = new karma.Server({
|
||||
configFile: join(projectDir, 'test/karma.conf.js'),
|
||||
autoWatch: false,
|
||||
singleRun: false
|
||||
@@ -57,7 +58,7 @@ task('test', [':test:build'], () => {
|
||||
|
||||
// Refreshes Karma's file list and schedules a test run.
|
||||
// Tests will only run if TypeScript compilation was successful.
|
||||
let runTests = (err?: Error) => {
|
||||
const runTests = (err?: Error) => {
|
||||
if (!err) {
|
||||
server.refreshFiles().then(() => server._injector.get('executor').schedule());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user