ant

Use pure Ant to implement if else condition (check command line input)

有些话、适合烂在心里 提交于 2019-12-17 23:47:57
问题 I am a newbie in Ant. My ant script receives a user input variable named " env " from command line: e.g. ant doIt -Denv=test The user input value could be " test "," dev " or " prod ". I also have the " doIt " target: <target name="doIt"> //What to do here? </target> In my target, I would like to create the following if else condition for my ant script: if(env == "test") echo "test" else if(env == "prod") echo "prod" else if(env == "dev") echo "dev" else echo "You have to input env" That's to

How do I configure JUnit Ant task to only produce output on failures?

て烟熏妆下的殇ゞ 提交于 2019-12-17 22:39:45
问题 I am configuring JUnit in Ant so that unit tests will be run on each build. I would like the output of failing tests to be printed in the Ant console output whenever they are run. I don't need to see any output from succeeding tests. Here is the relevant bit of my build.xml file: <junit> <classpath> <pathelement path="${build}"/> </classpath> <formatter type="brief" usefile="false"/> <batchtest> <fileset dir="${src}" includes="my/tree/junit/"/> </batchtest> </junit> This produces almost what

Cannot get ant installed properly for phonegap using eclipse and windows 8

巧了我就是萌 提交于 2019-12-17 22:31:45
问题 Trying to use Phonegap in Eclipse on windows 8. I've created a project at C:\Development\HelloWorld. In the command line, when I type: phonegap local build android I get the following error: An error occurred during creation of android sub-project. ERROR : executing command 'ant', make sure you have ant installed and added to your path. My PATH: C:\Program Files\nodejs\;C:\Development\adt-bundle\sdk\platform-tools;C:\Development\adt-bundle\sdk\tools;%JAVA_HOME%\bin;%ANT_HOME%\bin; Whats going

How do I create an EAR file with an ant build including certain files?

穿精又带淫゛_ 提交于 2019-12-17 22:16:46
问题 I'm using eclipse to build an ear file using ant. I'm using oc4j, and I want to make sure that orion-application.xml is included in the build. What I'm currently using but does not work is: <target name="ear" depends=""> <echo>Building the ear file</echo> <copy todir="${build.dir}/META-INF"> <fileset dir="${conf.dir}" includes="orion-application.xml"/> </copy> <ear destfile="${dist.dir}/${ant.project.name}.ear" appxml="${conf.dir}/application.xml"> <fileset dir="${dist.dir}" includes="*.jar,*

How do I load optional task sshexec into Ant in a no-configuration manner?

偶尔善良 提交于 2019-12-17 21:31:51
问题 I am using sshexec, which depends on jsch-0.1.48.jar. I can't just put that into the ant/lib directory because other users wishing to use the same build script will have to make a configuration on their machine before they can do so. What I want to do is to be able to reference jsch-0.1.48.jar as part of the project. Currently, I have it sitting in project/libs directory and I am trying something like: <property name="lib" location="lib"/> <taskdef name="sshexec" classname="org.apache.tools

Can Castor handle class generation from multiple XSDs importing from a base XSD?

本秂侑毒 提交于 2019-12-17 20:26:27
问题 I have several XSDs that reuse the same entities. For example, both the XSDs for the ProductPurchaseRequest.xsd and ProductQuoteRequest.xsd both have a <product> tag in them to describe the product in question. For this reason I created a Product.xsd file to define the <product> tag and both ProductPurchaseRequest.xsd and ProductQuoteRequest.xsd import the Product.xsd with a `. I would like to use Castor to generate Java classes from theses XSDs, and for both of them to use the same class for

Beanshell in Ant yielding, “Unable to create javax script engine for beanshell”

淺唱寂寞╮ 提交于 2019-12-17 20:19:17
问题 Greeting, I'm trying to put some Beanshell script in my Ant build.xml file. I've followed the Ant manual as well as I can but I keep getting "Unable to create javax script engine for beanshell" when I run Ant. Here is the test target I wrote mostly from examples in the Ant manual: <target name="test-target"> <script language="beanshell" setbeans="true"> <classpath> <fileset dir="c:\TEMP" includes="*.jar" /> </classpath> System.out.println("Hello world"); </script> </target> My beanshell "bsh

can I turn off the .ivy cache all together?

二次信任 提交于 2019-12-17 20:14:53
问题 Is there a way to tell ant/ivy to not use a local $HOME/.ivy2 cache? 回答1: In the full book on ivy, you check out the "Setting up the repositories" section: Several repositories use the same root in your filesystem. Referenced as ${ivy.default.ivy.user.dir} , this is by default the directory .ivy2 in your user home. Note that several things can be done by setting Ivy variables. To set them without defining your own ivysettings.xml file, you can: set an Ant property before any call to Ivy in

SWT jar for different platform

℡╲_俬逩灬. 提交于 2019-12-17 20:09:05
问题 I am using JWebBrowser in a swing application. This class belongs to The DJ Project. It needs swt jar to execute. Now I have included swt jar for windows to my jar packaging of the application. I want to know how can I include swt jars for linux/mac in the same packaging? I am using ant to build the application jar. Should I build the jar putting different swt jar for different platform? 回答1: if you want to have a single build that runs on different platforms (Win/Mac/Linux/*nix) or

Compiling mxml files with ant and flex sdk

允我心安 提交于 2019-12-17 19:24:50
问题 I am just getting started with flex and am using the SDK (not Flex Builder). I was wondering what's the best way to compile a mxml file from an ant build script. 回答1: The Flex SDK ships with a set of ant tasks. More info at: http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html Here is an example of compiling Flex SWCs with ant: http://www.mikechambers.com/blog/2006/05/19/example-using-ant-with-compc-to-compile-swcs/ mike chambers 回答2: I would definitely go with the ant