ant

Can I use ivy dependency info in my ant build file

南笙酒味 提交于 2020-01-25 05:27:45
问题 In my ivy.xml file I have dependency statements like: <dependency conf="*->*" org="gnu" name="gcc" rev="4.2.1" changing="false"> <artifact name="gcc" ext="tbz2" e:classifier="src"/> </dependency> 'rev=' can be a fixed value or 'latest' or whatever. In my build file I would like to get hold of the value of 'rev' to be uses in further work flow after resolve is run. Is there any way to do that or read a property for this? 回答1: Use the artifactproperty task <ivy:artifactproperty name="version.

In Ant, how do I specify files with comma in filename?

╄→гoц情女王★ 提交于 2020-01-24 20:44:27
问题 Here is an example-target that I tried. Turns out, it wants to delete everything because the comma separates " * */*" and "cover" -- understandable. <target name="clean"> <delete verbose="true"> <fileset dir="." includes="**/*.pyo"></fileset> <fileset dir="." includes="**/*,cover"></fileset> </delete> </target> How do I specify an embedded comma? I'm trying to learn Ant so I won't have to maintain different build-systems for different operating-systems. In this case, it's in a Python

Access Antlib Resources From Within Apache Ant Macros

ぐ巨炮叔叔 提交于 2020-01-24 12:36:08
问题 Is it possible to access resources from within Apache Ant macros defined in an Antlib? For instance, within my antlib.xml , I have a macro that performs some XSLT. Ideally I would like the XSLT file to be packaged in the same JAR as the antlib.xml , but I have no idea how to specify the location of the XSLT. Here is the (simplified) code: <antlib xmlns:tibant="antlib:org.windyroad.tibant"> <macrodef name="configure-ear"> <attribute name="xml" /> <attribute name="out" /> <sequential> <xslt in=

Many versions of JDK: How do I specify which one is used?

落花浮王杯 提交于 2020-01-24 08:46:08
问题 I have installed many versions of the JDK: 1.4.2, 1.5 and 1.6 . How do I specify which version of the JDK is used when compiling using Ant? 回答1: Two solutions: Specify the full path in your command: for example /opt/java/jdk16/bin/javac ... on Linux Use the -source and -target arguments of the javac command. This allows you specify the source code level and targeted JRE version Also note: Some Linux distributions can include tools to specify which JDK version to use by default. Using -source

ubuntu中ANT的安装和配置

泪湿孤枕 提交于 2020-01-23 18:37:29
原文地址: http://www.cnblogs.com/shitouer/archive/2011/08/31/2160467.html 感谢作者的总结 一. 可以使用 sudo apt-get install ant 安装,但是这种装法不好。首先安装的ant不是最新的版本,其次还要装一堆其他的附带的东西。所以我才用自己手动ant安装。 二. 手动安装 1. 到Apache官网下载最新版本的ant:http://ant.apache.org/bindownload.cgi 2. 解压下载下来的 .tar.gz文件: tar -xf apache-ant-1.8.2-bin.tar.gz (可能会要求输入密码) 3.将解压出来的文件移动到/opt/下:sudo mv apache-ant-1.8.2 /opt/ (sudo 不能省,否则没有权限) 4.配置环境变量:sudo gedit /etc/profile,在原来基础上添加以下蓝体字: export ANT_HOME=/opt/apache-ant-1.8.2 export JAVA_HOME=/usr/lib/jvm/java-6-openjdk export PATH=$JAVA_HOME/bin:$PATH :$ANT_HOME/bin export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:

Compiling android project with a library project fails with missing classes.jar

末鹿安然 提交于 2020-01-23 17:05:45
问题 I'm making an app that depends on the Android v7 appCompat support library. When I'm trying to build the project with Ant, I get an error from dex stating that it can't find the file classes.jar from the appCompat project's bin directory. Here's what I have done: I copied the appCompat directory under the SDK over to my project. It is now one of the top-level directories along with libs, res, src etc. I added the library to my project: android update project --target 1 --path . --library .

Ant scp task failure

梦想的初衷 提交于 2020-01-23 04:37:05
问题 I have one requirement: copy local files to remote system. I have done the following: downloaded jsch-0.1.44.jar and copied to lib folder of Ant set the path and every thing My buildfile is: <project name="ImportedBuild" default="all"> <target name="copyFileToRemote"> <echo>2222222222 copyFileToRemote Examples:::::::::::::</echo> <scp file="sample.txt" todir="${username}:${password}@${hostname}:/shared"/> </target> </project> When I run Ant, I get this error: BUILD FAILED com.jcraft.jsch

Ant scp task failure

自闭症网瘾萝莉.ら 提交于 2020-01-23 04:36:13
问题 I have one requirement: copy local files to remote system. I have done the following: downloaded jsch-0.1.44.jar and copied to lib folder of Ant set the path and every thing My buildfile is: <project name="ImportedBuild" default="all"> <target name="copyFileToRemote"> <echo>2222222222 copyFileToRemote Examples:::::::::::::</echo> <scp file="sample.txt" todir="${username}:${password}@${hostname}:/shared"/> </target> </project> When I run Ant, I get this error: BUILD FAILED com.jcraft.jsch

How can I use something like an array or list in Ant?

泄露秘密 提交于 2020-01-22 15:12:10
问题 I have a list of strings (e.g. "piyush,kumar") in an Ant script for which I want to assign piyush to var1 like <var name="var1" value="piyush"/> and kumar to var2 like <var name="var2" value="kumar"/> . So far, I'm using a buildfile like the following: <?xml version="1.0"?> <project name="cutter" default="cutter"> <target name="cutter"> <for list="piyush,kumar" param="letter"> <sequential> <echo>var1 @{letter}</echo> </sequential> </for> </target> </project> I'm not sure how to progress this

Target overriding in Ant

孤人 提交于 2020-01-22 13:24:13
问题 Is there a possibility to literally override a target or emulate this somehow? So, when I call <target perform-after="release"> <do-something /> </target> It will act like this: <target name="release"> <antcall target="release" /> <!-- call previous version, not recursion --> <do-something /> </target> I think it has a meaning, I'll describe on Android example: We have an .xml templates for every build.xml in SDK folder ( {$SDK}/tools/ant/*.xml ), these files are included in every generated