@@ -607,10 +607,7 @@ namespace ts {
607
607
}
608
608
609
609
function getBuildGraph ( configFileNames : ReadonlyArray < string > ) {
610
- const resolvedNames : ResolvedConfigFileName [ ] | undefined = resolveProjectNames ( configFileNames ) ;
611
- if ( resolvedNames === undefined ) return undefined ;
612
-
613
- return createDependencyGraph ( resolvedNames ) ;
610
+ return createDependencyGraph ( resolveProjectNames ( configFileNames ) ) ;
614
611
}
615
612
616
613
function getGlobalDependencyGraph ( ) {
@@ -1114,12 +1111,9 @@ namespace ts {
1114
1111
projectStatus . setValue ( proj . options . configFilePath as ResolvedConfigFilePath , { type : UpToDateStatusType . UpToDate , newestDeclarationFileContentChangedTime : priorNewestUpdateTime } as UpToDateStatus ) ;
1115
1112
}
1116
1113
1117
- function getFilesToClean ( configFileNames : ReadonlyArray < ResolvedConfigFileName > ) : string [ ] | undefined {
1118
- const resolvedNames : ResolvedConfigFileName [ ] | undefined = resolveProjectNames ( configFileNames ) ;
1119
- if ( resolvedNames === undefined ) return undefined ;
1120
-
1114
+ function getFilesToClean ( configFileNames : ReadonlyArray < string > ) : string [ ] | undefined {
1121
1115
// Get the same graph for cleaning we'd use for building
1122
- const graph = createDependencyGraph ( resolvedNames ) ;
1116
+ const graph = getBuildGraph ( configFileNames ) ;
1123
1117
if ( graph === undefined ) return undefined ;
1124
1118
1125
1119
const filesToDelete : string [ ] = [ ] ;
@@ -1139,22 +1133,8 @@ namespace ts {
1139
1133
return filesToDelete ;
1140
1134
}
1141
1135
1142
- function getAllProjectsInScope ( ) : ReadonlyArray < ResolvedConfigFileName > | undefined {
1143
- const resolvedNames = resolveProjectNames ( rootNames ) ;
1144
- if ( resolvedNames === undefined ) return undefined ;
1145
- const graph = createDependencyGraph ( resolvedNames ) ;
1146
- if ( graph === undefined ) return undefined ;
1147
- return graph . buildQueue ;
1148
- }
1149
-
1150
1136
function cleanAllProjects ( ) {
1151
- const resolvedNames : ReadonlyArray < ResolvedConfigFileName > | undefined = getAllProjectsInScope ( ) ;
1152
- if ( resolvedNames === undefined ) {
1153
- reportStatus ( Diagnostics . Skipping_clean_because_not_all_projects_could_be_located ) ;
1154
- return ExitStatus . DiagnosticsPresent_OutputsSkipped ;
1155
- }
1156
-
1157
- const filesToDelete = getFilesToClean ( resolvedNames ) ;
1137
+ const filesToDelete = getFilesToClean ( rootNames ) ;
1158
1138
if ( filesToDelete === undefined ) {
1159
1139
reportStatus ( Diagnostics . Skipping_clean_because_not_all_projects_could_be_located ) ;
1160
1140
return ExitStatus . DiagnosticsPresent_OutputsSkipped ;
@@ -1176,7 +1156,7 @@ namespace ts {
1176
1156
return resolveConfigFileProjectName ( resolvePath ( host . getCurrentDirectory ( ) , name ) ) ;
1177
1157
}
1178
1158
1179
- function resolveProjectNames ( configFileNames : ReadonlyArray < string > ) : ResolvedConfigFileName [ ] | undefined {
1159
+ function resolveProjectNames ( configFileNames : ReadonlyArray < string > ) : ResolvedConfigFileName [ ] {
1180
1160
return configFileNames . map ( resolveProjectName ) ;
1181
1161
}
1182
1162
0 commit comments