MSBuild - Target Dependent Imports

I want to make the import dependent on the purpose for which I invoke MSBuild from the command line, but I find it difficult to determine how to programmatically access the target name (s). File file was called using

t <Import Project="some.targets" Condition="$(TargetName) == myTarget"/>

In general, is there a way to reset all the specific environment variables that exist at runtime of the proj file?

+3
source share
1 answer

Unfortunately, I do not think that you can access the target names specified on the command line from the script assembly itself. What you are trying to do, maybe there is another approach that you can take.

Said Ibrahim Hashimi

: Microsoft Build Engine: MSBuild Team Foundation Build

+3

Source: https://habr.com/ru/post/1713761/


All Articles