[MSBuild] Overwrite global property.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="uu" >
  <PropertyGroup>
    <aa>1</aa>
  </PropertyGroup>

  <Target Name="t"> <!--try to overwrite value of 'aa'-->
    <PropertyGroup>
      <aa>22</aa>
    </PropertyGroup>

    <Message Text="tt:$(aa) - print 'aa' insdie of t." />

    <CallTarget Targets="tt" />
  </Target>

  <Target Name="tt">
    <Message Text="tt:$(aa) - print 'aa' outside of t, t is not done." />
  </Target>

  <Target Name="u">
    <Message Text="u:$(aa) - print 'aa' outside of t, after t is done." />
  </Target>

  <Target Name="uu">
    <CallTarget Targets="t"/> <!--update 'aa' then print 'aa' inside t-->

    <CallTarget Targets="u"/> <!--print 'aa' outside of t-->
  </Target>
</Project>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: