|
|
|
|
|
Re: How to create a build.xml file and use it as an ANT scipt for compiling? [message #514125 is a reply to message #514091] |
Fri, 12 February 2010 09:01  |
Eclipse User |
|
|
|
I do not use any special variables to make reference either to the eclipse installation folder or workspace directories...
I place "build.xml" file in the root directory of the project. When I run it (using "Run As"/"ANT build" option), eclipse launches it using that same directory as working directory.
This is a stripped sample of a common "build.xml" file I do use:
<?xml version="1.0" encoding="UTF-8"?>
<project name="cmlibs" default="dist" basedir=".">
<property name="build.base" value="/tmp/build" />
<property name="build.this" value="${build.base}/${ant.project.name}" />
<target name="clean">
<delete dir="${build.this}" includes="**/*" />
</target>
<target name="compile" depends="clean">
<mkdir dir="${build.this}" />
<javac srcdir="src" destdir="${build.this}" debug="${debug}" encoding="UTF-8" target="1.5">
</javac>
</target>
<target name="dist" depends="compile">
<copy todir="${build.this}">
<fileset dir="src" excludes="**/*.java" />
</copy>
<jar basedir="${build.this}" destfile="${build.base}/${ant.project.name}-${version}.jar" manifest="src/META-INF/MANIFEST.MF" />
<zip basedir="src" destfile="${build.base}/${ant.project.name}-${version}-sources.jar" />
</target>
</project>
Hope it's useful.
|
|
|
Powered by
FUDForum. Page generated in 0.03508 seconds