Updated build scripts.

CVS checkout is now separated from builds. It's possible to
use the script both for building both the jar file and the whole
distribution either from checked-out code or the local copy.
This commit is contained in:
hns 2001-10-22 16:43:40 +00:00
parent dc741f2231
commit 21c00908c1
3 changed files with 61 additions and 36 deletions

View file

@ -3,9 +3,9 @@
REM --------------------------------------------
REM Defualt == jar
REM "core" target builds core classes
REM "clean" target removes bin directory
REM "jar" target builds core + jar
REM "checkout" target gets sources from helma.org
REM "compile" target compiles java sources
REM "jar" target compiles and builds jar
REM "javadoc" target builds the javadoc
REM "package" target builds core + jar + javadoc + distribution
REM --------------------------------------------
@ -28,7 +28,7 @@ goto final
if "%JAVA_HOME%" == "" goto javahomeerror
if exist %JAVA_HOME%\lib\tools.jar set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
set CP=%CLASSPATH%;ant.jar;xml.jar
set CP=%CLASSPATH%;ant.jar;jaxp.jar;crimson.jar
echo Classpath: %CP%
echo JAVA_HOME: %JAVA_HOME%

View file

@ -2,18 +2,20 @@
# --------------------------------------------
# Default == jar
# "core" target builds core classes
# "clean" target removes bin directory
# "jar" target builds core + jar
# "checkout" target gets sources from helma.org
# "compile" target compiles java sources
# "jar" target compiles and builds jar
# "javadoc" target builds the javadoc
# "package" target builds core + jar + javadoc + distribution
# --------------------------------------------
TARGET=${1}
# export JAVA_HOME=/usr/lib/java
export CVSHOME=:pserver:anonymous@coletta.helma.at:/opt/cvs
cvs -d :pserver:anonymous@coletta.helma.at:/opt/cvs login
JAVA_HOME=/usr/lib/jdk1.3
# comment this out to log in to CVS server
# cvs -d :pserver:anonymous@coletta.helma.at:/opt/cvs login
#--------------------------------------------
# No need to edit anything past here
@ -35,7 +37,7 @@ fi
echo "Now building ${TARGET}..."
CP=${CLASSPATH}:ant.jar:jaxp.jar:parser.jar:../lib/netcomponents.jar:jakarta-ant-1.3-optional.jar
CP=${CLASSPATH}:ant.jar:jaxp.jar:crimson.jar:../lib/netcomponents.jar
echo "Classpath: ${CP}"
echo "JAVA_HOME: ${JAVA_HOME}"
@ -44,3 +46,4 @@ BUILDFILE=build.xml
${JAVA_HOME}/bin/java -classpath ${CP} org.apache.tools.ant.Main -buildfile ${BUILDFILE} ${TARGET}

View file

