Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ant.

  • Loading branch information...
commit b92817b35bedd30e0d8b464c8e23b840830c4d1e 1 parent 98ed96f
@philipa philipa authored
View
41 build.bat
@@ -0,0 +1,41 @@
+@echo off
+
+if "%JAVA_HOME%" == "" goto error
+
+if not "%LIB_HOME%" == "" goto skip
+
+set LIB_HOME=.\lib
+
+:skip
+
+echo.
+echo Grinder Build System
+echo --------------------
+
+set ANT_HOME=.\ant
+
+set LOCALCLASSPATH=%ANT_HOME%\ant_1_1.jar;%JAVA_HOME%\lib\tools.jar
+for %%i in (%LIB_HOME%\*.jar) do call lcp.bat %%i
+
+echo.
+echo Building with classpath %LOCALCLASSPATH%
+
+echo.
+echo Starting Ant...
+
+%JAVA_HOME%\bin\java.exe -Dant.home="%ANT_HOME%" -classpath "%LOCALCLASSPATH%" org.apache.tools.ant.Main %1 %2 %3 %4 %5
+
+goto end
+
+:error
+
+echo "ERROR: JAVA_HOME not found in your environment."
+echo.
+echo "Please, set the JAVA_HOME variable in your environment to match the"
+echo "location of the Java Virtual Machine you want to use."
+
+:end
+
+set LOCALCLASSPATH=
+set ANT_HOME=
+set LIB_HOME=
View
23 build.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+if [ "$JAVA_HOME" = "" ] ; then
+ echo "ERROR: JAVA_HOME not found in your environment."
+ echo
+ echo "Please, set the JAVA_HOME variable in your environment to match the"
+ echo "location of the Java Virtual Machine you want to use."
+ exit 1
+fi
+
+ANT_HOME=./etc/ant
+
+if [ -n "${CYGWIN}" ]
+then
+ ANT_HOME=`cygpath -w ${ANT_HOME}`
+ WLS_HOME=`cygpath -w ${WLS_HOME}`
+
+ LOCALCLASSPATH="${ANT_HOME}\ant_1_1.jar;${ANT_HOME}\xerces_1_2.jar;${JAVA_HOME}\lib\tools.jar;${CLASSPATH}"
+else
+ LOCALCLASSPATH="${ANT_HOME}/ant_1_1.jar:${ANT_HOME}/xerces_1_2.jar:${JAVA_HOME}/lib/tools.jar:${CLASSPATH}"
+fi
+
+${JAVA_HOME}/bin/java -Dant.home=$ANT_HOME -classpath $LOCALCLASSPATH org.apache.tools.ant.Main -buildfile etc/build.xml $*
View
243 build.xml
@@ -0,0 +1,243 @@
+<!--
+
+"How to build the Grinder" by Philip Aston, with apologies to Stefano
+Mazzocchi <stefano@apache.org>.
+
+Introduction
+============
+
+The Cocoon (http://xml.apache.org/) build.xml file says:
+
+ "Cocoon is an highly componentized software. This means: they are
+ lazy and reuse whatever possible. But also means: we avoid
+ duplication of efforts and Cocoon development can go on
+ concurrently with the other used projects without interference. At
+ the end: Cocoon evolves much faster :)"
+
+Now guess where I ripped this off from? :-)
+
+
+Installing the build tools
+==========================
+
+The Grinder build system is based on Jakarta Ant, which is a Java
+building tool originally developed for the Jakarta Tomcat project but
+now used in many other Apache projects and extended by many
+developers.
+
+Ant is a little but very handy tool that uses a build file written in XML
+(this file) as building instructions. For more information refer to
+"http://jakarta.apache.org/ant/".
+
+Because the ant files are a quite large, and change rarely, I'm
+distributing them separately. To start building the Grinder you need
+to expand the grinder distrbution, and then expand the ant
+distribution over the top so that an ant directory is created.
+
+The only thing that you have to make sure, is the "JAVA_HOME" environment
+property should be set to match the JVM you want to use. That's it.
+
+
+Building instructions
+=====================
+
+Ok, let's build the baby. First, make sure your current working directory is
+where this very file is located. Then type
+
+ ./build.sh (unix)
+ .\build.bat (win32)
+
+if everything is right and all the required packages are visible, this action
+will generate a file called "cocoon.jar" in the "./build" directory. Note, that
+if you do further development, compilation time is reduced since Ant is able
+to detect which files have changed an to recompile them at need.
+
+Also, you'll note that reusing a single JVM instance for each task, increases
+tremendously the performance of the whole build system, compared to other
+tools (i.e. make or shell scripts) where a new JVM is started for each task.
+
+-->
+
+<project default="jar" basedir=".">
+
+ <!-- =================================================================== -->
+ <!-- Initialization target -->
+ <!-- =================================================================== -->
+ <target name="init">
+ <tstamp/>
+ <!-- what -->
+ <property name="Name" value="Grinder"/>
+ <property name="name" value="grinder"/>
+ <property name="version" value="0.7"/>
+ <property name="year" value="2000"/>
+
+ <!-- how -->
+ <property name="build.compiler" value="classic"/>
+ <property name="debug" value="on"/>
+ <property name="optimize" value="on"/>
+ <property name="deprecation" value="on"/>
+
+ <!-- source of all evil -->
+ <property name="src.dir" value="src"/>
+ <property name="etc.dir" value="etc"/>
+ <property name="examples.dir" value="examples"/>
+
+ <!-- javadoc -->
+ <property name="javadoc.dir" value="doc/javadoc"/>
+ <property name="javadoc.packages" value="net.grinder.*"/>
+ <property name="javadoc.css" value="${etc.dir}/javadoc.css"/>
+
+ <!-- output -->
+ <property name="build.dir" value="build"/>
+ <property name="build.src" value="${build.dir}/src"/>
+ <property name="build.classes" value="${build.dir}/classes"/>
+ <property name="lib.dir" value="lib"/>
+ <property name="lib.jar" value="${name}.jar"/>
+ <property name="dist.root" value="distribution"/>
+ <property name="dist.dir" value="${dist.root}/${name}-${version}"/>
+ <property name="dist.jar" value="${name}-${version}.jar"/>
+
+ <!-- too thick to figure this out without RTFM -->
+ <filter token="year" value="${year}"/>
+ <filter token="version" value="${version}"/>
+ <filter token="date" value="${TODAY}"/>
+ <filter token="log" value="true"/>
+ <filter token="verbose" value="true"/>
+
+ <echo message="** Building ${Name} ${version} [${year}] on ${TODAY} **"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Help on usage -->
+ <!-- =================================================================== -->
+ <target name="usage" depends="init">
+ <echo message=" Useful targets are:"/>
+ <echo message=" compile runs javac"/>
+ <echo message=" jar [default] creates ${lib.dir}/${lib.jar}"/>
+ <echo message=" javadoc generates the javadoc"/>
+ <echo message=" dist generates the distribution"/>
+ <echo message=" antdist generates the Ant distribution"/>
+ <echo message=" clean removes class files"/>
+ <echo message=" realclean removes all generated files"/>
+ <echo message=" usage this"/>
+ <echo message=""/>
+ <echo message=" See the comments in the build.xml file for more details."/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Prepares a copy of the source code -->
+ <!-- =================================================================== -->
+ <target name="prepare-weblogic" if="weblogic.examples" depends="init">
+ <copydir src="${src.dir}"
+ dest="${build.src}"
+ includes="**/weblogic/**"
+ filtering="on"/>
+ </target>
+
+ <target name="prepare-src" depends="prepare-weblogic, init">
+ <copydir src="${src.dir}"
+ dest="${build.src}"
+ excludes="**/weblogic/**"
+ filtering="on"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Compiles the source directory -->
+ <!-- =================================================================== -->
+ <target name="compile" depends="prepare-src">
+ <mkdir dir="${build.classes}"/>
+
+ <javac srcdir="${build.src}"
+ destdir="${build.classes}"
+ debug="${debug}"
+ optimize="${optimize}"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Creates the classes jar -->
+ <!-- =================================================================== -->
+ <target name="jar" depends="compile">
+ <mkdir dir="${lib.dir}"/>
+
+ <jar jarfile="${lib.dir}/${lib.jar}"
+ basedir="${build.classes}"
+ manifest="${build.src}/manifest.mf"
+ includes="net/grinder/**"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Creates the API documentation -->
+ <!-- =================================================================== -->
+ <target name="javadoc" depends="init">
+ <mkdir dir="${javadoc.dir}"/>
+ <javadoc packagenames="${javadoc.packages}"
+ sourcepath="${src.dir}"
+ destdir="${javadoc.dir}"
+ author="true"
+ version="false"
+ use="false"
+ noindex="false"
+ windowtitle="${Name}"
+ doctitle="${Name}"
+ bottom="Copyright &#169; ${year} Paco Gomez, Philip Aston. All Rights Reserved."
+ stylesheetfile="${javadoc.css}"
+ />
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Creates the distribution hierachy -->
+ <!-- =================================================================== -->
+ <target name="distribution-hierarchy" depends="jar,javadoc">
+ <copydir src="${src.dir}"
+ dest="${dist.dir}/${src.dir}"
+ filtering="on"/>
+
+ <copyfile src="${lib.dir}/${lib.jar}"
+ dest="${dist.dir}/${lib.dir}/${lib.jar}"/>
+
+ <copydir src="${javadoc.dir}" dest="${dist.dir}/${javadoc.dir}"/>
+
+ <copydir src="${etc.dir}" dest="${dist.dir}/${etc.dir}"/>
+ <copydir src="${examples.dir}" dest="${dist.dir}/${examples.dir}"/>
+
+ <copydir src="." dest="${dist.dir}"
+ includes="build.*, ChangeLog, COPYING, lcp.bat, TODO"
+ excludes="prj.el"
+ filtering="on"/>
+
+ <chmod perm="+x" file="${dist.dir}/build.sh"/>
+ <fixcrlf srcdir="${dist.dir}" includes="build.sh" cr="remove"/>
+ <fixcrlf srcdir="${dist.dir}" includes="build.bat" cr="add"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Packages the distribution as .zip -->
+ <!-- =================================================================== -->
+ <target name="dist" depends="distribution-hierarchy">
+ <jar jarfile="${dist.jar}"
+ basedir="${dist.root}"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Clean targets -->
+ <!-- =================================================================== -->
+ <target name="clean" depends="init">
+ <deltree dir="${build.dir}"/>
+ </target>
+
+ <target name="realclean" depends="clean">
+ <deltree dir="${dist.root}"/>
+ <delete file="${dist.jar}"/>
+ <deltree dir="${javadoc.dir}"/>
+ <deltree dir="${lib.dir}"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- For old times sake... -->
+ <!-- =================================================================== -->
+ <target name="cruelworld" depends="realclean, dist">
+ </target>
+
+</project>
+
+<!-- End of file -->
View
25 etc/javadoc.css
@@ -0,0 +1,25 @@
+/* Page background color */
+body { background-color: #FFFFFF }
+
+/* Table colors */
+.TableHeadingColor { background: #D0D0D0 }
+.TableSubHeadingColor { background: #E0E0E0 }
+.TableRowColor { background: #F9F9F9 }
+
+/* Navigation bar fonts and colors */
+.NavBarCell1 { background-color:#D0D0D0;}
+.NavBarCell1Rev { background-color:#A0A0A0;}
+.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;}
+.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;}
+.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#E0E0E0;}
+.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#F0F0F0;}
+
+/* Font used in left-hand frame lists */
+.FrameTitleFont { font-size: normal; font-family: Helvetica, Arial, sans-serif }
+.FrameHeadingFont { font-size: normal; font-family: Helvetica, Arial, sans-serif }
+.FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif }
+
+/* Link colors styling */
+A:link { color: #0000A0 } /* unvisited link */
+A:visited { color: #A00000 } /* visited links */
+A:active { color: #00A000 } /* active links */
View
2  etc/lcp.bat
@@ -0,0 +1,2 @@
+set LOCALCLASSPATH=%LOCALCLASSPATH%;%1
+
View
2  src/manifest.mf
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Main-Class: net.grinder.Grinder
Please sign in to comment.
Something went wrong with that request. Please try again.