Reputation: 79
Is there a way of having a condition on the tar task so as to only include certain files if a condition is met? I want some files to always be included and some to only be included when a condition is true.
Upvotes: 0
Views: 460
Reputation: 24154
You could use conditional targets to wrap the <tar>
task.
<target name="tar1" if="condition1">
<tar>
<tarfileset dir="${dir}">
<include name="**/*.alwaysIncluded" />
<include name="**/*.conditionallyIncluded" />
</tarfileset>
</tar>
</target>
<target name="tar2" unless="condition1">
<tar>
<tarfileset dir="${dir}">
<include name="**/*.alwaysIncluded" />
</tarfileset>
</tar>
</target>
Upvotes: 1