Sunday, September 30, 2007

build Example

&lt?xml version="1.0" encoding="UTF-8"?&gt
&ltproject basedir="." default="build" name="npsoap"&gt &ltproperty file="build.properties" /&gt &ltpath id="project.classpath"&gt &ltpathelement location="${build.dir}" /&gt &ltfileset dir="${lib.dir}"&gt &ltinclude name="**/*.jar" /&gt &lt/fileset&gt &ltpathelement location="${tomcat.dir}/common/lib/servlet-api.jar" /&gt &ltpathelement location="${tomcat.dir}/common/lib/jsp-api.jar" /&gt &lt/path&gt &ltpath id="project.source"&gt &ltpathelement location="${basedir}/src" /&gt &lt/path&gt
&lttarget name="init"&gt &ltmkdir dir="${build.dir}" /&gt &ltmkdir dir="${build.dir}/classes" /&gt &ltmkdir dir="${build.dir}/web" /&gt &ltmkdir dir="${dist.dir}" /&gt &lt/target&gt &lttarget name="clean"&gt &ltdelete dir="${build.dir}" /&gt &lt/target&gt
&lttarget name="build" depends="init" &gt &ltjavac destdir="${build.dir}/classes" debug="true" debuglevel="lines,vars,source"&gt &ltsrc refid="project.source" /&gt &ltclasspath refid="project.classpath" /&gt &lt/javac&gt &lt!-- copy hibernate mapping files and properties --&gt &ltcopy todir="${build.dir}/classes"&gt &ltfileset dir="${basedir}/src"&gt &ltinclude name="**/*.properties" /&gt &ltinclude name="**/*.xml" /&gt &ltinclude name="**/*.xsd" /&gt &ltexclude name="**/*Test.xml" /&gt &ltexclude name="**/*.java" /&gt &lt/fileset&gt &lt/copy&gt &ltcopy todir="${build.dir}/classes"&gt &ltfileset dir="${basedir}/conf"&gt &ltinclude name="**/*.properties" /&gt &ltinclude name="**/*.xml" /&gt &ltinclude name="**/*.xsd" /&gt &ltexclude name="**/*Test.xml" /&gt &ltexclude name="**/*.java" /&gt &lt/fileset&gt &lt/copy&gt &lt!-- copy web files --&gt &ltcopy todir="${build.dir}/web"&gt &ltfileset dir="${basedir}/web"&gt &ltinclude name="**/*" /&gt &lt/fileset&gt &lt/copy&gt &lt/target&gt &lttarget name="jar" depends="build"&gt &lt!-- create the npsoap.war file for distribution --&gt &ltdelete&gt &ltfileset dir="${lib.dir}"&gt &ltinclude name="npsoap_*.jar"/&gt &lt/fileset&gt &lt/delete&gt &lttstamp&gt&lt/tstamp&gt &ltjar destfile="${lib.dir}/npsoap_${DSTAMP}.jar" &gt &ltfileset dir="${build.dir}/classes"&gt &ltexclude name="**/*.xml" /&gt &ltexclude name="**/*.xsd" /&gt &ltexclude name="*.properties" /&gt &lt/fileset&gt &lt/jar&gt &lt/target&gt
&lttarget name="war" depends="jar"&gt &lt!-- create the npsoap.war file for distribution --&gt &ltdelete file="${dist.dir}/npsoap.war" /&gt &ltbuildnumber file="build.version" /&gt &lttstamp /&gt &ltwar destfile="${dist.dir}/npsoap.war" webxml="${basedir}/web/WEB-INF/web.xml"&gt &ltmanifest&gt &ltattribute name="Vendor" value="${product.vendor}" /&gt &ltattribute name="Product" value="${product.name}" /&gt &ltattribute name="Build-ID" value="${DSTAMP}${TSTAMP} - ${build.number}" /&gt &ltattribute name="Build-Date" value="${TODAY}" /&gt &ltattribute name="Specification-Version" value="0.0.1" /&gt &ltattribute name="Implementation-Title" value="${product.name}" /&gt &ltattribute name="Implementation-Version" value="${DSTAMP}${TSTAMP} - ${build.number}" /&gt &ltattribute name="Implementation-Vendor" value="${product.vendor}" /&gt &lt/manifest&gt &ltclasses dir="${build.dir}/classes"&gt &ltinclude name="**/*.xml" /&gt &ltinclude name="**/*.xsd" /&gt &ltinclude name="**/*.properties" /&gt &ltinclude name="**/*.ks" /&gt &lt/classes&gt &ltlib dir="${lib.dir}"&gt &ltinclude name="**/*.jar" /&gt &ltexclude name="ojdbc14.jar" /&gt &lt/lib&gt &ltfileset dir="${build.dir}/web"&gt &ltexclude name="WEB-INF/web.xml" /&gt &ltexclude name="WEB-INF/lib/**/*.jar" /&gt &lt/fileset&gt &lt/war&gt &lt/target&gt
&lt/project&gt



## Vendor
product.vendor=European Computer Telecoms AG
product.name=RbtBilling
lib.dir=${basedir}/web/WEB-INF/lib
tomcat.dir=C:/Programme/Apache Software Foundation/Tomcat 5.5
## Location of documentation
docs.dir=${basedir}/docs
## Location of javadoc
javadoc.dir=${basedir}/docs/api
## Build directory
build.dir=${basedir}/build
## Directory for distributable files
dist.dir=${basedir}/dist
## Version
version=0.1

No comments: