您好我有螞蟻的build.xml問題,它的工作原理,但有時也不是第一次或在某些計算機等人的作品不Ant構建文件問題
所以在這裏,它是:
<project name="My-java-api" default="dist-api" basedir=".">
<description>
Java API Buildfile
</description>
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="libs" location="libs"/>
<!--if we don't remove folders, when we call compile-api
and classes have already been built, it doesn't build again-->
<target name="-init-api" depends="clean"
description="Create folders libs and build">
<mkdir dir="${build}"/>
<mkdir dir="${libs}"/>
<mkdir dir="${dist}"/>
</target>
<!-- Here I call another buildfile of submodule located at the tree indicated I am
sure the other buildfile works perfect -->
<target name="-pre-build-api" depends="-init-api"
description="Create jelly jar and copy it to libs folder">
<ant dir="../Libraries/jelly/core/"
antfile="build.xml"
target="standalone-jar"/>
<copy todir="${libs}">
<fileset
dir="../Libraries/jelly/core/dist"
includes="jelly-standalone*.jar" />
</copy>
</target>
<!--so now I create this classpath to use for making jar-->
<path id="lib.classpath">
<fileset dir="${libs}" includes="**/*.jar"/>
</path>
<!--I compile source code including the jar that I have just copied to libs-->
<target name="compile-api" depends="-pre-build-api" >
<javac srcdir="${src}"
includeantruntime="false"
destdir="${build}"
classpathref="lib.classpath">
</javac>
</target>
<!-- here i make jar with the classes and using the jar from external project,
I want just one jar for everything -->
<target name="dist-api" depends="compile-api" >
<jar jarfile="${dist}/name-java-api-0.1.jar" basedir="${build}" >
<zipgroupfileset dir="${libs}" includes="**/*.jar" />
</jar>
</target>
<target name="clean"
description="clean up" >
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete dir="${libs}"/>
</target>
編輯:failonerror =「假」添加到全部刪除線
我不習慣螞蟻和我一直在努力,努力,它只是完全不是那麼回事。我希望我可以使用命令行,但不能。 奇怪的是,大多數情況下,如果運行它2次,它會工作,但第一次真奇怪的工作人員發生:要麼不編譯,要麼重複類。可能是什麼原因?非常感謝
它失敗了什麼任務? – davidfmatheson
您能否更具體地瞭解這些故障?你運行什麼任務?怎麼了? –
我也不清楚你的意思是「課程是重複的」。 – davidfmatheson