@ -14,10 +14,11 @@
<property name="version" value="1.2"/>
<property name="project" value="helma"/>
<property name="build.compiler" value="classic"/>
<property name="build.dir" value="../work"/>
<property name="build.dir" value=".."/>
<property name="build.src" value="${build.dir}/src"/>
<property name="build.dest" value="${build.dir}/classes"/>
<property name="build.checkout" value="${build.dir}/checkout"/>
<property name="build.work" value="${build.dir}/work"/>
<property name="build.checkout" value="${build.work}/checkout"/>
<property name="cvs.root" value=":pserver:anonymous@coletta.helma.at:/opt/cvs"/>
<property name="javadoc.destdir" value="../docs/apidocs"/>
<property name="jar.name" value="helma"/>
@ -39,33 +40,42 @@
</target>
<!-- =================================================================== -->
<!-- Copies the source code to the build directory and does filtering -->
<!-- =================================================================== -->
<target name="prepare" depends="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.dest}"/>
<target name="checkout" depends="init">
<!-- cvspass cvsroot="${cvs.root}" password=""/ -->
<mkdir dir="${build.src}"/>
<mkdir dir="${build.checkout}"/>
<cvs cvsRoot="${cvs.root}" package="hop" dest="${build.checkout}"/>
<cvs cvsRoot="${cvs.root}" package="apps/hopblog" dest="${build.dir}"/>
<cvs cvsRoot="${cvs.root}" package="hopbuild/lib" dest="${build.dir}"/>
<cvs cvsRoot="${cvs.root}" package="hopbuild/skeleton" dest="${build.dir}"/>
<copy todir="${build.src}">
<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/hopblog" dest="${build.checkout}"/>
</target>
<!-- =================================================================== -->
<!-- Does replacement on files for dealing with collections. -->
<!-- XXX The efficiency could be improved here; all replacements should -->
<!-- XXX happen during one read/write phase and only for files that have -->
<!-- XXX changed. -->
<!-- =================================================================== -->
<target name="collections" if="coll.present" depends="prepare">
<target name="collections" if="coll.present" depends="init">
<replace dir="${build.src}/helma" includes="**"
token="java.util.Collection" value="${coll.import}.Collection"/>
<replace dir="${build.src}/helma" includes="**"
@ -99,14 +109,18 @@
<!-- =================================================================== -->
<!-- Compiles the source directory -->
<!-- =================================================================== -->
<target name="compile" depends="prepare">
<target name="compile" depends="init">
<mkdir dir="${build.dest}"/>
<javac srcdir="${build.src}"
destdir="${build.dest}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}">
<classpath>
<fileset dir="${build.dir}/hopbuild/lib">
<fileset dir="${build.dir}/lib">
<exclude name="**/helma*.jar" />
<include name="**/*.jar" />
</fileset>
<pathelement path="${classpath}" />
@ -122,15 +136,16 @@
<!-- Creates a .jar file -->
<!-- =================================================================== -->
<target name="jar" depends="compile">
<jar jarfile="${build.dir}/${jar.name}.jar"
<jar jarfile="${build.dir}/${jar.name}-${DSTAMP}.jar"
basedir="${build.dest}"
excludes="**/package.html"/>
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target name="javadocs" depends="prepare">
<target name="javadocs" depends="init">
<mkdir dir="${javadoc.destdir}"/>
<javadoc packagenames="helma.*"
sourcepath="${build.src}"
@ -147,29 +162,39 @@
<!-- =================================================================== -->
<!-- Package -->
<!-- =================================================================== -->
<target name="package" depends="jar">
<target name="package" depends="checkout, jar, javadocs">
<mkdir dir="${final.dir}"/>
<!-- mkdir dir="${final.dir}/static"/ -->
<mkdir dir="${final.dir}/src"/>
<jar jarfile="${final.dir}/src/${Name}-src.jar"
basedir="${build.src}"/>
<!-- copy todir="${final.dir}/src">
<fileset dir="${build.dir}/src"/>
</copy -->
<copy todir="${final.dir}/docs">
<fileset dir="../docs"/>
</copy>
<copy todir="${final.dir}/lib">
<fileset dir="../lib"/>
<fileset dir="${build.checkout}/hopbuild/lib"/>
</copy>
<copy todir="${final.dir}">
<fileset dir="${build.dir}/hopbuild/skeleton"/>
<fileset dir="${build.checkout}/hopbuild/skeleton" excludes="**/CVS"/>
</copy>
<copy todir="${final.dir}/apps/base">
<fileset dir="${build.dir}/apps/hopblog" excludes="**/CVS"/>
<copy todir="${final.dir}/apps">
<fileset dir="${build.checkout}/apps" excludes="**/CVS"/>
</copy>
<copy file="${build.dir}/${jar.name}.jar" todir="${final.dir}/lib"/>
<copy file="${build.dir}/${jar.name}-${DSTAMP}.jar" tofile="${final.dir}/lib/helma.jar"/>
<chmod file="${final.dir}/hop.sh" perm="755"/>
</target>
<!-- =================================================================== -->
@ -201,12 +226,6 @@
<target name="package-all" depends="package-zip, package-tgz">
</target>
<!-- =================================================================== -->
<!-- Packages just the jar with ZIP -->
<!-- =================================================================== -->
<target name="snapshot" depends="jar">
<copy file="${build.dir}/${jar.name}.jar" tofile="../helma-${DSTAMP}.jar"/>
</target>
<!-- =================================================================== -->
<!-- Packages and FTPs the distribution with ZIP and TAG-GZIP -->
@ -238,3 +257,6 @@