ant

Ant JUnit task: Is there a difference between on, yes, and true?

独自空忆成欢 提交于 2019-12-12 17:03:56
问题 TL;DR: To enable an Ant feature, is there a difference between on , yes , and true ? I cannot find any documentation regarding this matter. We have some Ant build scripts that seem to randomly pick between: on yes and true to enable various Ant JUnit features. Example attributes: fork and haltonerror Ref: http://ant.apache.org/manual/Tasks/junit.html 回答1: From http://ant.apache.org/manual/develop.html: The most common way to write an attribute setter is to use a java.lang.String argument. In

javadoc exclude some public methods from class

落花浮王杯 提交于 2019-12-12 16:25:10
问题 I have to exclude a few of the public methods of a class from being included in javadocs. I tried Chris Nokleberg's ExcludeDoclet (sixlegs). But the doclet is giving a slight problem : If the other methods in the class return List (or any other generics), instead of being displayed in the javadoc as List, return type is just being displayed as List (without the generic info) Can anyone give a hint or provide a work around on how to solve this issue? 回答1: I assume the methods you want to

How can I have my ant task pass or fail based on the results of a jar it runs?

被刻印的时光 ゝ 提交于 2019-12-12 16:18:44
问题 I'm running CrossCheck (browserless js unit testing) as part of an ant script. I'd like ant to report failure if the CrossCheck tests fail. Here's the relevant bit from the build.xml <target name="test" depends="concat"> <java jar="src/test/lib/crosscheck.jar" fork="true"> <arg value="src/test/webapp/js/"/> </java> And an example of CrossCheck's failure messaging: [java] Running tests in environment: Mozilla 1.7 (Firefox 1.0) [java] org.mozilla.javascript.EcmaError: ReferenceError:

Ant build executes cordova

徘徊边缘 提交于 2019-12-12 16:06:05
问题 I created an ant build for my cordova project as following: <project default="build"> <target name="init-android"> <exec executable="cordova"> <arg value="platform"/> <arg value="add"/> <arg value="android"/> </exec> <exec executable="cordova"> <arg value="build"/> </exec> </target> </project> But I got this error: C:\path_to_project\build.xml:3: Execute failed: java.io.IOException: Cannot run program "cordova": CreateProcess error=2, The system cannot find the file specified at java.lang

Check if executable command exists using ant

帅比萌擦擦* 提交于 2019-12-12 16:03:26
问题 Is it possible to check if a command exists as part of an ant task. For example, I want to ensure the "yasm" command is present as part of the ant task. Is this possible? If so, can you provide an example? 回答1: The best way I can think of to do this is by using the available task combined with an if in a subsequent target. If you take a look at that task page you will see that you can check to see if something exists then set a property. For example: <available file="/path/to/my/file" type=

Ant: Source and target files are the same. How to detect a change?

折月煮酒 提交于 2019-12-12 15:16:03
问题 We are using JiBX. The important thing to know is that JiBX modifies the already compiled class files. We do our compile: <javac destdir="${main.destdir}"> <src path="${main.srcdir}"/> <classpath refid="main.classpath"/> </javac> Then, we call JiBX: <jibx load="true" binding="{$binding.file}"> <classpath refid="main.classpath"/> <classpath refid="main.destdir.classpath"/> </jibx> This uses an XML file that updates the classfiles compiled by <javac> above. The problem is how do I know that the

Creating Javadoc HTML pages that use a favicon

旧时模样 提交于 2019-12-12 15:15:28
问题 I want to include an element in the <head> of my generated Javadoc HTML: <link rel="shortcut icon" href="my-project-icon.ico" /> Note that I'm using an Ant task to generate the Javadoc. I tried using the <header> element of the Ant task, but any markup placed there ends up within an <h1> tag, which is invalid and therefore ignored by the browser. 回答1: I would definitely modify the output files as an easy brute force solution. But a sophisticated way would be to have a custom doclet. This

Is it possible for Ant to lists failed tests at the end of a build?

风流意气都作罢 提交于 2019-12-12 15:04:31
问题 The following snippet, from another thread, works to print a message and fail after all unit tests have been run : <fail if="junit.failed" message="Oh no ! There were some failed unit tests :( "/> However --- I don't see a how can I also record and print the NAMES of the failed tests in junit/ant, after they have all run. Any thoughts on this ? I believe others would find such function extremely important, so I'm assuming a simple solution exists : its quite tedious to look through hundreds

Run Ant task from Maven

十年热恋 提交于 2019-12-12 14:39:06
问题 I'm using Ant to build a custom jar library, which then I'm using in Maven as dependency. <dependency> <groupId>test-lib</groupId> <artifactId>test-lib</artifactId> <version>1.0.0system</scope> <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/test-lib-1.0.0.jar</systemPath> </dependency> So, basically what I do now is: 1) run ant to build custom library (test-lib-1.0.0.jar) 2) run: mvn compile, to compile my project using custom library among others. Is there an option for me to do all this

ANT can't find specific libraries

一曲冷凌霜 提交于 2019-12-12 14:33:16
问题 I am trying to use the SSHEXEC ANT task, which requires the JSCH library. When I try to use an SSHEXEC task, I get the following: BUILD FAILED /home/www/test/build/build.xml:140: Problem: failed to create task or type sshexec Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.SSHExec was not found. This looks like one of Ant's optional components. Action: Check that the appropriate optional JAR exists in -/usr/share/ant/lib -/root/.ant/lib -a directory added on the command line with