Description
Bug Report
If you build an MsBuild project using the nuget package microsoft.typescript.msbuild, there is a target named TypeScriptDeleteOutputFromOtherConfigs
which runs before CompileTypeScript
.
This target aims to delete tsc...out
files from other "configs" then the "current", whatever that means.
In case you build the project in Debug mode, there will be a file created:
/obj/Debug/<TargetFramework>/Tsc<RandomNumber>.out".
Now if you build this project in Release mode:
/obj/Release/<TargetFramework>/Tsc<RandomNumber>.out".
However this 2. build in Release mode will grab the previous Tsc....out
from the Debug folder. It will delete all the previously built files listed in that file.
Target TypeScriptDeleteOutputFromOtherConfigs
uses property $(BaseIntermediateOutputPath)
which is like ...full path to project...\obj\
.
I don't really understand what this Target aims to do; but couldn't it use propery $(IntermediateOutputPath)
which is like obj\<Configuration>\<TargetFramework>\
?
That way the above issue could be avoided.
I would think it could not cause any harm since this Tsc....out
file is written by the TypeScript targets which by me always put this file into obj/Debug
or obj/Release
, never outside of these.
🔎 Search Terms
TypeScriptDeleteOutputFromOtherConfigs
🕗 Version & Regression Information
It is sure present in:
microsoft.typescript.msbuild v4.4.4
microsoft.typescript.msbuild v4.8.1-rc
🙁 Actual behavior
The 2. build in Release mode grabbed the previous Tsc....out
from the Debug folder, and deleted all the previously built files listed in that file.
This causes the previously built files to get deleted unnecessarily.
In our project structure - which is complex and tricky - it also causes a build error.
(We have a workaround for that, we simply override target TypeScriptDeleteOutputFromOtherConfigs
to do nothing; so this issue is only for the benefit of the community.)
🙂 Expected behavior
Don't really know when TypeScriptDeleteOutputFromOtherConfigs
could be helpful, but it (maybe) should only scan for Tsc....out
files in obj/<TargetFramework>