@@ -1470,45 +1470,45 @@ namespace ts {
1470
1470
}
1471
1471
}
1472
1472
1473
+ if ( force ) return { type : UpToDateStatusType . ForceBuild } ;
1474
+
1473
1475
// Collect the expected outputs of this project
1474
1476
const outputs = getAllProjectOutputs ( project , ! host . useCaseSensitiveFileNames ( ) ) ;
1475
1477
1476
1478
// Now see if all outputs are newer than the newest input
1477
1479
let oldestOutputFileName = "(none)" ;
1478
1480
let oldestOutputFileTime = maximumDate ;
1479
1481
let newestDeclarationFileContentChangedTime ;
1480
- if ( ! force ) {
1481
- for ( const output of outputs ) {
1482
- // Output is missing; can stop checking
1483
- const outputTime = ts . getModifiedTime ( host , output ) ;
1484
- if ( outputTime === missingFileModifiedTime ) {
1485
- return {
1486
- type : UpToDateStatusType . OutputMissing ,
1487
- missingOutputFileName : output
1488
- } ;
1489
- }
1482
+ for ( const output of outputs ) {
1483
+ // Output is missing; can stop checking
1484
+ const outputTime = ts . getModifiedTime ( host , output ) ;
1485
+ if ( outputTime === missingFileModifiedTime ) {
1486
+ return {
1487
+ type : UpToDateStatusType . OutputMissing ,
1488
+ missingOutputFileName : output
1489
+ } ;
1490
+ }
1490
1491
1491
- if ( outputTime < oldestOutputFileTime ) {
1492
- oldestOutputFileTime = outputTime ;
1493
- oldestOutputFileName = output ;
1494
- }
1492
+ if ( outputTime < oldestOutputFileTime ) {
1493
+ oldestOutputFileTime = outputTime ;
1494
+ oldestOutputFileName = output ;
1495
+ }
1495
1496
1496
- // If an output is older than the newest input, we can stop checking
1497
- if ( outputTime < newestInputFileTime ) {
1498
- return {
1499
- type : UpToDateStatusType . OutOfDateWithSelf ,
1500
- outOfDateOutputFileName : oldestOutputFileName ,
1501
- newerInputFileName : newestInputFileName
1502
- } ;
1503
- }
1497
+ // If an output is older than the newest input, we can stop checking
1498
+ if ( outputTime < newestInputFileTime ) {
1499
+ return {
1500
+ type : UpToDateStatusType . OutOfDateWithSelf ,
1501
+ outOfDateOutputFileName : oldestOutputFileName ,
1502
+ newerInputFileName : newestInputFileName
1503
+ } ;
1504
+ }
1504
1505
1505
- // Keep track of when the most recent time a .d.ts file was changed.
1506
- // In addition to file timestamps, we also keep track of when a .d.ts file
1507
- // had its file touched but not had its contents changed - this allows us
1508
- // to skip a downstream typecheck
1509
- if ( isDeclarationFileName ( output ) ) {
1510
- newestDeclarationFileContentChangedTime = newer ( newestDeclarationFileContentChangedTime , outputTime ) ;
1511
- }
1506
+ // Keep track of when the most recent time a .d.ts file was changed.
1507
+ // In addition to file timestamps, we also keep track of when a .d.ts file
1508
+ // had its file touched but not had its contents changed - this allows us
1509
+ // to skip a downstream typecheck
1510
+ if ( isDeclarationFileName ( output ) ) {
1511
+ newestDeclarationFileContentChangedTime = newer ( newestDeclarationFileContentChangedTime , outputTime ) ;
1512
1512
}
1513
1513
}
1514
1514
@@ -1557,7 +1557,7 @@ namespace ts {
1557
1557
) ;
1558
1558
if ( dependentPackageFileStatus ) return dependentPackageFileStatus ;
1559
1559
1560
- if ( ! force && ! state . buildInfoChecked . has ( resolvedPath ) ) {
1560
+ if ( ! state . buildInfoChecked . has ( resolvedPath ) ) {
1561
1561
state . buildInfoChecked . set ( resolvedPath , true ) ;
1562
1562
const buildInfoPath = getTsBuildInfoEmitOutputFilePath ( project . options ) ;
1563
1563
if ( buildInfoPath ) {
@@ -2079,14 +2079,6 @@ namespace ts {
2079
2079
}
2080
2080
2081
2081
function reportUpToDateStatus ( state : SolutionBuilderState , configFileName : string , status : UpToDateStatus ) {
2082
- if ( state . options . force && ( status . type === UpToDateStatusType . UpToDate || status . type === UpToDateStatusType . UpToDateWithUpstreamTypes ) ) {
2083
- return reportStatus (
2084
- state ,
2085
- Diagnostics . Project_0_is_being_forcibly_rebuilt ,
2086
- relName ( state , configFileName )
2087
- ) ;
2088
- }
2089
-
2090
2082
switch ( status . type ) {
2091
2083
case UpToDateStatusType . OutOfDateWithSelf :
2092
2084
return reportStatus (
@@ -2167,6 +2159,12 @@ namespace ts {
2167
2159
status . version ,
2168
2160
version
2169
2161
) ;
2162
+ case UpToDateStatusType . ForceBuild :
2163
+ return reportStatus (
2164
+ state ,
2165
+ Diagnostics . Project_0_is_being_forcibly_rebuilt ,
2166
+ relName ( state , configFileName )
2167
+ ) ;
2170
2168
case UpToDateStatusType . ContainerOnly :
2171
2169
// Don't report status on "solution" projects
2172
2170
// falls through
0 commit comments