1
1
import { spawn } from 'child_process' ;
2
- import { existsSync , statSync , writeFileSync , readFileSync } from 'fs-extra' ;
3
- import { join , basename } from 'path' ;
4
- import { task , src , dest } from 'gulp' ;
2
+ import { existsSync , readFileSync , statSync , writeFileSync } from 'fs-extra' ;
3
+ import { basename , join } from 'path' ;
4
+ import { dest , src , task } from 'gulp' ;
5
5
import { execNodeTask , execTask , sequenceTask } from '../util/task_helpers' ;
6
6
import {
7
- DIST_RELEASE , DIST_BUNDLES , DIST_MATERIAL , COMPONENTS_DIR , LICENSE_BANNER , DIST_ROOT
7
+ COMPONENTS_DIR ,
8
+ DIST_BUNDLES ,
9
+ DIST_MATERIAL ,
10
+ DIST_RELEASE ,
11
+ DIST_ROOT ,
12
+ LICENSE_BANNER ,
13
+ PROJECT_ROOT ,
8
14
} from '../constants' ;
9
15
import * as minimist from 'minimist' ;
10
16
@@ -40,7 +46,16 @@ task('build:release', sequenceTask(
40
46
41
47
/** Task that combines intermediate build artifacts into the release package structure. */
42
48
task ( ':package:release' , sequenceTask (
43
- [ ':package:typings' , ':package:umd' , ':package:fesm' , ':package:assets' , ':package:theming' ] ,
49
+ // Run in parallel
50
+ [
51
+ ':package:typings' ,
52
+ ':package:umd' ,
53
+ ':package:fesm' ,
54
+ ':package:assets' ,
55
+ ':package:theming' ,
56
+ ':package:license'
57
+ ] ,
58
+ // Run in sequence
44
59
':inline-metadata-resources' ,
45
60
':package:metadata' ,
46
61
) ) ;
@@ -75,8 +90,12 @@ task(':inline-metadata-resources', () => {
75
90
} ) ;
76
91
} ) ;
77
92
93
+ /** Copy static assets (package.json, README.md) to the release package. */
78
94
task ( ':package:assets' , ( ) => src ( assetsGlob ) . pipe ( dest ( DIST_RELEASE ) ) ) ;
79
95
96
+ /** Copy the license to the release package. */
97
+ task ( ':package:license' , ( ) => src ( join ( PROJECT_ROOT , 'LICENSE' ) ) . pipe ( dest ( DIST_RELEASE ) ) ) ;
98
+
80
99
/** Copy all d.ts except the special flat typings from ngc to typings/ in the release package. */
81
100
task ( ':package:typings' , ( ) => {
82
101
return src ( typingsGlob )
@@ -98,9 +117,11 @@ task(':package:theming', [':bundle:theming-scss'],
98
117
99
118
/** Bundles all scss requires for theming into a single scss file in the root of the package. */
100
119
task ( ':bundle:theming-scss' , execNodeTask (
101
- 'scss-bundle' , 'scss-bundle' , [ '-e' , themingEntryPointPath , '-d' , themingBundlePath ] , {
102
- silentStdout : true
103
- }
120
+ 'scss-bundle' ,
121
+ 'scss-bundle' , [
122
+ '-e' , themingEntryPointPath ,
123
+ '-d' , themingBundlePath
124
+ ] , { silentStdout : true }
104
125
) ) ;
105
126
106
127
/** Make sure we're logged in. */
0 commit comments