File tree 2 files changed +22
-3
lines changed
packages/angular/cli/models
tests/legacy-cli/e2e/tests/misc
2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -103,10 +103,13 @@ export abstract class ArchitectCommand<
103
103
104
104
if ( this . target ) {
105
105
// Add options IF there's only one builder of this kind.
106
- const projectNames = this . getProjectNamesByTarget ( this . target ) ;
106
+ const targetSpec : TargetSpecifier = this . _makeTargetSpecifier ( options ) ;
107
+ const projectNames = targetSpec . project
108
+ ? [ targetSpec . project ]
109
+ : this . getProjectNamesByTarget ( this . target ) ;
110
+
107
111
const builderConfigurations : BuilderConfiguration [ ] = [ ] ;
108
112
for ( const projectName of projectNames ) {
109
- const targetSpec : TargetSpecifier = this . _makeTargetSpecifier ( options ) ;
110
113
const targetDesc = this . _architect . getBuilderConfiguration ( {
111
114
project : projectName ,
112
115
target : targetSpec . target ,
@@ -207,7 +210,7 @@ export abstract class ArchitectCommand<
207
210
// For multi target commands, we always list all projects that have the target.
208
211
return allProjectsForTargetName ;
209
212
} else {
210
- // For single target commands, we try try the default project project first,
213
+ // For single target commands, we try the default project first,
211
214
// then the full list if it has a single project, then error out.
212
215
const maybeDefaultProject = this . _workspace . getDefaultProjectName ( ) ;
213
216
if ( maybeDefaultProject && allProjectsForTargetName . includes ( maybeDefaultProject ) ) {
Original file line number Diff line number Diff line change
1
+ import { expectFileToExist } from '../../utils/fs' ;
2
+ import { ng } from '../../utils/process' ;
3
+ import { updateJsonFile } from '../../utils/project' ;
4
+
5
+ export default async function ( ) {
6
+ await ng ( 'generate' , 'app' , 'secondary-app' ) ;
7
+
8
+ await updateJsonFile ( 'angular.json' , workspaceJson => {
9
+ workspaceJson . defaultProject = undefined ;
10
+ } ) ;
11
+
12
+ await ng ( 'build' , 'secondary-app' ) ;
13
+
14
+ expectFileToExist ( 'dist/secondary-app/index.html' ) ;
15
+ expectFileToExist ( 'dist/secondary-app/main.js' ) ;
16
+ }
You can’t perform that action at this time.
0 commit comments