Ant task to run an Ant target only if a file exists?
Available and Condition <target name=”check-abc”> <available file=”abc.txt” property=”abc.present”/> </target> <target name=”do-if-abc” depends=”check-abc” if=”abc.present”> … </target>
Available and Condition <target name=”check-abc”> <available file=”abc.txt” property=”abc.present”/> </target> <target name=”do-if-abc” depends=”check-abc” if=”abc.present”> … </target>
The fundamental issue with Make and Java is that Make works on the premise that you have specify a dependency, and then a rule to resolve that dependency. With basic C, that typically “to convert a main.c file to a main.o file, run “cc main.c”. You can do that in java, but you quickly learn … Read more
In Maven: The Definitive Guide, I wrote about the differences between Maven and Ant in the introduction the section title is “The Differences Between Ant and Maven”. Here’s an answer that is a combination of the info in that introduction with some additional notes. A Simple Comparison I’m only showing you this to illustrate the … Read more
Step 1: D:\projects\Phonegap\Example> cordova plugin rm org.apache.cordova.console –save add the –save so that it removes the plugin from the config.xml file. Step 2: To generate a release build for Android, we first need to make a small change to the AndroidManifest.xml file found in platforms/android. Edit the file and change the line: <application android:debuggable=”true” android:hardwareAccelerated=”true” … Read more
I had this problem after updating ADT. I was storing all of my JAR files in a folder called “lib” and adding the jars to the build path the normal Eclipse way. This worked fine until my update. After my update, I was getting the NoClassDefFoundError for a class that I could clearly see was … Read more
Yes, you’ve downloaded and installed the Java Runtime Environment (JRE) instead of the Java Development Kit (JDK). The latter has the tools.jar, java.exe, javac.exe, etc.
Ant is already installed on some older versions of Mac OS X, so you should run ant -version to test if it is installed before attempting to install it. If it is not already installed, then your best bet is to install Homebrew (brew install ant) or MacPorts (sudo port install apache-ant), and use those … Read more
The -p or -projecthelp option does exactly this, so you can just try: ant -p build.xml From ant’s command line documentation: The -projecthelp option prints out a list of the build file’s targets. Targets that include a description attribute are listed as “Main targets”, those without a description are listed as “Other targets”, then the … Read more
I don’t use Gradle in anger myself (just a toy project so far) [author means they have used Gradle on only a toy project so far, not that Gradle is a toy project – see comments], but I’d say that the reasons one would consider using it would be because of the frustrations of Ant … Read more
Ant Runtime Simply set includeantruntime=”false”: <javac includeantruntime=”false” …>…</javac> If you have to use the javac-task multiple times you might want to consider using PreSetDef to define your own javac-task that always sets includeantruntime=”false”. Additional Details From http://www.coderanch.com/t/503097/tools/warning-includeantruntime-was-not-set: That’s caused by a misfeature introduced in Ant 1.8. Just add an attribute of that name to the … Read more