ant

Unexpected Top-Level Exception after SDK Update

爷,独闯天下 提交于 2019-12-20 06:24:13
问题 I'm working on an Android Project which has an Android Library Project in his Build Path. Both projects have the AdWhirl SDK library in their libs folder and Build Path. Now since updating android sdk tools to r15 the ant build of the main project fails on following exception: [dx] UNEXPECTED TOP-LEVEL EXCEPTION: [dx] java.lang.IllegalArgumentException: already added: Lcom/adwhirl/AdWhirlLayout$AdWhirlInterface; [dx] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)

how to use ant count task countfilter

∥☆過路亽.° 提交于 2019-12-20 06:18:17
问题 Im trying to count the number of occurences of the line " Does this buildlist need compile: true " in a file. I tried the following code, but it does not pick up the count <concat> <fileset file="@{logPathInTestSetup}" /> <filterchain> <tokenfilter> <ct:countfilter property="noOfCompiledBuildlists" contains="Does this buildlist need compile:\s*(true)" override="true"> <ct:counteach propertyprefix="count." select="\1" /> </ct:countfilter> </tokenfilter> <ct:stopfilter /> </filterchain> <

Include java libraries into own library

别等时光非礼了梦想. 提交于 2019-12-20 06:17:28
问题 I created a little framework for myself which I want to use in multiple projects. I also want the distributed jar-file to include all external libraries so that my projects just need to include my library to access all external libraries. I need this to simplify updating the external libraries. So I placed this in my build.xml which adds all libraries from dist/lib into my own jar-file. <target name="-post-jar"> <!-- Include all java libraries --> <fileset dir="dist/lib" id="extern.libs">

Is there a way to pass ant variables to java code (android)?

冷暖自知 提交于 2019-12-20 05:17:06
问题 I like to include some build variables in my application. For example a buildnumber. Can I pass some variables from a ant build script to my Android application and use that variable in java? Anybody has a link or example? 回答1: Use an ant task (such as replaceregexp) to insert the build numbers and other variables into a class for that purpose. <replaceregexp file="${my.version.class.file}" match="@version@" replace="@${build.number})@" /> Or something similar. Basically you want to compile

Insert XML element in xml document using Ant

醉酒当歌 提交于 2019-12-20 04:35:14
问题 I want to insert one xml element in xml document :- Input XML:- <cus:try xmlns:cus="http://www.abc.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xt="http://www.efg.com"> <cus:trying> <cus:query> <xt:resourceTypes>abc</xt:resourceTypes> <xt:envValueTypes>def</xt:envValueTypes> </cus:query> </cus:trying> </cus:try> Output XML:- <cus:try xmlns:cus="http://www.abc.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xt="http://www.efg.com"> <cus:trying> <cus:query>

Apache ANT安装配置管理

五迷三道 提交于 2019-12-20 04:26:39
1、Ant是什么? Apache Ant是一个Java库和命令行工具,其任务是将构建文件中描述的进程作为相互依赖的目标和扩展点来驱动。Ant的主要已知用途是构建Java应用程序。Ant提供了许多内置任务,允许编译、组装、测试和运行Java应用程序。Ant还可以有效地用于构建非Java应用程序,例如C或C++应用程序。更一般地说,Ant可以用来引导任何类型的过程,这些过程可以用目标和任务来描述。Ant是用Java编写的。Ant用户可以开发自己的包含Ant任务和类型的“antlibs”,并提供大量现成的商业或开源“antlibs”。ANT是非常灵活的,不将编码约定或目录布局强加给Java项目,而Java项目采用它作为构建工具。本人使用ant是因为用此来编译项目工程使用。 2、Ant安装: ① 官网下载适合自己本机的ant版本: https://ant.apache.org/ ② 我自己下载的是1.8版本,本机的jdk也是1.8的,以下以此为例:下载解压到本地固定位置:我的位置:D:\Program Files\apache-ant-1.8.1 3、配置环境变量: 打开我的电脑-属性-高级系统设置-环境变量 ① 新增环境变量:变量名(ANT_HOME),变量值为本机ant安装路径(D:\Program Files\apache-ant-1.8.1)② 找到path用户变量:双击编辑

Using Apache Ivy with netbeans

久未见 提交于 2019-12-20 04:14:18
问题 I have an existing project that is developed using netbeans, and I would like to integrate Apache Ivy in the project. I updated the build.xml generated by netbeans to download ivy (if necesarry) and use it to retrieve the dependencies. Does anyone know how I can add the downloaded dependencies to the build path of the project, such that it will compile okay and also so that it doesn't show missing libraries errors in the interface. I would prefer to do this without using a netbeans plugin if

How to use custom ant rule regexpression to change property in propertyfile

徘徊边缘 提交于 2019-12-20 04:13:54
问题 In my Android project I have the following property set in my project.properties file proguard.config=proguard.cfg and I need a custom macro that will somehow set and unset this property. How do I set unset this property using macro and regular expression? two things I am not clear on is how to set this to an empty property value. Would that be just proguard.config= or proguard.config='' What would be the Macro for doing this? <macrodef name="turn-on-proguard"> <sequential> <replaceregexp

How to create directories specified by a mapper in Ant

三世轮回 提交于 2019-12-20 03:49:39
问题 Given a fileset <fileset id="myFiles" dir="."> <include name="**/*.file"/> </fileset> How do I create a sub-directory at each file in the set, named after the filename without the extension? For example, given the files folderA/X.file and folderA/folderB/Y.file, I want to create the directories folderA/X and folderA/folderB/Y 回答1: The ant touch task supports creating files, parent dirs and filename mapping, so can be used to achieve this: <target name="mkdirs"> <touch mkdirs="true"> <fileset

Ant: scp create directory if not exist

左心房为你撑大大i 提交于 2019-12-20 03:25:18
问题 I am using this to copy from A to B. But if for example the folder /config doesnt exist it gives me an exception. How can I solve it? I tried mkdirs="true" but it runs to error as well <scp todir="${ftplogin}@${ftpserver}:${ftp-remote-dir}/config" verbose="false" trust="true" failonerror="No"> <fileset dir="${stuff}/${stuff-version}/config${config-files}"> <include name="*.*"/> </fileset> </scp> 回答1: It's not possible to create remote directories with scp task. Here's a macrodef for