User: user57  
  Date: 01/12/05 18:16:06

  Modified:    .        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.4       +2 -2      jbosscx/build.bat
  
  Index: build.bat
  ===================================================================
  RCS file: /cvsroot/jboss/jbosscx/build.bat,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.bat 2001/09/12 00:49:54     1.3
  +++ build.bat 2001/12/06 02:16:06     1.4
  @@ -8,7 +8,7 @@
   REM
   REM  ======================================================================
   REM
  -REM $Id: build.bat,v 1.3 2001/09/12 00:49:54 user57 Exp $
  +REM $Id: build.bat,v 1.4 2001/12/06 02:16:06 user57 Exp $
   REM
   REM Authors:
   REM     Jason Dillon <[EMAIL PROTECTED]>
  @@ -32,7 +32,7 @@
   REM set JAXP_DOM_FACTORY=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
   REM set JAXP_SAX_FACTORY=org.apache.xerces.jaxp.SAXParserFactoryImpl
   
  -set ANT_OPTS=-Djavax.xml.parsers.DocumentBuilderFactory=%JAXP_DOM_FACTORY% 
-Djavax.xml.parsers.SAXParserFactory=%JAXP_SAX_FACTORY%
  +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
  
  
  
  1.9       +14 -1     jbosscx/build.sh
  
  Index: build.sh
  ===================================================================
  RCS file: /cvsroot/jboss/jbosscx/build.sh,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- build.sh  2001/09/12 00:49:54     1.8
  +++ build.sh  2001/12/06 02:16:06     1.9
  @@ -8,7 +8,7 @@
   ##                                                                          ##
   ### ====================================================================== ###
   
  -# $Id: build.sh,v 1.8 2001/09/12 00:49:54 user57 Exp $
  +# $Id: build.sh,v 1.9 2001/12/06 02:16:06 user57 Exp $
   
   PROGNAME=`basename $0`
   DIRNAME=`dirname $0`
  @@ -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      +77 -283   jbosscx/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /cvsroot/jboss/jbosscx/build.xml,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- build.xml 2001/11/22 18:06:46     1.15
  +++ build.xml 2001/12/06 02:16:06     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">
  +]>
   
   <!-- ====================================================================== -->
   <!--                                                                        -->
  @@ -10,116 +12,34 @@
   <!--                                                                        -->
   <!-- ====================================================================== -->
   
  -<!-- $Id: build.xml,v 1.15 2001/11/22 18:06:46 d_jencks Exp $ -->
  +<!-- $Id: build.xml,v 1.16 2001/12/06 02:16:06 user57 Exp $ -->
   
   <project default="main" name="JBoss/Connector">
   
     <!-- ================================================================== -->
  -  <!-- Initialization                                                     -->
  +  <!-- Setup                                                              -->
     <!-- ================================================================== -->
  -
  -  <!-- 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>
  +  <!--
  +     | Include the common Buildmagic elements.
  +     |
  +     | This defines several different targets, properties and paths.
  +     | It also sets up the basic extention tasks amoung other things.
  +   -->
   
  -  <!-- Perform any preperation before init. -->
  -  <target name="_init-prepare">
  -    <available file="${module.root}/etc/local.properties-example"
  -            property="init.have-local-properties"/>
  -  </target>
  +  &buildmagic;
   
  -  <!-- 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>
  +  <!-- ================================================================== -->
  +  <!-- Initialization                                                     -->
  +  <!-- ================================================================== -->
   
  -  <!-- 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>
  +  <!--
  +     | Initialize the build system.  Must depend on '_buildmagic:init'.  
  +     | Other targets should depend on 'init' or things will mysteriously fail.
  +   -->
   
  -  <!-- 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>
  +  <target name="init" unless="init.disable" depends="_buildmagic:init">
     </target>
   
   
  @@ -128,35 +48,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">
  +
  +    <!-- =================== -->
  +    <!-- Basic Configuration -->
  +    <!-- =================== -->
   
  -  <target name="_configure" unless="configure.disable">
       <!-- Module name(s) & version -->
       <property name="module.name" value="connector"/>
       <property name="module.Name" value="JBoss Connector"/>
       <property name="module.version" value="0.2"/>
   
  -    <!-- Invoke the rest of the configuration targets -->
  -    <call target="_configure-tools"/>
  -    <call target="_configure-libraries"/>
  -    <call target="_configure-modules"/>
  -    <call target="_configure-tasks"/>
  -
  -    <!-- 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 Management Extensions (JMX) -->
       <property name="sun.jmx.root" value="${project.thirdparty}/sun/jmx"/>
       <property name="sun.jmx.lib" value="${sun.jmx.root}/lib"/>
  @@ -202,10 +114,11 @@
         <path refid="apache.log4j.classpath"/>
         <path refid="junit.junit.classpath"/>
       </path>
  -  </target>
   
  -  <!-- Configure the external modules which this module depends on. -->
  -  <target name="_configure-modules" unless="configure-modules.disable">
  +    <!-- ======= -->
  +    <!-- Modules -->
  +    <!-- ======= -->
  +
       <!-- J2EE -->
       <property name="jboss.j2ee.root" value="${project.root}/j2ee/output"/>
       <property name="jboss.j2ee.lib" value="${jboss.j2ee.root}/lib"/>
  @@ -233,10 +146,11 @@
         <path refid="jboss.server.classpath"/>
         <path refid="jboss.pool.classpath"/>
       </path>
  -  </target>
   
  -  <!-- Configure the tasks used by this module. -->
  -  <target name="_configure-tasks" unless="configure-tasks.disable">
  +    <!-- ===== -->
  +    <!-- Tasks -->
  +    <!-- ===== -->
  +
       <!-- Where source files live -->
       <property name="source.java" value="${module.source}/main"/>
       <property name="source.etc" value="${module.source}/etc"/>
  @@ -474,187 +388,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>
  +  <target name="install" 
  +       description="Install the structure for a release."
  +       depends="all, _buildmagic:install:default"/>
   
  +  <target name="release" depends="install"/>
   
  -  <!-- ================================================================== -->
  -  <!-- Release                                                            -->
  -  <!-- ================================================================== -->
  +  <target name="release-zip" 
  +       description="Builds a ZIP distribution."
  +       depends="release, _buildmagic:release:zip"/>
   
  -  <!-- 
  -     | Builds a release distribution.
  -   -->
  +  <target name="release-tar" 
  +       description="Builds a TAR distribution."
  +       depends="release, _buildmagic:release:tar"/>
   
  -  <target name="release" depends="install">
  -    <!-- install handles most of the work -->
  -  </target>
  +  <target name="release-tgz" 
  +       description="Builds a TAR-GZ distribution."
  +       depends="release, _buildmagic:release:tgz"/>
   
  -  <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-all"
  +       description="Builds a distribution for each archive type."
  +       depends="release-zip, release-tgz"/>
   
  -  <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."/>
  -
  -
  -  <!-- ================================================================== -->
  -  <!-- Tests                                                              -->
  -  <!-- ================================================================== -->
  -
  -  <!--
  -     | Run all tests.
  -   -->
  -
  -  <target name="tests" depends="init, tests-junit, tests-reports" 
  -       description="Execute all tests.">
  -  </target>
  -
  -  <!--
  -     | Run JUnit tests.
  -   -->
  -
  -  <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 name="clobber" 
  +       description="Cleans up all generated files."
  +       depends="_buildmagic:clobber, clean">
     </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>
  -
  -
  -  <!-- ================================================================== -->
  -  <!-- 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="main"
  +       description="Executes the default target (most)."
  +       depends="most"/>
       
  -  <target name="all" depends="jars, rars, docs"
  -       description="Builds everything."/>
  -
  -  <target name="most" depends="jars, rars"
  -       description="Builds almost everything."/>
  +  <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

Reply via email to