How do I change a property's value based on a conditional in msbuild? -


If I have a certain value, then I would like to change the value of the property. I wrote in C #:

  If (x == "NotAllowed") X = "CorrectedValue;  

This is what I have so far, So please do not laugh:

  & lt; PropertyGroup & gt; & lt; BRANCHNAME & gt; BranchNameNotSet & lt; / BRANCHNAME & gt; & lt; / PropertyGroup & gt; // / Target set BRANCHNAME & lt; Target name = "CheckPropertiesHaveBeenSet" & gt; & lt; error status = "$ (BRANCHNAME) == BranchNameNotSet" text = "something went wrong .. do not enter the branch name" / Gt; & lt; when status = "$ (BRANCHNAME) == Master"> gt;  & lt; BranchName & gt; MasterBrint & lt; / BranchName & gt; & lt; / PropertyGroup & gt; ; & L  

property by using Code:

  & lt; PropertyGroup & gt; & lt; BRANCHNAME & gt; BranchNameNotSet & Lt; / BranchName & gt; & lt; / PropertyGroup & gt; & Lt; Target name = "checkpropertieshebbinet" & gt; & L!; - If the branch stops building with 'BranchNameNotSet' error equal to the name - & gt; & Lt; Error status = "'$ (BRANCHNAME)' == 'BranchNameNotSet'" text = "Something went wrong .. do not enter the branch name" /> & Lt; PropertyGroup & gt; & Lt ;! - If branch name is equal to 'master' then replace branch name - & gt; & Lt; Branch name status = "'$ (BranchName)' == 'Master'" & gt; Masterburch & lt; / BranchName & gt; & Lt; / PropertyGroup & gt; & Lt; / Target & gt; Information on  

when and select :

select, when, or else elements are To eliminate one of the many options, it is used together to select a portion of the code.

Elements can be selected as the hair elements of the project, when and other elements.

In your code sample, when you select when without and within a target, this is not possible.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -