From 97d31e3cdecb9182290860a260562531ffa05c24 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Sun, 26 Mar 2017 21:05:21 +0200 Subject: [PATCH] build: fix serve task * Currently when serving the dev-app or e2e-app and chanages are recognized, the library task will run. This task clears the whole `dist/` and rebuilds then. * This is problematic because sometimes only the library will be rebuilt and for example the `dev-app` won't be rebuilt. After the task ran, the `dev-app` is removed and the serve task will crash. --- tools/gulp/tasks/library.ts | 3 ++- tools/gulp/tasks/lint.ts | 2 +- tools/gulp/tasks/payload.ts | 2 +- tools/gulp/tasks/release.ts | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/gulp/tasks/library.ts b/tools/gulp/tasks/library.ts index 2de4da5c29d4..72c9f56b9582 100644 --- a/tools/gulp/tasks/library.ts +++ b/tools/gulp/tasks/library.ts @@ -21,8 +21,9 @@ const bundlesDir = DIST_BUNDLES; const esmMainFile = join(materialDir, 'index.js'); +task('library', sequenceTask('clean', 'library:build')); + task('library:build', sequenceTask( - 'clean', ['library:build:esm', 'library:assets'], // Inline assets into ESM output. 'library:assets:inline', diff --git a/tools/gulp/tasks/lint.ts b/tools/gulp/tasks/lint.ts index 3bec3c40aa55..adb8fdf316d0 100644 --- a/tools/gulp/tasks/lint.ts +++ b/tools/gulp/tasks/lint.ts @@ -5,7 +5,7 @@ import {DIST_MATERIAL} from '../constants'; gulp.task('lint', ['tslint', 'stylelint', 'madge']); /** Task that runs madge to detect circular dependencies. */ -gulp.task('madge', ['library:build'], execNodeTask('madge', ['--circular', DIST_MATERIAL])); +gulp.task('madge', ['library'], execNodeTask('madge', ['--circular', DIST_MATERIAL])); /** Task to lint Angular Material's scss stylesheets. */ gulp.task('stylelint', execNodeTask( diff --git a/tools/gulp/tasks/payload.ts b/tools/gulp/tasks/payload.ts index 4d10d4c373cd..7d643c3baabc 100644 --- a/tools/gulp/tasks/payload.ts +++ b/tools/gulp/tasks/payload.ts @@ -9,7 +9,7 @@ import {openFirebaseDashboardDatabase} from '../util/firebase'; const bundlesDir = join(DIST_ROOT, 'bundles'); /** Task which runs test against the size of whole library. */ -task('payload', ['library:build'], () => { +task('payload', ['library'], () => { let results = { umd_kb: getBundleSize('material.umd.js'), diff --git a/tools/gulp/tasks/release.ts b/tools/gulp/tasks/release.ts index 8ae3c4d2b2a0..c5d718174315 100644 --- a/tools/gulp/tasks/release.ts +++ b/tools/gulp/tasks/release.ts @@ -34,7 +34,7 @@ const themingBundlePath = join(DIST_RELEASE, '_theming.scss'); const prebuiltThemeGlob = join(DIST_MATERIAL, '**/theming/prebuilt/*.css'); task('build:release', sequenceTask( - 'library:build', + 'library', ':package:release', ));