separated building of snapshot and of distribution.

"build package" now works in helma/work-directory only.
added targets "build snapshot" and "build snapshotcompile" to build helma.jar
added target "build helmadocs" to download documentation from helma.org.
This commit is contained in:
stefanp 2002-04-25 14:08:48 +00:00
parent c7071ce55d
commit c9c85a67c7

View file

@ -14,16 +14,27 @@
<property name="version" value="1.2pre3"/> <property name="version" value="1.2pre3"/>
<property name="project" value="helma"/> <property name="project" value="helma"/>
<property name="build.compiler" value="classic"/> <property name="build.compiler" value="classic"/>
<property name="build.dir" value=".."/>
<property name="build.src" value="${build.dir}/src"/> <property name="home.dir" value=".."/>
<property name="build.dest" value="${build.dir}/classes"/>
<property name="build.work" value="${build.dir}/work"/> <!-- values for building a snapshot -->
<property name="snapshot.src" value="${home.dir}/src/hop"/>
<property name="snapshot.classes" value="${home.dir}/classes"/>
<property name="snapshot.lib" value="${home.dir}/lib"/>
<!-- values for building the distribution -->
<property name="build.work" value="${home.dir}/work"/>
<property name="build.checkout" value="${build.work}/checkout"/> <property name="build.checkout" value="${build.work}/checkout"/>
<property name="cvs.root" value=":pserver:anonymous@coletta.helma.at:/opt/cvs"/> <property name="build.src" value="${build.checkout}/hop"/>
<property name="javadoc.destdir" value="../docs/apidocs"/> <property name="build.lib" value="${build.checkout}/hopbuild/lib"/>
<property name="jar.name" value="helma"/> <property name="build.classes" value="${build.work}/classes"/>
<property name="build.docs" value="${build.work}/docs"/>
<property name="build.javadocs" value="${build.docs}/api"/>
<property name="final.name" value="${project}-${version}"/> <property name="final.name" value="${project}-${version}"/>
<property name="final.dir" value="../${final.name}/"/> <property name="final.dir" value="${build.work}/${final.name}"/>
<property name="cvs.root" value=":pserver:anonymous@coletta.helma.at:/opt/cvs"/>
<property name="jar.name" value="helma"/>
<property name="debug" value="off"/> <property name="debug" value="off"/>
<property name="optimize" value="on"/> <property name="optimize" value="on"/>
<property name="deprecation" value="off"/> <property name="deprecation" value="off"/>
@ -37,43 +48,24 @@
<!-- JDK1.1 collections support --> <!-- JDK1.1 collections support -->
<property name="coll.import" value="com.sun.java.util.collections"/> <property name="coll.import" value="com.sun.java.util.collections"/>
<available classname="${coll.import}.Collection" property="coll.present"/> <available classname="${coll.import}.Collection" property="coll.present"/>
</target> </target>
<!-- =================================================================== --> <!-- =================================================================== -->
<!-- Copies the source code to the build directory and does filtering --> <!-- Copies the source code to the build directory and does filtering -->
<!-- =================================================================== --> <!-- =================================================================== -->
<target name="checkout" depends="init"> <target name="checkout" depends="init">
<!-- cvspass cvsroot="${cvs.root}" password=""/ -->
<mkdir dir="${build.src}"/> <mkdir dir="${build.src}"/>
<mkdir dir="${build.checkout}"/> <mkdir dir="${build.checkout}"/>
<cvs cvsRoot="${cvs.root}" package="hop" dest="${build.checkout}"/> <cvs cvsRoot="${cvs.root}" package="hop" dest="${build.checkout}"/>
<copy todir="${build.src}"> <cvs cvsRoot="${cvs.root}" package="hopbuild" dest="${build.checkout}"/>
<fileset dir="${build.checkout}/hop"
includes="helma/**/*.java,FESI/**/*.java,Acme/**/*.java"/>
</copy>
<cvs cvsRoot="${cvs.root}" package="hopbuild/lib" dest="${build.checkout}"/>
<copy todir="${build.dir}/lib">
<fileset dir="${build.checkout}/hopbuild/lib"/>
</copy>
<cvs cvsRoot="${cvs.root}" package="hopbuild/skeleton" dest="${build.checkout}"/>
<cvs cvsRoot="${cvs.root}" package="apps/base" dest="${build.checkout}"/> <cvs cvsRoot="${cvs.root}" package="apps/base" dest="${build.checkout}"/>
<cvs cvsRoot="${cvs.root}" package="apps/hopblog" dest="${build.checkout}"/> <cvs cvsRoot="${cvs.root}" package="apps/hopblog" dest="${build.checkout}"/>
<cvs cvsRoot="${cvs.root}" package="apps/himp" dest="${build.checkout}"/> <cvs cvsRoot="${cvs.root}" package="apps/himp" dest="${build.checkout}"/>
<cvs cvsRoot="${cvs.root}" package="apps/bloggerapi" dest="${build.checkout}"/> <cvs cvsRoot="${cvs.root}" package="apps/bloggerapi" dest="${build.checkout}"/>
<cvs cvsRoot="${cvs.root}" package="apps/lillebror" dest="${build.checkout}"/> <cvs cvsRoot="${cvs.root}" package="apps/lillebror" dest="${build.checkout}"/>
<cvs cvsRoot="${cvs.root}" package="apps/manage" dest="${build.checkout}"/> <cvs cvsRoot="${cvs.root}" package="apps/manage" dest="${build.checkout}"/>
</target> </target>
<!-- =================================================================== --> <!-- =================================================================== -->
<!-- Does replacement on files for dealing with collections. --> <!-- Does replacement on files for dealing with collections. -->
<!-- XXX The efficiency could be improved here; all replacements should --> <!-- XXX The efficiency could be improved here; all replacements should -->
@ -110,129 +102,135 @@
value="java.util.*;\u000aimport ${coll.import}.*"/> value="java.util.*;\u000aimport ${coll.import}.*"/>
</target> </target>
<!-- =================================================================== --> <!-- =================================================================== -->
<!-- Compiles the source directory --> <!-- Compiles the source directory -->
<!-- =================================================================== --> <!-- =================================================================== -->
<target name="compile" depends="init"> <target name="compile" depends="init">
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.dest}"/>
<javac srcdir="${build.src}" <javac srcdir="${build.src}"
destdir="${build.dest}" destdir="${build.classes}"
debug="${debug}" debug="${debug}"
deprecation="${deprecation}" deprecation="${deprecation}"
optimize="${optimize}"> optimize="${optimize}">
<classpath> <classpath>
<fileset dir="${build.dir}/lib"> <fileset dir="${build.lib}">
<exclude name="**/helma*.jar" />
<include name="**/*.jar" /> <include name="**/*.jar" />
</fileset> </fileset>
<pathelement path="${classpath}" /> <pathelement path="${classpath}" />
</classpath> </classpath>
</javac> </javac>
<rmic classname="helma.framework.core.Application" base="${build.classes}"/>
<rmic classname="helma.framework.core.Application" base="${build.dest}"/> <rmic classname="helma.image.Server" base="${build.classes}"/>
<rmic classname="helma.image.Server" base="${build.dest}"/> <rmic classname="helma.image.RemoteImage" base="${build.classes}"/>
<rmic classname="helma.image.RemoteImage" base="${build.dest}"/>
</target> </target>
<!-- =================================================================== --> <!-- =================================================================== -->
<!-- Creates a .jar file --> <!-- Creates a .jar file -->
<!-- =================================================================== --> <!-- =================================================================== -->
<target name="jar" depends="compile"> <target name="jar" depends="compile">
<jar jarfile="${build.dir}/${jar.name}-${DSTAMP}.jar" <jar jarfile="${build.work}/${jar.name}-${DSTAMP}.jar"
basedir="${build.dest}" basedir="${build.classes}"
excludes="**/package.html"/> excludes="**/package.html"/>
</target> </target>
<!-- =================================================================== --> <!-- =================================================================== -->
<!-- Creates the API documentation --> <!-- Creates the API documentation -->
<!-- =================================================================== --> <!-- =================================================================== -->
<target name="javadocs" depends="init"> <target name="javadocs" depends="init">
<mkdir dir="${javadoc.destdir}"/> <mkdir dir="${build.javadocs}"/>
<javadoc packagenames="helma.*" <javadoc packagenames="helma.*"
sourcepath="${build.src}" sourcepath="${build.src}"
destdir="${javadoc.destdir}" destdir="${build.javadocs}"
author="false" author="false"
private="false" private="false"
version="false" version="false"
windowtitle="${Name} ${version} API" windowtitle="${Name} ${version} API"
doctitle="${Name} ${version} API" doctitle="${Name} ${version} API"
bottom="Copyright &#169; 1998-2001 Helma.org. All Rights Reserved." bottom="Copyright &#169; ${year} Helma.org. All Rights Reserved.">
<classpath>
<fileset dir="${build.lib}">
<include name="**/*.jar" />
</fileset>
<pathelement path="${classpath}" />
</classpath>
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Get the documentation -->
<!-- =================================================================== -->
<target name="helmadocs" depends="init">
<get src="http://www.helma.org/docs/reference/print"
dest="${build.docs}/reference.html"
ignoreerrors="true"
/> />
</target> </target>
<!-- =================================================================== --> <!-- =================================================================== -->
<!-- Package --> <!-- Package -->
<!-- =================================================================== --> <!-- =================================================================== -->
<target name="package" depends="checkout, jar, javadocs"> <target name="package" depends="init, checkout, jar, javadocs, helmadocs">
<mkdir dir="${final.dir}"/> <mkdir dir="${final.dir}"/>
<!-- mkdir dir="${final.dir}/static"/ --> <mkdir dir="${final.dir}/src/hop"/>
<copy todir="${final.dir}/src/hop">
<mkdir dir="${final.dir}/src"/> <fileset dir="${build.checkout}/hop" />
<!-- jar jarfile="${final.dir}/src/${Name}-src.jar"
basedir="${build.src}"/ -->
<copy todir="${final.dir}/src">
<fileset dir="${build.dir}/src" excludes="{Name}-src.jar"/>
</copy> </copy>
<copy todir="${final.dir}/build"> <copy todir="${final.dir}/build">
<fileset dir="${build.dir}/build"/> <fileset dir="${build.checkout}/hopbuild/build"/>
</copy> </copy>
<chmod file="${final.dir}/build/build.sh" perm="755"/> <chmod file="${final.dir}/build/build.sh" perm="755"/>
<copy todir="${final.dir}/docs"> <copy todir="${final.dir}/docs">
<fileset dir="../docs"/> <fileset dir="${build.docs}"/>
</copy> </copy>
<copy todir="${final.dir}/lib"> <copy todir="${final.dir}/lib">
<fileset dir="${build.checkout}/hopbuild/lib"/> <fileset dir="${build.checkout}/hopbuild/lib"/>
</copy> </copy>
<copy file="${build.work}/${jar.name}-${DSTAMP}.jar" tofile="${final.dir}/lib/helma.jar"/>
<copy todir="${final.dir}"> <copy todir="${final.dir}">
<fileset dir="${build.checkout}/hopbuild/skeleton" excludes="**/CVS"/> <fileset dir="${build.checkout}/hopbuild/skeleton" excludes="**/CVS"/>
</copy> </copy>
<chmod file="${final.dir}/hop.sh" perm="755"/>
<copy todir="${final.dir}/apps"> <copy todir="${final.dir}/apps">
<fileset dir="${build.checkout}/apps" excludes="**/CVS,manage/**"/> <fileset dir="${build.checkout}/apps" excludes="**/CVS,manage/**"/>
</copy> </copy>
<copy file="${build.dir}/${jar.name}-${DSTAMP}.jar" tofile="${final.dir}/lib/helma.jar"/>
<chmod file="${final.dir}/hop.sh" perm="755"/>
<mkdir dir="${final.dir}/apps/manage"/> <mkdir dir="${final.dir}/apps/manage"/>
<zip zipfile="${final.dir}/apps/manage/manage.zip" basedir="${build.checkout}/apps/manage/" includes="**"/> <zip zipfile="${final.dir}/apps/manage/manage.zip" basedir="${build.checkout}/apps/manage/" includes="**" excludes="**/properties,readme/**" />
<copy todir="${final.dir}/apps/manage">
<fileset dir="${build.checkout}/apps/manage" includes="app.properties,class.properties,readme.txt"/>
</copy>
</target> </target>
<!-- =================================================================== --> <!-- =================================================================== -->
<!-- Packages the distribution with ZIP --> <!-- Packages the distribution with ZIP -->
<!-- =================================================================== --> <!-- =================================================================== -->
<target name="package-zip" depends="package"> <target name="package-zip" depends="package">
<zip zipfile="../${Name}-${version}.zip" basedir="../" includes="**/${final.name}/**"/> <zip zipfile="${home.dir}/${Name}-${version}.zip" basedir="${build.work}" includes="**/${final.name}/**"/>
</target> </target>
<!-- =================================================================== --> <!-- =================================================================== -->
<!-- Packages the distribution with TAR-GZIP --> <!-- Packages the distribution with TAR-GZIP -->
<!-- =================================================================== --> <!-- =================================================================== -->
<target name="package-tgz" depends="package"> <target name="package-tgz" depends="package">
<tar tarfile="../${Name}-${version}.tar" basedir=".." excludes="**"> <tar tarfile="${build.work}/${Name}-${version}.tar" basedir="${build.work}/${final.name}" excludes="**">
<tarfileset dir=".." mode="755"> <tarfileset dir="${build.work}" mode="755">
<include name="${final.name}/hop.sh"/> <include name="${final.name}/hop.sh"/>
<include name="${final.name}/build/build.sh"/> <include name="${final.name}/build/build.sh"/>
</tarfileset> </tarfileset>
<tarfileset dir=".."> <tarfileset dir="${build.work}">
<include name="${final.name}/**"/> <include name="${final.name}/**"/>
<exclude name="${final.name}/hop.sh"/> <exclude name="${final.name}/hop.sh"/>
<exclude name="${final.name}/build/build.sh"/> <exclude name="${final.name}/build/build.sh"/>
</tarfileset> </tarfileset>
</tar> </tar>
<gzip zipfile="../${Name}-${version}.tar.gz" src="../${Name}-${version}.tar"/> <gzip zipfile="${home.dir}/${Name}-${version}.tar.gz" src="${build.work}/${Name}-${version}.tar"/>
</target> </target>
<!-- =================================================================== --> <!-- =================================================================== -->
@ -241,6 +239,37 @@
<target name="package-all" depends="package-zip, package-tgz"> <target name="package-all" depends="package-zip, package-tgz">
</target> </target>
<!-- =================================================================== -->
<!-- Compiles the source directory for a snapshot -->
<!-- =================================================================== -->
<target name="snapshotcompile" depends="init">
<mkdir dir="${snapshot.classes}"/>
<javac srcdir="${snapshot.src}"
destdir="${snapshot.classes}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}">
<classpath>
<fileset dir="${snapshot.lib}">
<include name="**/*.jar" />
<exclude name="**/helma*.jar" />
</fileset>
<pathelement path="${classpath}" />
</classpath>
</javac>
<rmic classname="helma.framework.core.Application" base="${snapshot.classes}"/>
<rmic classname="helma.image.Server" base="${snapshot.classes}"/>
<rmic classname="helma.image.RemoteImage" base="${snapshot.classes}"/>
</target>
<!-- =================================================================== -->
<!-- Creates a .jar file for a snapshot -->
<!-- =================================================================== -->
<target name="snapshot" depends="snapshotcompile">
<jar jarfile="${snapshot.lib}/${jar.name}-${DSTAMP}.jar"
basedir="${snapshot.classes}"
excludes="**/package.html"/>
</target>
<!-- =================================================================== --> <!-- =================================================================== -->
<!-- These are just some tests --> <!-- These are just some tests -->
@ -249,7 +278,7 @@
<ftp server="piefke.helma.at" <ftp server="piefke.helma.at"
userid="anonymous" userid="anonymous"
password="tobi@helma.at"> password="tobi@helma.at">
<fileset dir="${build.dir}"> <fileset dir="${home.dir}">
<include name="${Name}-${version}.zip,${Name}-${version}.tar.gz"/> <include name="${Name}-${version}.zip,${Name}-${version}.tar.gz"/>
</fileset> </fileset>
</ftp> </ftp>