Removing a property in Ant and removing a property in Ant using a condition

How did you cancel a property in ant? so is it completely removed as a property?

<condition property="proguard.config" value="proguard.cfg">
      <isset property="proguarded"/>
</condition>


 <condition property="proguard.config" value="">
      <not>
      <isset property="proguarded"/>
      </not>
</condition>

It would seem that it worked. However, proguard works even if a property such as proguard.config exists. So, how can I remove proguard.config as a property as a whole conditionally? I know that if proguard sees that there is a proguard.config property in general in the .properties file, it will be launched.

+5
source share
1 answer

Ant statement Property Property :

Properties are immutable: anyone who sets a property first freezes it for the rest of the assembly; they are certainly not variables.

There are several workarounds:


, proguarded Ant, . , :

<target name="proguarded-target" if="proguarded">
  ...
</target>

<target name="not-proguarded-target" unless="proguarded">
  ...
</target>
+8

All Articles