367 lines
17 KiB
XML
367 lines
17 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<project name="Helma" default="usage" basedir=".">
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Initializes some variables -->
|
|
<!-- =================================================================== -->
|
|
<target name="init">
|
|
<property name="Name" value="helma"/>
|
|
<property name="year" value="1998-${year}"/>
|
|
<property name="version" value="1.4.2"/>
|
|
<property name="project" value="helma"/>
|
|
|
|
<property name="cvs.root.apps" value=":pserver:anonymous@adele.helma.at:/opt/cvs/apps"/>
|
|
<property name="cvs.root.helma" value=":pserver:anonymous@adele.helma.at:/opt/cvs/helma"/>
|
|
<property name="cvs.apps.tag" value="HEAD"/>
|
|
|
|
<property name="home.dir" value=".."/>
|
|
<property name="build.dir" value="${home.dir}/build"/>
|
|
<property name="build.src" value="${home.dir}/src"/>
|
|
<property name="build.lib" value="${home.dir}/lib"/>
|
|
<property name="build.classes" value="${home.dir}/classes"/>
|
|
<property name="build.docs" value="${home.dir}/docs"/>
|
|
<property name="build.javadocs" value="${home.dir}/docs/api"/>
|
|
|
|
<property name="build.work" value="${home.dir}/work"/>
|
|
<property name="build.dist" value="${home.dir}/dist"/>
|
|
|
|
<property name="jar.name" value="${project}"/>
|
|
<property name="package.name" value="${project}-${version}"/>
|
|
|
|
<property name="debug" value="on"/>
|
|
<property name="optimize" value="on"/>
|
|
<property name="deprecation" value="off"/>
|
|
|
|
<path id="build.class.path">
|
|
<fileset dir="${home.dir}/lib">
|
|
<exclude name="**/helma*.jar" />
|
|
<include name="**/*.jar" />
|
|
</fileset>
|
|
</path>
|
|
|
|
<tstamp/>
|
|
|
|
<filter token="year" value="${year}"/>
|
|
<filter token="version" value="${version}"/>
|
|
<filter token="date" value="${TODAY}"/>
|
|
</target>
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Help on usage -->
|
|
<!-- =================================================================== -->
|
|
<target name="help" depends="usage" />
|
|
<target name="usage">
|
|
<echo message=""/>
|
|
<echo message=""/>
|
|
<echo message="Helma build instructions"/>
|
|
<echo message="-------------------------------------------------------------"/>
|
|
<echo message=""/>
|
|
<echo message=" available targets are:"/>
|
|
<echo message=""/>
|
|
<echo message=" compile --> compiles the source code to ./classes"/>
|
|
<echo message=" jar --> generates the ./lib/helma-YYYYMMDD.jar file"/>
|
|
<echo message=" javadocs --> generates the API docs"/>
|
|
<echo message=" docs --> tries to retrieve the HTML documentation "/>
|
|
<echo message=" (may need proxy settings in startscript)"/>
|
|
<echo message=" package --> generates the distribution (zip and tar.gz)"/>
|
|
<echo message=" app [name] --> gets an application from the cvs and zips it"/>
|
|
<echo message=""/>
|
|
<echo message=" usage --> provides help on using the build tool (default)"/>
|
|
<echo message=""/>
|
|
<echo message=" See comments inside the build.xml file for more details."/>
|
|
<echo message="-------------------------------------------------------------"/>
|
|
<echo message=""/>
|
|
<echo message=""/>
|
|
</target>
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Compiles the source directory -->
|
|
<!-- =================================================================== -->
|
|
<target name="compile" depends="init">
|
|
<mkdir dir="${build.classes}"/>
|
|
<!-- copy the imageio file -->
|
|
<copy file="${build.src}/META-INF/services/javax.imageio.spi.ImageWriterSpi"
|
|
todir="${build.classes}/META-INF/services"/>
|
|
<!-- copy helma db style sheet -->
|
|
<copy file="${build.src}/helma/objectmodel/dom/helma.xsl"
|
|
todir="${build.classes}/helma/objectmodel/dom" />
|
|
<javac srcdir="${build.src}"
|
|
destdir="${build.classes}"
|
|
debug="${debug}"
|
|
deprecation="${deprecation}"
|
|
optimize="${optimize}">
|
|
<classpath refid="build.class.path" />
|
|
</javac>
|
|
<rmic classname="helma.framework.core.RemoteApplication" base="${build.classes}"/>
|
|
</target>
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Creates a helma.jar file (snapshot) in the lib-directory -->
|
|
<!-- =================================================================== -->
|
|
<target name="jar" depends="compile">
|
|
<jar jarfile="${build.lib}/${jar.name}-${DSTAMP}.jar"
|
|
basedir="${build.classes}"
|
|
excludes="**/package.html,**/main/launcher/**"/>
|
|
<jar jarfile="${home.dir}/launcher.jar"
|
|
basedir="${build.classes}"
|
|
includes="**/main/launcher/**"
|
|
manifest="${build.src}/helma/main/launcher/manifest.txt"/>
|
|
<!-- Copy timestamped helma jar file to lib/helma.jar -->
|
|
<copy file="${build.lib}/${jar.name}-${DSTAMP}.jar"
|
|
tofile="${build.lib}/${jar.name}.jar"/>
|
|
</target>
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Creates the API documentation -->
|
|
<!-- =================================================================== -->
|
|
<target name="javadocs" depends="init">
|
|
<mkdir dir="${build.javadocs}"/>
|
|
<javadoc packagenames="helma.*"
|
|
sourcepath="${build.src}"
|
|
destdir="${build.javadocs}"
|
|
author="false"
|
|
private="false"
|
|
version="false"
|
|
windowtitle="${Name} ${version} API"
|
|
doctitle="${Name} ${version} API"
|
|
bottom="Copyright © ${year} Helma.org. All Rights Reserved."
|
|
classpathref="build.class.path"
|
|
/>
|
|
</target>
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Get the documentation (currently can fail due to request time-out -->
|
|
<!-- or missing support for proxies) -->
|
|
<!-- =================================================================== -->
|
|
<target name="docs" depends="init">
|
|
<get src="http://www.helma.org/docs/reference/print"
|
|
dest="${build.docs}/reference.html"
|
|
ignoreerrors="true"
|
|
/>
|
|
</target>
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Creates the full helma distribution -->
|
|
<!-- =================================================================== -->
|
|
<target name="package" depends="init">
|
|
<mkdir dir="${build.work}"/>
|
|
|
|
<!-- create the main part of helma -->
|
|
<antcall target="package-raw">
|
|
<param name="distribution" value="main" />
|
|
</antcall>
|
|
|
|
<chmod perm="755">
|
|
<fileset dir="${build.work}">
|
|
<include name="hop.sh"/>
|
|
</fileset>
|
|
</chmod>
|
|
|
|
<!-- checkout the demo apps (and zip manage-app) -->
|
|
<antcall target="package-apps" />
|
|
|
|
<!-- zip up the whole thing -->
|
|
<antcall target="package-zip">
|
|
<param name="filename" value="${package.name}"/>
|
|
</antcall>
|
|
<antcall target="package-tgz">
|
|
<param name="filename" value="${package.name}"/>
|
|
</antcall>
|
|
|
|
<!-- make the src distributions -->
|
|
<antcall target="javadocs"/>
|
|
<antcall target="package-src-zip">
|
|
<param name="filename" value="${package.name}"/>
|
|
</antcall>
|
|
<antcall target="package-src-tgz">
|
|
<param name="filename" value="${package.name}"/>
|
|
</antcall>
|
|
|
|
<!-- clean up -->
|
|
<delete dir="${build.work}"/>
|
|
</target>
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Compile Helma and prepare the skeleton in a temporary directory. -->
|
|
<!-- Used by package . -->
|
|
<!-- =================================================================== -->
|
|
<target name="package-raw" depends="init, jar">
|
|
|
|
<!-- copy the framework (apps.props, server.props, hop/db, hop/static) -->
|
|
<copy todir="${build.work}">
|
|
<fileset dir="${build.dir}/${distribution}" excludes="**/CVS**"/>
|
|
</copy>
|
|
|
|
<!-- copy the launcher jar file -->
|
|
<copy file="${home.dir}/launcher.jar" todir="${build.work}/"/>
|
|
|
|
<!-- copy README.txt -->
|
|
<copy file="${home.dir}/README.txt" todir="${build.work}/"/>
|
|
|
|
<!-- copy the whole docs-directory -->
|
|
<!-- copy todir="${build.work}/docs">
|
|
<fileset dir="${build.docs}"/>
|
|
</copy -->
|
|
|
|
<!-- copy all libraries except helma-YYYYMMDD.jar -->
|
|
<copy todir="${build.work}/lib">
|
|
<fileset dir="${home.dir}/lib">
|
|
<exclude name="**/helma-*.jar" />
|
|
<include name="**/*.jar" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<!-- create lib/ext directory -->
|
|
<mkdir dir="${build.work}/lib/ext"/>
|
|
|
|
<!-- copy the whole licenses-directory -->
|
|
<copy todir="${build.work}/licenses">
|
|
<fileset dir="${home.dir}/licenses" excludes="**/CVS**"/>
|
|
</copy>
|
|
|
|
<!-- copy the scripts directory -->
|
|
<copy todir="${build.work}/scripts">
|
|
<fileset dir="${home.dir}/scripts" excludes="**/CVS**"/>
|
|
</copy>
|
|
|
|
<!-- zip the sourcecode -->
|
|
<!-- mkdir dir="${build.work}/src"/>
|
|
<tar tarfile="${build.work}/src/helma-src.tar" basedir="${build.src}/">
|
|
<tarfileset dir="${build.src}">
|
|
<include name="${build.src}/**"/>
|
|
</tarfileset>
|
|
</tar>
|
|
<gzip zipfile="${build.work}/src/helma-src.tar.gz" src="${build.work}/src/helma-src.tar"/>
|
|
<delete file="${build.work}/src/helma-src.tar"/ -->
|
|
</target>
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Checkout demo apps, put them in work directory and zip manage app -->
|
|
<!-- =================================================================== -->
|
|
<target name="package-apps" depends="init">
|
|
|
|
<mkdir dir="${build.work}/apps" />
|
|
|
|
<!-- get demo apps -->
|
|
<cvs cvsRoot="${cvs.root.apps}" command="export" tag="${cvs.apps.tag}" package="base" dest="${build.work}/apps" />
|
|
<cvs cvsRoot="${cvs.root.apps}" command="export" tag="${cvs.apps.tag}" package="bloggerapi" dest="${build.work}/apps" />
|
|
<cvs cvsRoot="${cvs.root.apps}" command="export" tag="${cvs.apps.tag}" package="gong" dest="${build.work}/apps" />
|
|
<cvs cvsRoot="${cvs.root.apps}" command="export" tag="${cvs.apps.tag}" package="lillebror" dest="${build.work}/apps" />
|
|
|
|
<antcall target="package-manage" />
|
|
|
|
</target>
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Checkout and zip manage application -->
|
|
<!-- =================================================================== -->
|
|
<target name="package-manage" depends="init">
|
|
<cvs cvsRoot="${cvs.root.apps}" command="export" tag="${cvs.apps.tag}" package="manage" dest="${build.work}" />
|
|
<mkdir dir="${build.work}/apps/manage"/>
|
|
<zip zipfile="${build.work}/apps/manage/manage.zip" basedir="${build.work}/manage/" includes="**" excludes="**/properties,readme/**" />
|
|
<copy todir="${build.work}/apps/manage">
|
|
<fileset dir="${build.work}/manage" includes="app.properties,class.properties,readme.txt"/>
|
|
</copy>
|
|
<delete dir="${build.work}/manage" />
|
|
</target>
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Packages the work directory with TAR-GZIP -->
|
|
<!-- needs parameter ${filename} for final dist-file -->
|
|
<!-- =================================================================== -->
|
|
<target name="package-tgz" depends="init">
|
|
<mkdir dir="${build.dist}" />
|
|
<fixcrlf srcdir="${build.work}" eol="lf" eof="remove" includes="**/*.txt, **/*.properties, **/*.hac, **/*.js, **/*.skin" />
|
|
<tar tarfile="${build.dist}/${filename}.tar" basedir="${build.work}" excludes="**">
|
|
<tarfileset prefix="${filename}" dir="${build.work}" mode="755">
|
|
<include name="hop.sh"/>
|
|
</tarfileset>
|
|
<tarfileset prefix="${filename}" dir="${build.work}">
|
|
<include name="**"/>
|
|
<exclude name="hop.sh"/>
|
|
<exclude name="**/jimi.jar"/>
|
|
</tarfileset>
|
|
</tar>
|
|
<gzip zipfile="${build.dist}/${filename}.tar.gz" src="${build.dist}/${filename}.tar"/>
|
|
<delete file="${build.dist}/${filename}.tar"/>
|
|
</target>
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Packages the work directory with ZIP -->
|
|
<!-- needs parameter ${filename} for final dist-file -->
|
|
<!-- =================================================================== -->
|
|
<target name="package-zip" depends="init">
|
|
<mkdir dir="${build.dist}" />
|
|
<fixcrlf srcdir="${build.work}" eol="crlf" includes="**/*.txt, **/*.properties, **/*.hac, **/*.js, **/*.skin, **/*.xml" />
|
|
<zip zipfile="${build.dist}/${filename}.zip">
|
|
<zipfileset dir="${build.work}" prefix="${filename}" includes="**" excludes="**/jimi.jar"/>
|
|
</zip>
|
|
</target>
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Packages Helma src and build directories with TAR-GZIP -->
|
|
<!-- needs parameter ${filename} for final dist-file -->
|
|
<!-- =================================================================== -->
|
|
<target name="package-src-tgz" depends="init">
|
|
<mkdir dir="${build.dist}" />
|
|
<tar tarfile="${build.dist}/${filename}-src.tar">
|
|
<tarfileset prefix="${filename}" dir="${home.dir}"
|
|
includes="src/**,build/**,docs/**,license.txt,licenses/**,lib/jimi.jar"/>
|
|
</tar>
|
|
<gzip zipfile="${build.dist}/${filename}-src.tar.gz" src="${build.dist}/${filename}-src.tar"/>
|
|
<delete file="${build.dist}/${filename}-src.tar"/>
|
|
</target>
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Packages Helma src and build directories with ZIP -->
|
|
<!-- needs parameter ${filename} for final dist-file -->
|
|
<!-- =================================================================== -->
|
|
<target name="package-src-zip" depends="init">
|
|
<mkdir dir="${build.dist}" />
|
|
<zip zipfile="${build.dist}/${filename}-src.zip">
|
|
<zipfileset dir="${home.dir}" prefix="${filename}"
|
|
includes="src/**,build/**,docs/**,license.txt,licenses/**,lib/jimi.jar" />
|
|
</zip>
|
|
</target>
|
|
|
|
<!-- =================================================================== -->
|
|
<!-- Gets an application from the cvs and zips/targzs it -->
|
|
<!-- =================================================================== -->
|
|
<target name="app" depends="init">
|
|
<mkdir dir="${build.dist}" />
|
|
<mkdir dir="${build.work}" />
|
|
|
|
<!-- to retrieve special versions of an application insert
|
|
additional attributes: tag="TAGNAME" or date="1972-09-24 20:05" -->
|
|
<cvs cvsRoot="${cvs.root.apps}" command="export" tag="HEAD" package="${application}" dest="${build.work}" />
|
|
|
|
<fixcrlf srcdir="${build.work}" eol="crlf" eof="add" includes="**/*.txt, **/*.properties, **/*.hac, **/*.js, **/*.skin, **/*.xml" />
|
|
<zip zipfile="${build.dist}/${application}-${DSTAMP}.zip" basedir="${build.work}" includes="**"/>
|
|
|
|
<fixcrlf srcdir="${build.work}" eol="lf" eof="remove" includes="**/*.txt, **/*.properties, **/*.hac, **/*.js, **/*.skin" />
|
|
<tar tarfile="${build.dist}/${application}-${DSTAMP}.tar" basedir="${build.work}">
|
|
<tarfileset dir="${build.work}">
|
|
<include name="${build.work}/**"/>
|
|
</tarfileset>
|
|
</tar>
|
|
<gzip zipfile="${build.dist}/${application}-${DSTAMP}.tar.gz" src="${build.dist}/${application}-${DSTAMP}.tar" />
|
|
|
|
<delete file="${build.dist}/${application}-${DSTAMP}.tar" />
|
|
<delete dir="${build.work}" />
|
|
</target>
|
|
|
|
</project>
|