ant

how to exec command in new prompt using ant

此生再无相见时 提交于 2019-12-11 07:42:31
问题 I am trying to run a command in ant to start the selenium server but it opens up in the same command prompt, is there anyway i can open it up in a new prompt? <project> <target name="startGRID"> <exec dir="." executable="cmd"> <arg value="/c"/> <arg value="java -jar selenium-server-standalone-2.43.1.jar -role hub"/> </exec> </target> </project> 回答1: To see a separate command prompt in which your server is run, use the dos start command, which does exactly that: <exec dir="." executable="cmd">

Ant task with argument

非 Y 不嫁゛ 提交于 2019-12-11 07:35:31
问题 I have to configure IPV6 through Apache config.xml. I read the IP through ADDR6. I want to pass it to the command like this - ant -f config.xml configureForIPv6 <IP> . The target is easy to pass, but how do i pass the argument for IP? Ant does not like the arg value. <ant antfile="${APACHE_HOME}/config.xml" target="configureForIPv6" arg="-DIPv6_Interface=${ADDR6}" inheritRefs="true"> ? 回答1: There are two ways you might set properties from the command line. First, as for any Java application,

executing a java class file from ant script

陌路散爱 提交于 2019-12-11 07:33:49
问题 I need to run a java class (actually a test case) from ant script. Is it possible to do so? 回答1: At the most basic level you could use the ant java task to do this. But you tagged with junit4 - can you not use the ant junit task? 回答2: To execute java class, you can use java task http://ant.apache.org/manual/Tasks/java.html To execute junit test cases: http://ant.apache.org/manual/tasksoverview.html#testing 回答3: Try the java task. If you want to run tests, you might want to take a look at

Ant substring by position

会有一股神秘感。 提交于 2019-12-11 07:28:56
问题 I need to extract a substring from property value by length, f.e. : <property name="prop1" value="nameBLABLABLA" /> I want get the value name Is it possible without using javascript code ? 回答1: Not with vanilla ant, you would need to add some Ant addon like Antcontrib (latest release 2006 !) or Ant Flaka - means you'll need additional jars/libraries. With using the jdk builtin Javascript engine it's as easy as : <project> <!-- create a macrodef for reuse --> <macrodef name="getsubstring">

problem running JUnit tests with Ant in Eclipse. Beginner question

倖福魔咒の 提交于 2019-12-11 07:25:17
问题 I'm learning these days how to use ant to run automated test folowing this tutorial. I have JUnit in the classpath of my project. All seem to work fine and I can include it in my classes: import junit.framework.TestCase; //line20 public class SimpleLattice1DTest extends TestCase{ ... } My build.xml is: <?xml version="1.0"?> <project name="Ant-Test" default="compile" basedir="."> <!-- Sets variables which can later be used. --> <!-- The value of a property is accessed via ${} --> <property

Get timestamp difference using Ant

Deadly 提交于 2019-12-11 07:24:48
问题 I need to calculate time difference using Ant. Basically it has 2 variables. One is assigned the current time, and the other one has a different time. I need to get the time difference using Ant. Something like below. If anyone have code please reply. variable a = current time; variable b = different time echo (a - b) ; 回答1: Here is a much simpler solution: <script language="javascript"> project.setProperty('startTime', new Date().getTime()); </script> ... <script language="javascript">

Ant: unzip multiple files

送分小仙女□ 提交于 2019-12-11 07:19:30
问题 How to unzip multiple files with Ant? I am using: <unzip dest="./out"> <patternset> <include name="**/*.zip"/> </patternset> <fileset dir="./in"> <include name="**/*.zip"/> </fileset> </unzip> From the output it looks like ANT is correctly finding my files but nothing gets extracted: [unzip] Expanding: c:\temp\in\test1.zip into c:\temp\out [unzip] Expanding: c:\temp\in\test2.zip into c:\temp\out BUILD SUCCESSFUL Total time: 0 seconds I can't figure out what I am doing wrong. 回答1: From the

Ant load properties from pattern

孤街醉人 提交于 2019-12-11 07:07:10
问题 In ant, I need to load a set of .properties files based on a pattern. I tried: <property> <fileset includes="${propertiesDir}/*.properties"/> </property> but it doesn't work because <property> doesn't support nesting. How can i load properties from files matching a pattern? Thanks.. 回答1: You could use the concat task to concat all your properties files to a big temporary properties file, and the use property with this big temporary properties file as attribute. Make sure to use fixlastline=

Creating a windows .exe from a runnable jar (preferably on linux)

你离开我真会死。 提交于 2019-12-11 06:56:55
问题 I have an application packaged up as a xyz.jar, which can be run as java -Xmx2g -jar xyz.jar How can I convert this to a self-contained exe that can be downloaded by Windows users and launched with a single click? Preferably, I'd like the jre also bundled inside the exe, much like can be done from the mac: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html Oh, and also I'd prefer if I can do this from an ant build file (or eclipse plugin) on a mac or linux

How do I stop jumbling of output from multiple Ant tasks when using the Parallel Task?

允我心安 提交于 2019-12-11 06:51:43
问题 I'm modifying our build.xml to use the Parallel Task, primarily to speed up our build on our CI server. One small issue I'm having is stopping the output (stdout) from getting jumbled. <target name="build"> <antcall target="clean"/> <antcall target="prepare"/> <antcall target="externals"/> <antcall target="migrate"/> <parallel> <antcall target="phpunit"/> <antcall target="jshint"/> <antcall target="phploc"/> <antcall target="phpcpd"/> <antcall target="pdepend"/> <antcall target="phpcs"/>