ant

How to set the path environment variable from ant script

北城以北 提交于 2020-01-09 06:51:08
问题 How to set the path environment variable from ant script 回答1: Is this for an <exec> task? You can set environment variables when you run an <exec> task: <exec executable="${my.command}"> <env key="foo" value="bar"/> <arg line="some value"/> </exec> You can use <property environment="env"/> to expand the path: <property environment="env"/> <exec executable="${my.command}"> <env key="PATH" value="${env.PATH}:${my.directory}"/> </exec> If this is for some custom task that requires an environment

Do I have a way to check the existence of a directory in Ant (not a file)?

可紊 提交于 2020-01-09 06:04:20
问题 How do I check for the existence of a folder using Ant? We can check the existence of a file, but can we do the same for a folder as well? 回答1: You use the available task with type set to "dir". For example: <available file="${dir}" type="dir"/> The standard way to do conditional processing is with the condition task. In the example below, running doFoo will echo a message if the directory exists, whereas running doBar will echo a message unless the directory exists. The dir.check target is

Importing ant build.xml in Eclipse

走远了吗. 提交于 2020-01-09 04:18:08
问题 I have an android project that uses ant to build, is it possible to import this ant project in eclipse IDE? update : There is an option to create project using ant build.xml in eclipse File->New->Project->Java->Java project from existing ant Buildfile. and if the build.xml file is selected it show error Specified buildfile does not contain a javac task I guess javac is declared in this task <taskdef name="setup" classname="com.android.ant.SetupTask" classpathref="android.antlibs"/> 回答1: From

adding non-code resources to jar file using Ant

淺唱寂寞╮ 提交于 2020-01-09 03:44:39
问题 I am in the process of packaging my java application into a jar file. I am using ant and eclipse. I need to actually include in the jar a couple of separate, non-code files (xml and txt files) directly under the root folder, not in the same place as the code. I am trying to use includesfile, but that doesn't seem to work, here is my ant target: <target name="distribute" depends="compile" includesfile="readthis.txt"> <jar destfile="${distributionDir}/myjar.jar" > <fileset dir="${outputDir}"/>

Getting Ant <javac> to recognise a classpath

依然范特西╮ 提交于 2020-01-09 02:14:05
问题 I have an Apache Ant build file with a <javac> command that requires four specific JARs to be on the build classpath . I've tried to do this: <project basedir=".." default="build_to_jar" name="Transnet Spectrum Analyzer"> <property environment="env"/> <property name="src" value="src"/> <property name="libsrc" value="library_sources" /> <property name="build" value="build"/> <property name="dist" value="dist"/> <property name="target" value="1.5"/> <property name="libraries" value="./libraries

Hudson + Ant + SVN + Tomcat配置详解

…衆ロ難τιáo~ 提交于 2020-01-08 01:30:07
一、配置背景: 要想介绍Hudson,就要从持续集成开始介绍。持续集成,最开始知道有这个概念的时候是从一本叫做《.NET中的持续集成》,但是本人熟悉的是Java,而不是.Net平台,所以这本书就放下了,没有仔细的看。如今,我们需要用SSH架构开发一个知识管理平台,项目组长给我的任务恰好就是配置持续集成的开发环境。 说了这么半天看来是有点跑题了,还是没有说持续集成是个什么概念。所谓持续集成(Continuous integration)就是:持续集成是一种软件开发实践,即团队开发成员经常集成它们的工作,通常每个成员每天至少集成一次,也就意味着每天可能会发生多次集成。每次集成都通过自动化的构建(包括编译,发布,自动化测试)来验证,从而尽快地发现集成错误。许多团队发现这个过程可以大大减少集成的问题,让团队能够更快的开发内聚的软件。 上述定义是来源于软件大师:马丁福勒(Martin Fowler),大师就是大师,反正我没看懂。我来说说我的理解,在这里,我用举一个例子来说吧…… 现在我们已经进行完了前期的工作(包括:需求的确定,原型的设计等等),到了开始编程的阶段了,我们现在很少有孤军奋战的了吧?大多是小组内各个成员进行配合,编写系统,这样就有个问题,大家的编程环境可能出现差距

ant -f build.xml: exec returned: 2 with phpunit?

别等时光非礼了梦想. 提交于 2020-01-07 07:50:09
问题 I'm going to integrate PHP project with Jenkins follow this guide. Here's my build.xml file This one is from the output when running ant -f build.xml : phpunit: [exec] PHPUnit 3.6.10 by Sebastian Bergmann. [exec] Usage: phpunit [switches] UnitTest [UnitTest.php] [exec] phpunit [switches] <directory> [exec] --log-junit <file> Log test execution in JUnit XML format to file. [exec] --log-tap <file> Log test execution in TAP format to file. [exec] --log-json <file> Log test execution in JSON

javah NullPointerException while using ANT in Eclipse Indigo

为君一笑 提交于 2020-01-07 05:38:28
问题 I'm using an ANT buildscript like so: <project basedir=".."> <property name="src" location="src"/> <property name="classes" location="classes" /> <property name="jnifiles" location="jnifiles" /> <target name="init"> <mkdir dir="${classes}" /> <mkdir dir="${jnifiles}" /> </target> <target name="compile" description="compile the source " > <javac srcdir="${src}" destdir="${classes}" includeantruntime="false" /> </target> <target name="generate-jni"> <javah destdir="${jnifiles}" > <class name=

Command failed to execute : ant jar on Zend Studio

和自甴很熟 提交于 2020-01-07 05:31:18
问题 `cordova library for "android" already exists. No need to download. Continuing. Checking if platform "android" passes minimum requirements... Checking Android requirements... Running "android list target" (output to follow) Available Android targets: ---------- id: 1 or "android-16" Name: Android 4.1.2 Type: Platform API level: 16 Revision: 4 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in Tag/ABIs : default/armeabi-v7a ---------- id: 2

Using “if” condition inside junit element in apache ant script [closed]

て烟熏妆下的殇ゞ 提交于 2020-01-07 05:11:12
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I have tried to use "if-then-else" condition inside junit element in a build.xml file and I am getting the following error while trying to build. junit doesn't support the nested "if" element Is there a work