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>
In my target, I have something like this: <jar destfile=”https://stackoverflow.com/questions/1821803/${store.dir}/temp_final.jar” filesetmanifest=”skip”> <zipgroupfileset dir=”dist” includes=”*.jar”/> <zipgroupfileset dir=”dist/lib” includes=”*.jar” excludes=””/> <manifest> <attribute name=”Main-Class” value=”${main.class}”/> <attribute name=”Class-Path” value=”${mf.classpath}”/> </manifest> </jar> And here is how I build my classpath: <path id=”build.classpath”> <fileset dir=”${basedir}/”> <include name=”${lib.dir}/*.jar”/> </fileset> </path> <pathconvert property=”mf.classpath” pathsep=” “> <path refid=”build.classpath”/> <mapper> <chainedmapper> <flattenmapper/> <globmapper from=”*.jar” to=”lib/*.jar”/> … Read more
Vladimir’s answer is a correct one, but I feel that what he suggests implies repacking all jars in a one big out.jar, which is then feeded to Ant Jar task as a single <zipfileset> or something like that. This two-step approach is unnecessary. I’m not sure whether this is connected with Ant version, but I … 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
As of rev 17 of the Android Developer Tools, the correct way to add a library jar when.using the tools and Eclipse is to create a directory called libs on the same level as your src and assets directories and then drop the jar in there. Nothing else.required, the tools take care of all the … 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.
I’ve just run into the same problem. I haven’t tried it yet, but I plan to include versions of swt.jar for all platforms and load the correct one dynamically in the start of the main method. UPDATE: It worked. build.xml includes all jars: <zipfileset dir=”/home/aromanov/workspace/foo/lib” includes=”swt_linux_gtk_x86.jar”/> <zipfileset dir=”/home/aromanov/workspace/foo/lib” includes=”swt_macosx_x86.jar”/> <zipfileset dir=”/home/aromanov/workspace/foo/lib” includes=”swt_win32_x86.jar”/> <zipfileset dir=”/home/aromanov/workspace/foo/lib” includes=”swt_linux_gtk_x64.jar”/> … Read more
Nexus is primarily a Maven repository, this means one must adapt to the way Maven structures artifacts. Since you’re focused on bulk loading Nexus I suggest looking at the answer to the following question: Upload artifacts to Nexus, without Maven If you wish to stick with ivy read on….. Background Need a Maven POM Your … 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
When you want to use characters which stand for predefined standard entities in attribute value or text, you must write it as entity. Predefined entity covers ” ‘ < > & In your case you have to write replaceregexp match=”app_name">(.*)<” (The single quot limits the attribute value here, when a single quote appear IN the … Read more