PDA

View Full Version : Conditional build rule


paxil
10-12-2017, 12:51 PM
I'm trying to build a step with the conditional rule such as:

Build only if %VERSION% does not contain ["1.0.0" OR "2.0.0"]

This works fine for a single value when I just put 1.0.0, but does this need to be scripted in order to add a check for additional values?

kinook
10-12-2017, 01:31 PM
Build only if macro or expression

["%VERSION%" = "1.0.0" Or "%VERSION%" = "2.0.0"]

is false

paxil
10-12-2017, 02:24 PM
Thanks for quick response, but the VERSION number will be in the format of (1.0.0.x) (where x = build iteration), this example looks for exact matches.

I just need it to verify the first three places (e.g. so if VERSION does not contain at least 1.0.0 or 2.0.0, this build step will fail)

kinook
10-12-2017, 02:33 PM
[Left("%VERSION%", 5) = "1.0.0" Or Left("%VERSION%", 5) = "2.0.0"]

paxil
10-12-2017, 03:03 PM
Great, that did the trick.

As usual, thanks for your help!