ant

error while including external JARs in ant script

混江龙づ霸主 提交于 2019-12-07 14:13:53
问题 This is my first attempt at writing an ANT script. This is my build.xml for a simple Hello World app using Spring. <project name="MyFirstApp" default="jar" basedir=".."> <property name="src" location="src"/> <property name="build" location="build"/> <property name="lib" location="/WebContent/WEB-INF/lib"/> <path id="classpath-example"> <fileset dir="${build}" includes="*.jar"/> </path> <target name="clean"> <delete dir="build"/> </target> <target name="compile"> <mkdir dir="build/classes"/>

ant.properties file missing in android project

六月ゝ 毕业季﹏ 提交于 2019-12-07 12:55:24
问题 I am building android application from command line.I need to sign my application in order to install built .apk file on device. For that i need to write key.store and key.alias in ant.properties file. But ant.properties file is missing.So anyone knows please do let me know. 回答1: Run android update project -p . or Create ant.properties file manually with the following contents # This file is used to override default values used by the Ant build system. # # This file must be checked in Version

Custom property handling with ant

自闭症网瘾萝莉.ら 提交于 2019-12-07 12:30:04
问题 We have a properties file (e.g. db.properties ) that contains the credentials for a database access. Example: db.jdbc.user=johndoe db.jdbc.password=topsecret We have many ant scripts that read this file and execute various tasks. Example: <!--Initialize the environment--> <target name="environment"> <!--Read database connection properties--> <property file="$../db.properties"/> ... </target> <target name="dbping" description="Test the database connectivity with the current settings." depends=

Apache Ant 1.8 on CentOS

情到浓时终转凉″ 提交于 2019-12-07 12:06:50
问题 I am trying to get apache ant 1.8 to work under CentOS. First, I had this error. Error: Could not find or load main class org.apache.tools.ant.launch.Launcher Then I set the following variables according to this link: Ant: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher It's not CentOS, but I did verify the paths exist except JAVA_HOME, so I set it according to this site: https://serverfault.com/questions/50883/what-is-the-value-of-java-home-for

How to get Ant to copy properties file to classes directory

随声附和 提交于 2019-12-07 11:45:18
问题 I have a project which I can build and deploy correctly using Ant I want to build a war file to deploy the project. I can get everything working except I cannot get the properties file to appear in the classes directory. My properties file is located here: ${resources_dir}/${app}/Report.properties This is the war section of my build file: <war destfile="${dist_dir}/${app}.war" webxml="${resources_dir}/${app}/web.xml"> <fileset dir="${resources_dir}/${app}" includes="*.jsp,*.jspf,*.html,*.css"

How to make Ant prefer classes from a linked JAR over JDK classes?

风格不统一 提交于 2019-12-07 11:24:11
问题 I am trying to build the dom4j JAR, which includes an xml-apis JAR which contains a DOM API that is older than that shipped with more recent JDKs. However, even though in the build file the source and target compiler attributes are set to 1.3, and even though the xml-apis JAR is included in the build path, Ant still tries to compile dom4j against another, newer, w3c API (I guess one from a JDK installation). Here's the relevant Ant code: <path id="compile.classpath"> <fileset dir="./lib

Can Ant continue when it encounters an error?

会有一股神秘感。 提交于 2019-12-07 10:23:21
问题 I have an Ant target that executes 2 steps in sequence: <target name="release"> <antcall target="-compile"/> <antcall target="-post-compile"/> </target> With the above script, it quits immediately if the "-compile" target fails. "-post-compile" does not get a chance to run. Is there a way to make sure the second step (-post-compile) is executed even if the 1st one (-compile) fails? 回答1: I think you are looking for -keep-going (-k) This will tell Ant to continue building all targets which do

Exclude pre-defined resource in apk file

怎甘沉沦 提交于 2019-12-07 10:15:26
问题 Exclude pre-defined resource in apk file I created a blank project with Android Studio. And then generated apk file, look inside that file I can see : in res/drawable folder there are many unwanted files like : abc_ic_clear_holo_light.xml, abc_ic_clear.xml, and in res/drawable-mdpi-v4 folder there many unwanted images like: abc_ab_bottom_solid_dark_holo.9.png, abc_ab_bottom_solid_light_holo.9.png. How to remove all of that files ? How to disable creating drawable-hdpi, drawable-mdpi-v4

How do I set file.encoding for a junit test in ant?

試著忘記壹切 提交于 2019-12-07 10:07:09
问题 I'm not quite done with file.encoding and ant. How do I set the file.encoding for junit tests in ant? The junit ant task doesn't support the encoding attribute like the javac task does. I've tried running «ant -Dfile.encoding=UTF-8» and «ANT_OPTS="-Dfile.encoding=UTF-8" ant» without success. System.getProperty("file.encoding") within a test still returns MacRoman . 回答1: JUnit supports a child element <jvmarg ...> which should do what you want. <junit fork="yes"> <jvmarg value="-Dfile.encoding

Ant issue after updating Android SDK tools to revision 14

 ̄綄美尐妖づ 提交于 2019-12-07 09:42:46
问题 After installing Android SDK tools revision 14(ant version 1.8.2 when doing ant -version) to install and test our apps on Android 4.0(ICS), I've noticed that our automatic build script is now failing. The build script is executing an ant command to build the apk, which after the revision update complained about the build.xml file being out of date and to execute the ant update project -p to fix this. Our project has a top level project and two library projects it references, all developed in