Here's a simple Ant build file:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Project" default="build" basedir=".">
<property name="compressAssets" value="false"/>
<target name="build" depends="compress-assets"/>
<target name="compress-assets" if="compressAssets">
<echo message="executed"/>
</target>
</project>
compressAssets is set to false, so how come the compress-assets target is executed every time? Note the if property on the target.
if does not check for the value of the property, it checks if the property has been set.
From the documentation:
<target name="build-module-A" if="module-A-present"/>
[...] if the
module-A-presentproperty is set (to any value, e.g. false), the target will be run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With