Hi!
I need to use a define that checks multiple bools so that I don’t need to type it all the time.
something that using that define would equal to #if (lib >= "1.0.0" && !hl || !sys)
I think you need more parentheses. Either #if (lib >= "1.0.0" && (!hl || !sys))
or #if ((lib >= "1.0.0" && !hl) || !sys)
.
Oh, so like <define name="Defined" if="#if (lib >= "1.0.0" && (!hl || !sys))" />
?
I didn’t realize you were talking about project.xml. No, that’s different. It doesn’t allow parentheses at all, and instead of &&
it just takes spaces.
<!-- Since there are no parentheses, you can't group (!hl || !sys). -->
<define name="Defined" if="${lib>=1.0.0} !hl || ${lib>=1.0.0} !sys" />
<!-- But you could get around this using both if and unless. -->
<define name="Defined" if="${lib>=1.0.0}" unless="hl sys" />
<define name="Defined" if="!hl || !sys" unless="${lib<1.0.0}" />
<!-- Or using a section. Sections can also help with grouping. -->
<section if="${lib>=1.0.0}">
<define name="Defined" if="!hl || !sys" />
<define name="Defined2" if="hl" />
</section>