File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 11import { ArchitectCommand } from '../models/architect-command' ;
22import { Option , CommandScope } from '../models/command' ;
33import { Version } from '../upgrade/version' ;
4+ import { experimental } from '@angular-devkit/core' ;
45
56export interface Options {
67 project ?: string ;
78 configuration ?: string ;
9+ projectType ?: string ;
810 prod : boolean ;
911}
1012
13+
1114export default class BuildCommand extends ArchitectCommand {
1215 public readonly name = 'build' ;
1316 public readonly target = 'build' ;
@@ -38,9 +41,13 @@ export default class BuildCommand extends ArchitectCommand {
3841 delete overrides . configuration ;
3942 delete overrides . prod ;
4043
44+ const filter : experimental . workspace . projectFilter = options . projectType
45+ && ( ( project ) => project . projectType === options . projectType ) ;
46+
4147 return this . runArchitectTarget ( {
4248 project : options . project ,
4349 target : this . target ,
50+ projectFilter : filter ,
4451 configuration,
4552 overrides
4653 } , options ) ;
Original file line number Diff line number Diff line change @@ -164,7 +164,9 @@ export abstract class ArchitectCommand<T = any> extends Command<T> {
164164 if ( ! targetSpec . project && this . target ) {
165165 // This runs each target sequentially.
166166 // Running them in parallel would jumble the log messages.
167- return await from ( this . getAllProjectsForTargetName ( this . target ) ) . pipe (
167+ return await from (
168+ this . getAllProjectsForTargetName ( this . target , targetSpec . projectFilter )
169+ ) . pipe (
168170 concatMap ( project => runSingleTarget ( { ...targetSpec , project } ) ) ,
169171 toArray ( ) ,
170172 ) . toPromise ( ) . then ( results => results . every ( res => res === 0 ) ? 0 : 1 ) ;
@@ -197,8 +199,10 @@ export abstract class ArchitectCommand<T = any> extends Command<T> {
197199 }
198200 }
199201
200- private getAllProjectsForTargetName ( targetName : string ) {
201- return this . _workspace . listProjectNames ( ) . map ( projectName =>
202+ private getAllProjectsForTargetName (
203+ targetName : string , filter ?: experimental . workspace . projectFilter
204+ ) {
205+ return this . _workspace . listProjectNames ( filter ) . map ( projectName =>
202206 this . _architect . listProjectTargets ( projectName ) . includes ( targetName ) ? projectName : null
203207 ) . filter ( x => ! ! x ) ;
204208 }
You can’t perform that action at this time.
0 commit comments