ant

Ant conditions - which comes first 'if' or 'unless'

泪湿孤枕 提交于 2019-12-07 01:35:23
问题 Question If an ant target uses both if and unless , which is evaluated first? Example What comes first, the chicken or the egg? . . . <target name="prepare" if="chicken" unless="egg" > <echo>Dinner time. Chicken is served!</echo> </target> Would ant evaluate the chicken property first? Or the egg property? 回答1: It isn't really a question of evaluation, since the properties either are or are not set before the target gets called. EDIT: I looked at the 1.8.1 source and the logic is as follows:

Ant task for compiling GUI forms (Intellij IDEA)

家住魔仙堡 提交于 2019-12-07 01:35:22
问题 How I can create a Ant task to compile GUI forms (XML) in Intellij IDEA? I use Scala and Java in my project. Java only for GUI class, and I create it with Intellij IDEA UI Designer. 回答1: Please don't beat me, but after setting the 'Generate Ant Build'-dialog like: the errors are gone: 回答2: IDEA provides a Ant task, javac2, that does this. It's a drop-in replacement for the standard javac Ant task. First, you'll need to include something like the following near the top of your Ant build file.

Is there a way with Apache Ant to update a jar file after it's been built?

帅比萌擦擦* 提交于 2019-12-07 00:51:48
问题 Is there a way to update a jar file in Ant? EDIT: For example, if I wanted to add some additional files to an already existing JAR file? 回答1: Sure, that's totally possible. The Ant Jar task can do anything the jar command line can do. You do it with the update flag set to true instead of false. <jar destfile="/x/y/z/file.jar" basedir="/a/b/c/" update="true" /> Where the destination jar is already in existence at that path. EDIT: To set a path <jar destfile="/x/y/z/file.jar" update="true">

option for ant junit task to dump console output on-the-fly

点点圈 提交于 2019-12-07 00:42:13
问题 I have an issue when using the Ant junit task to launch my non-regression tests: the console output is only dumped when the test end. It causes some OOM when there are too many logs with respect to the process Xmx and means that if the process dies (or is killed by a watchdog) before its end the logs are lost. <junit fork="true" forkmode="once" timeout="1200000" haltonfailure="no" outputtoformatters="yes" failureProperty="test.failure" dir="${project.test.dir}"> <junit-opts/> <formatter type=

sql script execution fails when called using ANT SQL task

让人想犯罪 __ 提交于 2019-12-06 22:19:29
There is a SQL file which contains some Transact SQL statements in it and some plain table queries as follows: IF NOT EXISTS (SELECT * FROM [dbo].[SYSTEM_PROPERTIES] WHERE SYS_PROP = 'ABC') BEGIN DECLARE @SYS_PROP_ID INT; INSERT INTO SYSTEM_PROPERTIES (...,....,...) values ('...','...','...'); SELECT -------; INSERT INTO ------; END GO IF EXISTS (SELECT * FROM [dbo].[TEMPLATE] WHERE TPL_NAME='....' ) UPDATE [dbo].[TEMPLATE] SET [...] = 'Y' WHERE TPL_NAME='.....' GO When I execute this script directly on the database, it works fine. When the same script is called through an ANT SQL task it

How to Open an Ant project (Nutch Source) at Intellij Idea?

孤街浪徒 提交于 2019-12-06 21:50:57
问题 I want to open Nutch 2.1 source file (http://www.eu.apache.org/dist/nutch/2.1/) at Intellij IDEA. Here is an explanation of how to open it at Eclipse: http://wiki.apache.org/nutch/RunNutchInEclipse However I am not familiar with Ant (I use Maven) and when I open that source file many classes are not known by Intellij. i.e.: org.apache.hadoop.mapreduce.JobContext org.apache.gora.mapreduce.GoraMapper How can I add them to library or what should I do? 回答1: I finally figure out how to do it. Now

ANT - Could not load a dependent class com/jcraft/jsch/Logger

夙愿已清 提交于 2019-12-06 21:45:37
问题 I have a problem with my Ant script. I need to copy a file to Linux server <copy file="../Ant/lib/jsch-0.1.50.jar" tofile="${ant.home}/lib/jsch-0.1.50.jar" /> <scp todir="${server.user}:${server.password}@${server.dev}:${server.dev.dir.config}" trust="true" verbose="true"> <fileset dir="${src.home}/Config/"> <include name="**/*" /> </fileset> </scp> File is copied correctly, but I receive this error: BUILD FAILED C:\dev.xml:179: Problem: failed to create task or type scp Cause: Could not load

ANT Script handling Return value from exec

雨燕双飞 提交于 2019-12-06 21:24:33
问题 So this is the scenario. I have <target name="test"> <property file="blah"></property> <exec dir="" executable="trast.exe" resolveexecutable="true" spawn="true"> </exec> </target> <!-- So now I have the second target that uses Return value from first target --> <target name="test2"> <property file="blah"></property> <exec dir="" executable=RETURN VALUE resolveexecutable="true" spawn="true"> </exec> </target> Basically I need a way to use the result from first target in the next target. I

“No information about coverage per test.” from Sonar with Jacoco Ant build

不羁的心 提交于 2019-12-06 20:30:59
问题 I'm using Ant, Jacoco and Sonar. When I run my build Sonar tells me that "No information about coverage per test." and the Sonar dashboard has my coverage results, but I cannot drill down into them to see the code. However, the HTML report generated by Jacoco does include drill down into the code. This is my coverage task: <jacoco:coverage destfile="${coverage.output.file}" > <junit printsummary="on" errorProperty="test.failed" failureProperty="test.failed" haltonfailure="yes" fork="true">

Echo target description in Ant

我怕爱的太早我们不能终老 提交于 2019-12-06 20:12:57
问题 <target name="compile" description="Compile the File"> <echo>Compile the File </echo> <mkdir dir="${compilation-dir}" /> <javac srcdir="." classpath="another2" destdir="${compilation-dir}" /> </target> I want to echo the description of the target. Is there a better way of doing this other than duplicating it? 回答1: I guess this is not a perfect solution, but at least you avoid duplicate descriptions. <property name="testing.desc" value="this is the desc" /> <target name="testing" description="