User: user57
Date: 01/12/05 18:16:09
Modified: jetty build.bat build.sh build.xml
Log:
o adding support for resource:// url
o moved common buildmagic initialization, release, help and other bits
into a common.xml resource file.
o dropped _configure* targets, replaced with one single configure target
o dropped *most* tests (junit related) targets (some are still there)
need to come up with a general stradegy on this to go anyfurther.
o build systems now MUST be executed from the build.sh or build.bat scripts
this will help reduce problems by users using ant by itself (with out the
proper version of libraries... for users that want to get around this
let me know).
o fixed local.properties install everywhere
o build.log should be deleted properly now on win32 systems, or at least
if the delete failes it will not cause the build to fail.
Revision Changes Path
1.3 +15 -7 contrib/jetty/build.bat
Index: build.bat
===================================================================
RCS file: /cvsroot/jboss/contrib/jetty/build.bat,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- build.bat 2001/09/01 15:50:33 1.2
+++ build.bat 2001/12/06 02:16:09 1.3
@@ -8,25 +8,31 @@
REM
REM ======================================================================
REM
-REM $Id: build.bat,v 1.2 2001/09/01 15:50:33 slaboure Exp $
+REM $Id: build.bat,v 1.3 2001/12/06 02:16:09 user57 Exp $
REM
REM Authors:
REM Jason Dillon <[EMAIL PROTECTED]>
-REM Sacha Labourey <[EMAIL PROTECTED]>
+REM Sacha Labourey <[EMAIL PROTECTED]>
REM
REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the ANT_HOME variable: we want to use *our*
+REM ANT version and associated JARs.
REM ******************************************************
REM Ignore the users classpath, cause it might mess
REM things up
REM ******************************************************
-
-SETLOCAL
+SETLOCAL
+
set CLASSPATH=
set ANT_HOME=
+set JAXP_DOM_FACTORY=org.apache.crimson.jaxp.DocumentBuilderFactoryImpl
+set JAXP_SAX_FACTORY=org.apache.crimson.jaxp.SAXParserFactoryImpl
+REM set JAXP_DOM_FACTORY=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
+REM set JAXP_SAX_FACTORY=org.apache.xerces.jaxp.SAXParserFactoryImpl
+
+set ANT_OPTS=-Djava.protocol.handler.pkgs=planet57.net.protocol
-Djavax.xml.parsers.DocumentBuilderFactory=%JAXP_DOM_FACTORY%
-Djavax.xml.parsers.SAXParserFactory=%JAXP_SAX_FACTORY% -Dbuild.script=build.bat
REM ******************************************************
REM - "for" loops have been unrolled for compatibility
@@ -82,5 +88,7 @@
:ExecuteBatch
echo Calling %1 %2 %3 %4 %5 %6 %7 %8
call %1 %2 %3 %4 %5 %6 %7 %8
+
+:end
-:end
\ No newline at end of file
+pause
1.8 +15 -2 contrib/jetty/build.sh
Index: build.sh
===================================================================
RCS file: /cvsroot/jboss/contrib/jetty/build.sh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- build.sh 2001/09/04 05:08:08 1.7
+++ build.sh 2001/12/06 02:16:09 1.8
@@ -129,12 +129,25 @@
ANT_OPTS="$ANT_OPTS -Djavax.xml.parsers.SAXParserFactory=$JAXP_SAX_FACTORY"
fi
+ # need to specify planet57/buildmagic protocol handler package
+ ANT_OPTS="$ANT_OPTS -Djava.protocol.handler.pkgs=planet57.net.protocol"
+
+ # setup some build properties
+ ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+
# change to the directory where the script lives so users are not forced
# to be in the same directory as build.xml
cd $DIRNAME
+ # export some stuff for ant
export ANT ANT_HOME ANT_OPTS
- exec $ANT $ANT_OPTIONS "$@"
+
+ # execute in debug mode, or simply execute
+ if [ "x$ANT_DEBUG" != "x" ]; then
+ /bin/sh -x $ANT $ANT_OPTIONS "$@"
+ else
+ exec $ANT $ANT_OPTIONS "$@"
+ fi
}
##
1.16 +87 -290 contrib/jetty/build.xml
Index: build.xml
===================================================================
RCS file: /cvsroot/jboss/contrib/jetty/build.xml,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- build.xml 2001/12/05 01:31:34 1.15
+++ build.xml 2001/12/06 02:16:09 1.16
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE project>
+<!DOCTYPE project [
+ <!ENTITY buildmagic SYSTEM "resource://planet57/tools/buildmagic/common.xml">
+]>
<!-- ====================================================================== -->
<!-- -->
@@ -15,111 +17,31 @@
<project default="main" name="JBoss Plugins/Jetty">
<!-- ================================================================== -->
+ <!-- Setup -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Include the common Buildmagic elements.
+ |
+ | This defines several different targets, properties and paths.
+ | It also sets up the basic extention tasks amoung other things.
+ -->
+
+ <property name="_project.root" value="../.."/>
+
+ &buildmagic;
+
+
+ <!-- ================================================================== -->
<!-- Initialization -->
<!-- ================================================================== -->
- <!-- Load Buildmagic extention tasks. -->
- <taskdef resource="planet57/tools/buildmagic/task/autoload.properties"/>
- <taskdef name="property" classname="planet57.tools.buildmagic.task.Property"/>
-
- <!-- Initialize the build system. -->
- <target name="init" depends="_init-prepare" unless="init.disable">
- <!-- Perform any setup required if we are a child of another build -->
- <call target="_init-child"/>
-
- <!-- Setup the basic project roots. -->
- <path id="project.root"><pathelement location="../.."/></path>
- <property name="project.root" refid="project.root"/>
- <property name="project.build" value="${project.root}/build"/>
-
- <!-- Include user and project property overrides. -->
- <property file="${user.home}/.buildmagic.properties"/>
- <property file="${user.home}/.ant.properties"/>
-
- <!-- Setup the project environment. -->
- <property file="${project.build}/local.properties"/>
- <property name="project.tools" value="${project.root}/tools"/>
- <property name="project.thirdparty" value="${project.root}/thirdparty"/>
-
- <!-- Setup the module environment. -->
- <property name="module.root" value="${basedir}"/>
- <call target="_init-local-properties"/>
- <property file="${module.root}/local.properties"/>
- <property name="module.source" value="${module.root}/src"/>
- <property name="module.output" value="${module.root}/output"/>
- <property name="module.tools" value="${module.root}/tools"/>
- <property name="module.thirdparty" value="${module.root}/thirdparty"/>
-
- <!-- Setup the build.log -->
- <call target="_init-buildlog"/>
-
- <!-- Load common properties -->
- <property resource="planet57/tools/buildmagic/common.properties"/>
-
- <!-- Setup the build timestamp & build identifer properties -->
- <tstamp>
- <format property="build.number" pattern="yyyyMMddHHmm"/>
- </tstamp>
- <property name="build.id" value="${build.number}"/>
-
- <!-- Invoke the configure task -->
- <call target="_configure"/>
-
- <!-- Late bind properties & install filters -->
- <resolver force="${buildmagic.resolveproperties.force}"/>
- <propertyfilter all="${buildmagic.propertyfilter.all}"/>
-
- <!-- Show some information -->
- <call target="_init-show-environment"/>
-
- <!-- Finish up -->
- <property name="init.disable" value="true"/>
- </target>
-
- <!-- Perform any preperation before init. -->
- <target name="_init-prepare">
- <available file="${module.root}/etc/local.properties-example"
- property="init.have-local-properties"/>
- </target>
-
- <!-- Perform any setup required if we are a child of another build -->
- <target name="_init-child" if="init.have-parent">
- <!-- Disable the build.log, our parent will catch it -->
- <property name="init-buildlog.disable" value="true"/>
- </target>
-
- <!-- Install the local.properties example if it is there -->
- <target name="_init-local-properties" if="init.have-local-properties">
- <!-- Setup the local.properties file as needed -->
- <copy file="${module.root}/etc/local.properties-example"
- tofile="${module.root}/local.properties" filtering="yes"/>
- <property file="${module.root}/local.properties"/>
- </target>
-
- <!-- Initialize the build.log -->
- <target name="_init-buildlog" unless="init-buildlog.disable">
- <record name="${basedir}/build.log" append="no" loglevel="info"/>
- <property name="init-buildlog.disable" value="true"/>
- </target>
-
- <!-- Show the running environment if -Dinit.verbose=true -->
- <target name="_init-show-environment" if="init.verbose">
- <echo><![CDATA[
-project.root: ${project.root}
-module.root: ${module.root}
-user.home: ${user.home}
-build.compiler: ${build.compiler}
-java.home: ${java.home}
-java.class.path: ${java.class.path}
-java.version: ${java.version}
-java.vendor: ${java.vendor}
-java.vm.version: ${java.vm.version}
-java.vm.name: ${java.vm.name}
-java.vm.info: ${java.vm.info}
-os.name: ${os.name}
-os.arch: ${os.arch}
-os.version: ${os.version}
-]]></echo>
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable" depends="_buildmagic:init">
</target>
@@ -128,35 +50,27 @@
<!-- ================================================================== -->
<!--
- | Configure the build system.
+ | Configure the build system.
|
- | Configuration elements should be placed in the appropriate
- | _configure-* targets.
+ | This target is invoked by the Buildmagic initialization logic and
+ | should contain module specific configuration elements.
-->
+
+ <target name="configure" unless="configure.disable">
- <target name="_configure" unless="configure.disable">
+ <!-- =================== -->
+ <!-- Basic Configuration -->
+ <!-- =================== -->
+
<!-- Module name(s) & version -->
<property name="module.name" value="jetty-plugin"/>
<property name="module.Name" value="JBoss Jetty Plugin"/>
- <property name="module.version" value="unspecified"/>
-
- <!-- Invoke the rest of the configuration targets -->
- <call target="_configure-tools"/>
- <call target="_configure-libraries"/>
- <call target="_configure-modules"/>
- <call target="_configure-tasks"/>
+ <property name="module.version" value="DEV"/>
- <!-- Load common task properties -->
- <property resource="planet57/tools/buildmagic/task.properties"/>
- </target>
+ <!-- ========= -->
+ <!-- Libraries -->
+ <!-- ========= -->
- <!-- Configure the thirdparty tools required to build this module. -->
- <target name="_configure-tools" unless="configure-tools.disable">
- <!-- No non-standard tools are required for this module. -->
- </target>
-
- <!-- Configure the thirdparty libraries required by this module. -->
- <target name="_configure-libraries" unless="configure-libraries.disable">
<!-- Java Naming and Directory Interface (JNDI) -->
<property name="sun.jndi.root" value="${project.thirdparty}/sun/jndi"/>
<property name="sun.jndi.lib" value="${sun.jndi.root}/lib"/>
@@ -231,10 +145,11 @@
<path refid="mortbay.jetty.classpath"/>
<path refid="mortbay.jetty3extra.classpath"/>
</path>
- </target>
+
+ <!-- ======= -->
+ <!-- Modules -->
+ <!-- ======= -->
- <!-- Configure the external modules which this module depends on. -->
- <target name="_configure-modules" unless="configure-modules.disable">
<!-- Server -->
<property name="jboss.server.root" value="${project.root}/server/output"/>
<property name="jboss.server.lib" value="${jboss.server.root}/lib"/>
@@ -246,10 +161,11 @@
<path id="dependentmodule.classpath">
<path refid="jboss.server.classpath"/>
</path>
- </target>
+
+ <!-- ===== -->
+ <!-- Tasks -->
+ <!-- ===== -->
- <!-- Configure the tasks used by this module. -->
- <target name="_configure-tasks" unless="configure-tasks.disable">
<!-- Where source files live -->
<property name="source.java" value="${module.source}/main"/>
<property name="source.etc" value="${module.source}/etc"/>
@@ -368,8 +284,9 @@
| Build all jar files.
-->
- <target name="jars" depends="compile" description="Build the Service
-Archive">
+ <target name="jars"
+ description="Build the Service Archive"
+ depends="compile">
<mkdir dir="${build.lib}"/>
<jar jarfile="${build.lib}/${module.name}.sar">
@@ -504,187 +421,67 @@
<!-- ================================================================== -->
- <!-- Install -->
+ <!-- Install & Release -->
<!-- ================================================================== -->
-
- <target name="install" depends="all">
- <!-- Copy the output directory to the install directory -->
- <mkdir dir="${install.root}"/>
- <copy todir="${install.root}" filtering="no">
- <fileset dir="${module.output}">
- <include name="**/*"/>
- <exclude name="${install.id}/**"/>
- </fileset>
- </copy>
- </target>
-
-
- <!-- ================================================================== -->
- <!-- Release -->
- <!-- ================================================================== -->
-
- <!--
- | Builds a release distribution.
- -->
- <target name="release" depends="install">
- <!-- install handles most of the work -->
- </target>
-
- <target name="release-zip" depends="release"
- description="Builds a ZIP release distribution.">
- <zip zipfile="${module.output}/${release.id}.zip">
- <fileset dir="${module.output}">
- <include name="${release.id}/**"/>
- </fileset>
- </zip>
- </target>
-
- <target name="release-tar" depends="release"
- description="Builds a TAR release distribution.">
- <tar tarfile="${module.output}/${release.id}.tar" longfile="gnu"
- basedir="${module.output}"
- includes="${release.id}/**">
- </tar>
- </target>
-
- <target name="release-tgz" depends="release-tar"
- description="Builds a TAR-GZIP release distribution.">
- <gzip src="${module.output}/${release.id}.tar"
- zipfile="${module.output}/${release.id}.tgz"/>
- </target>
-
- <target name="release-all" depends="release-zip, release-tgz"
- description="Builds a distribution for each archive type."/>
+ <target name="install"
+ description="Install the structure for a release."
+ depends="all, _buildmagic:install:default"/>
+ <target name="release" depends="install"/>
- <!-- ================================================================== -->
- <!-- Tests -->
- <!-- ================================================================== -->
+ <target name="release-zip"
+ description="Builds a ZIP distribution."
+ depends="release, _buildmagic:release:zip"/>
- <!--
- | Run all tests.
- -->
+ <target name="release-tar"
+ description="Builds a TAR distribution."
+ depends="release, _buildmagic:release:tar"/>
- <target name="tests" depends="init, tests-junit, tests-reports"
- description="Execute all tests.">
- </target>
+ <target name="release-tgz"
+ description="Builds a TAR-GZ distribution."
+ depends="release, _buildmagic:release:tgz"/>
- <!--
- | Run JUnit tests.
- -->
+ <target name="release-all"
+ description="Builds a distribution for each archive type."
+ depends="release-zip, release-tgz"/>
- <target name="tests-junit" depends="jars">
- <mkdir dir="${build.reports}"/>
- <junit dir="${module.output}"
- printsummary="${junit.printsummary}"
- haltonerror="${junit.haltonerror}"
- haltonfailure="${junit.haltonfailure}"
- fork="${junit.fork}"
- timeout="${junit.timeout}"
- jvm="${junit.jvm}">
-
- <jvmarg value="${junit.jvm.options}"/>
-
- <classpath>
- <pathelement location="${build.classes}"/>
- <path refid="javac.classpath"/>
- </classpath>
-
- <formatter type="${junit.formatter.type}"
- usefile="${junit.formatter.usefile}"/>
-
- <batchtest todir="${build.reports}"
- haltonerror="${junit.batchtest.haltonerror}"
- haltonfailure="${junit.batchtest.haltonfailure}"
- fork="${junit.batchtest.fork}">
-
- <fileset dir="${build.classes}">
- <include name="**/*TestCase.class"/>
- <include name="**/*TestSuite.class"/>
- </fileset>
- </batchtest>
- </junit>
- </target>
-
- <target name="reports" depends="tests-reports"
- description="Generates all reports."/>
-
- <target name="tests-reports" depends="tests-reports-html"/>
-
- <target name="tests-reports-html" depends="compile">
- <mkdir dir="${build.reports}/html"/>
-
- <junitreport todir="${build.reports}">
- <fileset dir="${build.reports}">
- <include name="TEST-*.xml"/>
- </fileset>
- <report format="frames" todir="${build.reports}/html"/>
- </junitreport>
- </target>
-
<!-- ================================================================== -->
<!-- Cleaning -->
<!-- ================================================================== -->
<!-- Clean up all build output -->
- <target name="clean" depends="init"
- description="Cleans up most generated files.">
- <delete dir="${module.output}"/>
+ <target name="clean"
+ description="Cleans up most generated files."
+ depends="_buildmagic:clean">
</target>
<!-- Clean up all generated files -->
- <target name="clobber" depends="clean"
- description="Cleans up all generated files.">
- <delete file="${module.root}/local.properties"/>
- <delete file="${module.root}/build.log"/>
- </target>
-
-
- <!-- ================================================================== -->
- <!-- Workspace -->
- <!-- ================================================================== -->
-
- <target name="update-project" depends="init">
- <echo>Updating project workspace...</echo>
- <cvs command="update -d" dest="${project.root}"/>
- </target>
-
- <target name="update-module" depends="init">
- <echo>Updating module workspace...</echo>
- <cvs command="update -d" dest="${module.root}"/>
+ <target name="clobber"
+ description="Cleans up all generated files."
+ depends="_buildmagic:clobber, clean">
</target>
<!-- ================================================================== -->
- <!-- Help -->
- <!-- ================================================================== -->
-
- <target name="help" depends="init">
- <projecthelp taskname="help">
- <header><![CDATA[
- The ${module.Name} module.
-]]></header>
- <footer><![CDATA[
- -projecthelp for all targets
- -help for full options
-]]></footer>
- </projecthelp>
- </target>
-
-
- <!-- ================================================================== -->
<!-- Misc. -->
<!-- ================================================================== -->
-
- <target name="main" depends="most"
- description="Executes the default target (most)."/>
-
- <target name="all" depends="jars, docs"
- description="Builds everything."/>
- <target name="most" depends="jars"
- description="Builds almost everything."/>
+ <target name="main"
+ description="Executes the default target (most)."
+ depends="most"/>
+
+ <target name="all"
+ description="Builds everything."
+ depends="jars, docs"/>
+
+ <target name="most"
+ description="Builds almost everything."
+ depends="jars"/>
+
+ <target name="help"
+ description="Show this help message."
+ depends="_buildmagic:help:standard"/>
</project>
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development