How to run all JUnit tests in a category/suite with Ant?

Right, I got it working with <batchtest> quite simply: <junit showoutput=”true” printsummary=”yes” fork=”yes”> <formatter type=”xml”/> <classpath refid=”test.classpath”/> <batchtest todir=”${test.reports}”> <fileset dir=”${classes}”> <include name=”**/FastTestSuite.class”/> </fileset> </batchtest> </junit> I had tried <batchtest> earlier, but had made the silly mistake of using “**/FastTestSuite.java” instead of “**/FastTestSuite.class” in the <include> element… Sorry about that 🙂 NB: it’s necessary to … Read more

adding non-code resources to jar file using Ant

You shouldn’t have an includesfile attribute in a target to start with, and I suspect you’ve misunderstood the point of it anyway – the idea is that the file you specify with includesfile contains patterns for which files to include, if you don’t want to put them into your Ant file. It strikes me that … Read more

Android signing with Ant

If you have Ant version < 1.8.3 (ant -version) try this approach for the issue with JDK 7 (based on the previous answer): Add signjarjdk7 to ANDROID_SDK\tools\ant\build.xml <macrodef name=”signjarjdk7″> <attribute name=”jar” /> <attribute name=”signedjar” /> <attribute name=”keystore” /> <attribute name=”storepass” /> <attribute name=”alias” /> <attribute name=”keypass” /> <attribute name=”verbose” /> <sequential> <exec executable=”jarsigner” failonerror=”true”> <!– … Read more

How can I specify location of debug keystore for Android ant debug builds?

You should be able to specify the keystore to use with these properties key.store=/path/to/key.keystore key.alias=alias key.store.password=pass key.alias.password=pass Just pass the properties in to Ant. [EDIT] From the docs at http://developer.android.com/guide/publishing/app-signing.html#setup The Android build tools provide a debug signing mode that makes it easier for you to develop and debug your application, while still meeting the … Read more

Using ant to detect os and set property

Move your condition out of the <target />, as your target probably isn’t invoked. <condition property=”isWindows”> <os family=”windows” /> </condition> <condition property=”isLinux”> <os family=”unix” /> </condition>

Should JAVA_HOME point to JDK or JRE?

If you’re doing any sort of development, or building with Maven or Ant, you need to point to the JDK (Java Development Kit) where utilities such as javac (the Java Compiler) reside. Otherwise, you can point to the JRE (Java Runtime Environment). The JDK contains everything the JRE has and more. If you’re just executing … Read more

jacoco code coverage report generator showing error : “Classes in bundle ‘Code Coverage Report’ do no match with execution data”

You are getting the error related to classID. This is a concept described in detail at JaCoCo docs-site. http://www.eclemma.org/jacoco/trunk/doc/classids.html. This is a key step for supporting multiple versions of class (an appserver for example) in same JVM. Copying part some part of it here for visibility. What are class ids and how are they created? … Read more