Reputation: 4956
I actually have two related questions:
<injar file="${build}/myjar.jar" />
?Thanks a lot.
Martin
Upvotes: 3
Views: 4510
Reputation: 42615
Of course you can use Ant variables. However from my point of view it is easier to write all command-line options into the body of the proguard task:
<taskdef resource="proguard/ant/task.properties" classpath="lib/proguard.jar" />
<proguard>
-libraryjars "${java.home}/lib/rt.jar"
-injars "${jar.name}"
-outjars build/temp.jar
-keep class test.Main { public static void main(java.lang.String[]); }
-dontwarn
-dontoptimize
-dontobfuscate
</proguard>
For converting a defined Class path to a string that can be included into the proguard definition you can use the Ant task PathConvert. The first example on the linked page should be what you need.
Update: How to get the quotes around the path entries has been answered here: How to properly quote a path in an ant task?
Upvotes: 4
Reputation: 16235
To answer your first question, yes. Expansion of variables like that in a build file is a feature of Ant. It will work with any tasks you use.
Upvotes: 1