ant

ant buildfile setting javac location

喜欢而已 提交于 2019-12-23 09:01:43
问题 I'm editing the buildfile of an old project. When I add some jar files to the project that use Java 1.6, it won't build. It says [javac] javac: invalid target release: 1.6 So clearly I need to tell the ant buildfile to use javac 1.6. How do I do this? I have JDK1.6 installed on my system, but the default javac is 1.5. I don't want to change the default javac... I just want to set the javac location in this one proejct to JDK1.6/bin/javac. How do I do this in the XML of an ant buildfile?

How can I exclude files from a reference path in Ant?

北战南征 提交于 2019-12-23 09:01:40
问题 In a project we have several source paths, so we defined a reference path for them: <path id="de.his.path.srcpath"> <pathelement path="${de.his.dir.src.qis.java}"/> <pathelement path="${de.his.dir.src.h1.java}"/> ... </path> Using the reference works fine in the <javac> tag: <src refid="de.his.path.srcpath" /> In the next step, we have to copy non-java files to the classpath folder: <copy todir="${de.his.dir.bin.classes}" overwrite="true"> <fileset refid="de.his.path.srcpath"> <exclude name="

Android Studio: Migrate complex build.xml to build.gradle

风流意气都作罢 提交于 2019-12-23 09:00:20
问题 I have migrated my project from eclipse to android studio successfully and a default build.gradle file has been generated. The project builds correctly and I can deploy to debug etc. The real problem though is building release APK files (from the command line) for which I used to have a custom ant-build (called via command line, not out of eclipse). My custom build.xml imported the standard sdk build.xml file from the SDK folder via: <import file="${sdk.dir}/tools/ant/build.xml" /> So all I

Ant exec: redirecting standard out but not standard error

喜夏-厌秋 提交于 2019-12-23 07:58:03
问题 I have an exec task whose output I am putting into a property using the outputproperty attribute. The command may print some errors to stderr, I do not want the errors to be included in the output (since the output is being fed into another command) but rather to be printed out to the user. So I am redirecting the output and error into separate properties and echo the error property. It seems kind of a hack to have to echo the error. Is it possible to redirect the output of an exec but leave

Setting Java path on Windows for Ant

谁都会走 提交于 2019-12-23 07:54:26
问题 Just downloaded the latest version of Ant and installed at: C:\apache-ant-1.8.4 I added the following to the Env Path variable: ...;C:\apache-ant-1.8.4\bin When I open a terminal window and type: ant -version I get: Files\Java\jdk1.7.0_07"" was unexpected at this time. In System variables I have the variable JAVA_HOME set to: "C:\Program Files\Java\jdk1.7.0_07" so it appears that "ant -version" is struggling to read the space in JAVA_HOME even though it is in quotes. I see an alternative post

Error : Executing command 'ant', make sure you have ant installed and added to your path

拟墨画扇 提交于 2019-12-23 07:28:21
问题 I am using Cordova for mobile application development. I have installed Cordova using npm command and after the installation, I have created a cordova project. Whenever I try to add a platform (android) to the project it throws following error: Error : Executing command 'ant', make sure you have ant installed and added to your path I have already installed ant on my system and configured path to %ANT_HOME%\bin and other respective required platforms such as JAVA_HOME , ANDROID_PLATFORM_TOOLS

Ant including both jar files and .class files in dest jar

ぃ、小莉子 提交于 2019-12-23 06:59:04
问题 I have defined a jar task using ant build.xml . I need to bundle all the dependencies into my jar. I don't understant why ant extracts the jars and includes both .jar s and .class files into my jar. It unnecessarily increases the size of my jar file. Here is my jar task. <jar destfile="build/main/ERS2SupportingUtilities.jar"> <fileset dir="target/classes"> <exclude name="*.sh"/> </fileset> <restrict> <name name="**/*.class"/> <archives> <zips> <fileset dir="./src/main/resources/lib" includes=

Ant copy files without overwriting

我的未来我决定 提交于 2019-12-23 06:50:42
问题 Is there any command in ant to copy files from one folder structure to another without checking the last modified date/time overwriting files. Basically I want all extra files from folder A to folder B. That is: no files of folder B are replaced but extra files of folder A comes to folder B . I saw "ant copy" and "ant move" commands, but didn't help. Any suggestions. 回答1: Ant's copy task's overwrite attribute states: "Overwrite existing files even if the destination files are newer." So

Ant renaming while copying file

折月煮酒 提交于 2019-12-23 06:47:07
问题 How to rename file while copying it to directory in ant? <copy file="..." todir="..." overwrite="true"> 回答1: Use tofile option instead of todir Added Or a more complex example from Ant Copy Task documentation: Copy a set of files to a directory, appending .bak to the file name on the fly <copy todir="../backup/dir"> <fileset dir="src_dir"/> <globmapper from="*" to="*.bak"/> </copy> 回答2: It should be as simple as <copy file="mySourceFile" tofile="MyDestFile" /> 来源: https://stackoverflow.com

How to get Jenkins working with binaries from a subfolder of the root user?

隐身守侯 提交于 2019-12-23 05:44:23
问题 In my build.xml I defined some jobs, that should be executed by tools, I installed globally via Composer. That means, the binaries are stored in /root/.composer/vendor/bin/ (I'm working as root on my local VM). I set the PATH environment variable in the composer configs (without it the build process was failing): Now the building process is running in permission issues: Started by user anonymous Running as anonymous Building in workspace /path/to/myproject [myproject] $ ant Buildfile: /path