ant

Setting environment variables from Gradle

匆匆过客 提交于 2019-12-09 15:36:37
问题 I need to execute from Gradle an Ant script which relies on environment variables. Ant uses <property environment="env"/> for it. I tried to do env.foo="bar" in Gradle, but it throws a Groovy exception. What is the proper way to pass environment variables from Gradle to Ant? 回答1: From the gradle 2.0 docs, i see something like this is possible test { environment "LD_LIBRARY_PATH", "lib" } Or in this case could use this systemProperty "java.library.path", "lib" 回答2: It is impossible to set

How to check Ant version inside Ant script

橙三吉。 提交于 2019-12-09 14:36:39
问题 My ant script only works with version >=1.8. I want to check the version in the script, so that it displays error if a lesser version installed. 回答1: Ant has built-in property ant.version : <project default="print-version"> <target name="print-version"> <echo>${ant.version}</echo> </target> </project> 回答2: Here's a code snip that may help: <property name="version.required" value="1.8" /> <target name="version_check"> <antversion property="version.running" /> <fail message="FATAL ERROR: The

${env.JAVA_HOME} not found - Ant

﹥>﹥吖頭↗ 提交于 2019-12-09 14:23:28
问题 In my build.xml file, I have these lines: <property environment="env"/> <echo message="JAVA_HOME is set to = ${env.JAVA_HOME}" /> On some machine, this would print "JAVA_HOME is set to = /usr/jdk1.6" But on some others, it would print this "JAVA_HOME is set to = ${env.JAVA_HOME}" Does anyone know what might cause this? Thanks 回答1: The message tells you that Ant was not able to resolve the property env.JAVA_HOME ; this means that the environment variable JAVA_HOME was not set in that machine.

android with ant licensing library dependencies

风流意气都作罢 提交于 2019-12-09 12:17:07
问题 I need to use ANT with Android building process because at the end I need to create two versions of application (FULL & LITE). When I created new project with command-line tools it generates for me all necessary build files (build.xml, local.properties, build.properties and default.properties, oh and also proguard.cfg). My full version of app need a market licensing library (which is located on my ${sdk.dir}/extras/google/market_licensing/library. So in Eclipse I define where this library is

PhoneGap 3.0 Android build Command failed to execute : ant jar

喜夏-厌秋 提交于 2019-12-09 09:06:44
问题 I installed PhoneGap 3.0 with Node.js and configured all the environment variables so that javac, java, and ant all work but when I do a basic app create and try to build it for Android, I get the following error: An error occurred during creation of android sub-project. Creating Cordova project for the Android platform: Command failed to execute : ant jar Any ideas? 回答1: Make sure you have the Android Build Tools installed for your Android SDK version. In the Android SDK manager under Tools

Apache Ant difference - exec vs apply

ε祈祈猫儿з 提交于 2019-12-09 07:33:35
问题 Can anyone tell me the difference between <exec> and <apply> in Apache Ant? 回答1: The main difference is that apply works for a resource collection - fileset, dirset and the like - so you can, for example, run a script once for each member of a fileset. exec doesn't operate on a fileset; each instance of the task only runs a single external program. Otherwise the tasks are quite similar. 来源: https://stackoverflow.com/questions/6288010/apache-ant-difference-exec-vs-apply

Changing location of Clover instrumented classes

核能气质少年 提交于 2019-12-09 06:22:22
问题 I'm using Clover 2.5 and I've got a target that will package up the binary files. However, at the moment, it seems that the Clover instrumented classes are being generated in the same output directory as the un-instrumented classes that I wish to package up in a jar. How do I go about creating a jar so that the instrumented classes are not included? Is there a way to change where the instrumented classes are spat out? Or is the only way to package up a jar that does not include the

how to compile only changed source files using ANT

老子叫甜甜 提交于 2019-12-09 06:08:05
问题 I am trying to write ant build for compiling source folder here is my script target for compiling. <target name="compile" depends="init"> <javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true"> <classpath refid="master-classpath"/> </javac> </target> In my project I have near about 1000 .java files. When ever a single .java file is changed above target tends to compile all .java files. Which make development very slow. I just want to know is there any way or code to change the

Obfuscating ActionBarSherlock with Proguard

隐身守侯 提交于 2019-12-09 04:30:45
问题 I'm trying to obfuscate my android application using proguard and ant ( eclipse + proguard never works, always fails with error 1 ). But I'm getting class file ... unexpectedly contains class ... warning all aver the place and the build fails. I also tried with -ignorewarnings option in proguard . The build suceeds but I get an unusable package. Here's the ant output: -post-compile: optimize: [jar] Building jar: /home/binoy/git/Vibhinna/proguard/unoptimized.jar [java] ProGuard, version 4.8

How to get hold on the flattenmapper result in ant?

时光总嘲笑我的痴心妄想 提交于 2019-12-09 03:39:12
问题 Please, find below a few targets from my ant file: <fileset id="test-dep-jars" dir="o:/java"> <include name="junit-4.10.jar"/> <include name="easymock-3.1\easymock-3.1.jar"/> <include name="easymockclassextension-3.1\easymockclassextension-3.1.jar"/> </fileset> <target name="copy-test-deps"> <mkdir dir="${deploy.dir}"/> <copy todir="${deploy.dir}"> <fileset refid="test-dep-jars"/> <flattenmapper/> </copy> </target> <target name="jar" depends="copy-test-deps"> <jar destfile="${deploy.dir}/test