test if an MSBuild property is defined? -
in msbuild, possible create msbuild condition (or situation) evaluate whether property 'defined' (presuming previous assigning property value somewhere)?
the following seems little clumsy reliable:
<propertygroup label="undefined state"> <defined></defined> </propertygroup> <choose> <when condition="('$(defined)' == '' or '$(defined)' != '')"> <message text="defined probably/likely/assuredly defined"/> </when> <otherwise> <message text="defined reportedly/maybe/possibly not defined"/> </otherwise> <choose>
there exists common method overriding properties.
sample c:\windows\microsoft.net\framework\v4.0.30319\microsoft.common.targets
<propertygroup> <targetframeworkidentifier condition="'$(targetframeworkidentifier)' == ''">.netframework</targetframeworkidentifier> <targetframeworkversion condition=" '$(targetframeworkversion)' == '' ">v4.0</targetframeworkversion> </propertygroup>
if try value $(neverdefinedproperty) empty string. can describe problem want solve?
Comments
Post a Comment