ant

Execute Ant action always and independently from target

白昼怎懂夜的黑 提交于 2019-12-10 19:50:35
问题 Is there a way to specify actions like <copy> in an Ant buildfile that get executed every time the build file gets read by ant (regardless of the target which is called)? The background is: I want a *.properties-file to be automatically created from a template when it's not present. I know, I could specify a target which does this and then include it at the root of the dependency-tree but maybe there is a more elegant solution. Because actually the problem is a bit more complex: the ant file

Ant flagrantly ignoring JAVA_HOME environment variable

与世无争的帅哥 提交于 2019-12-10 19:17:45
问题 I just picked up the latest version of the Android SDK and started trying to use it. Unlike almost everyone else coming up with this problem, I'm running Linux, namely Linux Mint 13. I'm currently trying to compile a Hello World program using ant, installed via sudo apt-get install ant and ran in the project folder: ant debug However, it fails utterly to compile, eventually spitting out an error to do with setting JAVA_HOME . I amended my ~/.bashrc file accordingly and restarted, but I still

Ant task to chek duplicate file in destination directory

我是研究僧i 提交于 2019-12-10 19:13:00
问题 I am copying list of files from source directory to destination directory, i need to check duplicate file name before copying.. Thanks.. 回答1: Just wondering, would this be sufficient? <copy todir="../new/dir" overwrite="false" verbose="true"> <fileset dir="src_dir"/> </copy> As manual says ( http://ant.apache.org/manual/Tasks/copy.html ): verbose - Log the files that are being copied. overwrite - Overwrite existing files even if the destination files are newer. As this would be a low effort

Ant build fails with no visible errors

匆匆过客 提交于 2019-12-10 19:06:44
问题 EDIT: I ended up setting up the whole project in Eclipse and was able to get it to build. I'm not sure why this problem occurred and hopefully I'll never have to find out. I'm having a problem where my build is reporting "BUILD FAILED" without reporting any errors. I'm building a large application of a lot of old code which I now have the joy of modifying. Most of the other developers have set up their builds with Eclipse, but I'm trying to build it through the existing build.xml files. After

Code for Ant not Running in Maven

一个人想着一个人 提交于 2019-12-10 18:52:51
问题 This is probably the most strange thing I have ever seen in Java: The following code (that uses no external libraries) runs flawlessly using Ant (on Netbeans, on a Windows-7 Machine) : public static void main( String[] args ) throws IOException, InterruptedException { String prog = "\"C:\\Program Files\\R\\R-2.14.2\\bin\\Rscript.exe\""; String[] progParams = new String[]{"C:\\Users\\pantelis\\Desktop\\SB\\MC_Sarfraz_ver5.R"}; Process p = Runtime.getRuntime().exec(prog+" "+progParams[0]); p

Ant: Using a fileset with the javac task

[亡魂溺海] 提交于 2019-12-10 18:44:13
问题 I want to use a FileSet to indicate exactly which files I want compiled with the Javac task. I don't want any implicit behavior. My attempts at this have failed however. Here's what I've got so far: A FileSet that contains all my source files. <fileset id="srcfiles" dir="${srcdir}"> <include name="**/*.java"/> </fileset> And a target that tries to pass it to javac. <target name="build"> <javac srcdir="."> <fileset refid="srcfiles"/> </javac> </target> This gives me this error: javac doesn't

ant how do I disable pre-dexing r21+

懵懂的女人 提交于 2019-12-10 18:17:28
问题 hello my ant build takes forever with pre-dexing after updating to r21 [dex] Pre-Dexing myproject/android/google-play-services_lib/bin/classes.jar -> classes-27fa775977cf84dcd4ef76d9015649a6.jar This more than doubles my compile time. Pre-dexing would speed things up if I was only predexing once, but I'm actually reconfiguring my project several times for different ant builds, many times. So they all pre-dex , it is very annoying. is there a flag I can enable in my ant script? I've looked at

Java ant script does not show warnings

﹥>﹥吖頭↗ 提交于 2019-12-10 17:34:39
问题 I have a 1.4 java code and I want to compile it with a 1.5 compiler because I would like to see all warning messages. I added the -Xlint option to javac, but it seems there were no changes in the output, but I know there is at least a couple of warnings in the code. I added these two lines to my ant script's compile target tag: <compilerarg value="-Xlint:all"/> <compilerarg line="-Xmaxwarns 10000"/> Thank you for your answers. 回答1: You have used value and line attributes at the same time.

Error while building an xtext project with ant: Generation of the Grammar classes fails

强颜欢笑 提交于 2019-12-10 17:33:28
问题 I am developing an xtext plug-in project for an eclipse application for my Bachelor thesis. I want to do the 'Generate Xtext Artifacts' at runtime with an ant script executing the Mwe2Launcher class and do the generation in an temp folder. I wrote an Activator to create in the temp folder a project folder and copy the mwe2 file, my grammar file and the ant script. Executing the Ant script leads to this error: osgi> start 360 gen: [java] 0 INFO StandaloneSetup - Registering platform uri 'C:

Need to set path (cp) in ant script depending on value of a property

落花浮王杯 提交于 2019-12-10 17:24:19
问题 I want to set a path variable cp to one of two values depending on the value of an property. E.g. the following is what I'm trying to achieve, but I'm not sure about how to get it working properly... <if> <contains string="${jboss.home}" substring="jboss-4.2.3.GA"></contains> <then> <echo message="Using JBoss 4.2.3 classpath"/> <path id="cp"> ... </path> </then> <else> <echo message="Using JBoss 4.0.5 classpath"/> <path id="cp"> ... </path> </else> </if> 回答1: <condition property="usejboss423"