User: user57
Date: 01/07/28 17:52:30
Modified: . Tag: jboss_buildmagic build.sh build.xml config.xml
Log:
o simplified configuration, cleaned up classpath namespace & added more
documentation comments.
Revision Changes Path
No revision
No revision
1.1.2.2 +45 -15 jboss-j2ee/Attic/build.sh
Index: build.sh
===================================================================
RCS file: /cvsroot/jboss/jboss-j2ee/Attic/build.sh,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- build.sh 2001/07/28 00:48:00 1.1.2.1
+++ build.sh 2001/07/29 00:52:30 1.1.2.2
@@ -23,14 +23,21 @@
## ##
### ====================================================================== ###
-# $Id: build.sh,v 1.1.2.1 2001/07/28 00:48:00 user57 Exp $
+# $Id: build.sh,v 1.1.2.2 2001/07/29 00:52:30 user57 Exp $
PROGNAME=`basename $0`
DIRNAME=`dirname $0`
GREP="grep"
+ROOT="/"
-# the default search path for ant
-ANT_SEARCH_PATH="../tools/apache/ant ../tools/ant ./tools/apache/ant ./tools/ant
./ant"
+# the default search path for buildmagic/ant
+ANT_SEARCH_PATH="\
+ tools/planet57/buildmagic \
+ tools/buildmagic \
+ buildmagic \
+ tools/apache/ant \
+ tools/ant \
+ ant"
# the default build file name
ANT_BUILD_FILE="build.xml"
@@ -60,6 +67,19 @@
done
}
+search() {
+ search="$*"
+ for d in $search; do
+ ANT_HOME="`pwd`/$d"
+ ANT="$ANT_HOME/bin/ant"
+ if [ -x "$ANT" ]; then
+ # found one
+ echo $ANT
+ break
+ fi
+ done
+}
+
#
# Main function.
#
@@ -69,22 +89,32 @@
# try our best to find ANT
if [ "x$ANT" = "x" ]; then
- if [ "x$ANT_HOME" = "x" ]; then
- search="$ANT_SEARCH_PATH"
- else
- search="$ANT_HOME"
- fi
-
found=""
- for d in $search; do
- ANT_HOME="$d"
+
+ if [ "x$ANT_HOME" != "x" ]; then
ANT="$d/bin/ant"
if [ -x "$ANT" ]; then
- # found one
found="true"
- break
fi
- done
+ else
+ # try the search path
+ ANT=`search $ANT_SEARCH_PATH`
+ target="build"
+ _cwd=`pwd`
+
+ while [ "x$ANT" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+ cd ..
+ cwd=`pwd`
+ ANT=`search $ANT_SEARCH_PATH`
+ done
+
+ # make sure we get back
+ cd $_cwd
+
+ if [ "$cwd" != "$ROOT" ]; then
+ found="true"
+ fi
+ fi
# complain if we did not find anything
if [ "$found" != "true" ]; then
@@ -105,7 +135,7 @@
fi
fi
- export ANT
+ export ANT ANT_HOME
exec $ANT $ANT_OPTIONS "$@"
}
1.1.2.7 +197 -141 jboss-j2ee/Attic/build.xml
Index: build.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-j2ee/Attic/build.xml,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- build.xml 2001/07/28 01:32:07 1.1.2.6
+++ build.xml 2001/07/29 00:52:30 1.1.2.7
@@ -9,25 +9,8 @@
<!-- See terms of license at http://www.gnu.org. -->
<!-- -->
<!-- ====================================================================== -->
-<!-- -->
-<!-- Configuration Files (in order of precedence): -->
-<!-- -->
-<!-- ${module.root}/build.xml* (this file) -->
-<!-- ${project.config}/override.properties -->
-<!-- ${module.root}/override.properties -->
-<!-- ${user.home}/.buildmagic.properties -->
-<!-- ${user.home}/.ant.properties -->
-<!-- ${project.config}/local.properties -->
-<!-- ${module.root}/local.properties -->
-<!-- ${project.config}/config.properties -->
-<!-- ${module.root}/config.properties -->
-<!-- ${module.root}/config.xml* -->
-<!-- -->
-<!-- * Required -->
-<!-- -->
-<!-- ====================================================================== -->
-<!-- $Id: build.xml,v 1.1.2.6 2001/07/28 01:32:07 user57 Exp $ -->
+<!-- $Id: build.xml,v 1.1.2.7 2001/07/29 00:52:30 user57 Exp $ -->
<project name="jboss-j2ee" default="main">
@@ -35,46 +18,68 @@
<!-- Basic module configuration -->
<!-- ================================================================== -->
- <!-- Define ${module.root} to equal ${basedir} -->
+ <!--
+ | Load Buildmagic Ant extentions.
+ |
+ | To keep the build system as simple as possible these extension tasks
+ | must already be on the ant or system classpath.
+ -->
+ <taskdef name="taskdef" classname="planet57.tools.buildmagic.task.Taskdef"/>
+ <taskdef resource="planet57/tools/buildmagic/task/autoload.properties"/>
+
+ <!--
+ | Setup the basic module roots.
+ |
+ | module.root - Should be the directory this file is in
+ | project.root - Where the project root directory is
+ | project.config - Where the project configuration files live
+ -->
<property name="module.root" value="${basedir}"/>
-
- <!-- Specify the location of our parent (could be a project or ..) -->
- <property name="project.root" value="${module.root}/.."/>
-
- <!-- Specify where the module parent config files live. -->
+ <property name="project.root">
+ <findroot basedir="." suffix="build/build.xml"/>
+ </property>
<property name="project.config" value="${project.root}/build"/>
- <!-- Include project & user-global property overrides -->
+ <!--
+ | Include user, project and module property overrides.
+ |
+ | override.properties - Used rarely (ignore)
+ | .buildmagic.properties - Provide Buildmagic specific properties
+ | .ant.properties - Ant properties
+ | local.properties - User local module properties
+ | config.properties - Used rarely (ignore)
+ -->
<property file="${project.config}/override.properties"/>
<property file="${module.root}/override.properties"/>
<property file="${user.home}/.buildmagic.properties"/>
<property file="${user.home}/.ant.properties"/>
+ <property file="${module.root}/local.properties"/>
+ <property file="${project.config}/local.properties"/>
+ <property file="${module.root}/config.properties"/>
+ <property file="${moudle.parent.config}/config.properties"/>
- <!-- Specify where the module source directories are -->
+ <!--
+ | Setup the basic environment for a source module.
+ |
+ | module.source - The module source root
+ | module.output - The root where build output will be placed
+ | module.build - Where released files will be placed
+ | module.release - Where released files will be placed
+ | tools.root - Where to build support tools live
+ | thirdparty.root - Where to thirdparty libraries live
+ -->
<property name="module.source" value="${module.root}/src"/>
-
- <!-- Specify where the root directory where build output will be placed -->
<property name="module.output" value="${module.root}/output"/>
-
- <!-- Specify where released files will be placed -->
<property name="module.build" value="${module.output}"/>
-
- <!-- Specify where released files will be placed -->
<property name="module.release" value="${module.output}/release"/>
-
- <!-- Module parent directories -->
<property name="tools.root" value="${project.root}/tools"/>
<property name="thirdparty.root" value="${project.root}/thirdparty"/>
- <!-- Include user local property overrides -->
- <property file="${module.root}/local.properties"/>
- <property file="${project.config}/local.properties"/>
-
- <!-- Include config property overrides -->
- <property file="${module.root}/config.properties"/>
- <property file="${moudle.parent.config}/config.properties"/>
-
- <!-- Load module configuration -->
+ <!--
+ | Load project configuration.
+ |
+ | config.xml - Define most configuration elements here (required).
+ -->
&config;
@@ -82,48 +87,54 @@
<!-- Initialize, Configure and Bootstrap the build system -->
<!-- ================================================================== -->
- <!-- Bootstrap all required extensions -->
- <target name="bootstrap" depends="bootstrap-init" unless="bootstraped-already">
- <!-- Build local Ant extensions (if required) -->
- <!-- Mark things as bootstrapped -->
+ <!--
+ | Bootstrap all required extensions.
+ |
+ | Build local Ant extensions here if they are required.
+ |
+ | This target will not run once the bootstraped-already is set.
+ -->
+ <target name="bootstrap"
+ depends="bootstrap-init"
+ unless="bootstraped-already">
<property name="bootstraped-already" value="true"/>
</target>
- <!-- Fail if the required dependencies are missing -->
- <target name="bootstrap-init" depends="bootstrap-check"
unless="have-bootstrap-dependencies-already">
+ <!-- Fail if the required bootstrapping dependencies are missing -->
+ <target name="bootstrap-init"
+ depends="bootstrap-check"
+ unless="have-bootstrap-dependencies-already">
<echo>Missing some or all of the required dependencies.</echo>
<fail message="Can not continue."/>
</target>
<!-- Check for required libraries -->
<target name="bootstrap-check" unless="bootstraped-already">
- <!-- BuildMagic -->
- <available classname="planet57.tools.buildmagic.task.Taskdef"
- classpathref="buildmagic.classpath"
- property="have-bootstrap-dependencies-already"/>
+ <!-- Check for required extensions here -->
+ <property name="have-bootstrap-dependencies-already" value="true"/>
</target>
- <!-- Configure the build system -->
- <target name="configure" unless="configured-already"
+ <!--
+ | Configure the module build system.
+ |
+ | o Updates/installs example files if they exist
+ | o Invokes the 'configure-hook' target, which should be defined in
+ | config.xml.
+ |
+ | This target will not run once the configured-already property is set.
+ -->
+ <target name="configure"
+ unless="configured-already"
description="Configure the module build system.">
-
- <!-- Where example files will live -->
<property name="module.examples" value="${module.root}/etc"/>
- <!-- The extension for example files -->
<property name="module.examples.extension" value="-example"/>
-
- <!-- Put the example files in place -->
<copy todir="${module.root}" filtering="yes">
<fileset dir="${module.examples}/">
<include name="**/*${module.examples.extension}"/>
</fileset>
<mapper type="glob" from="*${module.examples.extension}" to="*"/>
</copy>
-
- <!-- Execute module configure hook -->
<antcall target="configure-hook"/>
-
- <!-- Mark things as configured -->
<property name="configured-already" value="true"/>
</target>
@@ -132,44 +143,31 @@
<property name="configured-already" value="true"/>
</target>
- <!-- Initialize the build system -->
- <target name="init" depends="configure, bootstrap" unless="initialized-already">
- <!-- Setup timestamp properties -->
+ <!--
+ | Initialize the build system.
+ |
+ | o Sets the timestamp and build.number properties
+ | o Installs property defaults
+ | o Displays some module information
+ | o Invokes to 'init-hook' target which should be defined in config.xml
+ | o Resolves properties for psuedo late-binding
+ | o Installs filters for each property
+ |
+ | This target will not run once the initialized-already property is set.
+ -->
+ <target name="init"
+ depends="configure, bootstrap"
+ unless="initialized-already">
<tstamp>
<format property="build.number" pattern="yyyyMMddHHmm"/>
</tstamp>
<property name="build.id" value="${build.number}"/>
-
- <!-- Load a better version of taskdef -->
- <taskdef name="installtask"
- classname="planet57.tools.buildmagic.task.Taskdef"
- classpathref="buildmagic.classpath"/>
-
- <!-- Load all of the BuildMagic tasks -->
- <installtask classpathref="buildmagic.classpath">
- <task resource="planet57/tools/buildmagic/task/autoload.properties"/>
- </installtask>
-
- <!-- Load common BuildMagic properties -->
- <property resource="planet57/tools/buildmagic/common.properties"
- classpathref="buildmagic.classpath"/>
-
- <!-- Load default task properties -->
- <property resource="planet57/tools/buildmagic/task.properties"
- classpathref="buildmagic.classpath"/>
-
- <!-- Show some informative fluff -->
- <echo>Project root is ${project.root}</echo>
- <echo>Module root is ${module.root}</echo>
-
- <!-- Execute module init hook -->
+ <property resource="planet57/tools/buildmagic/common.properties"/>
+ <property resource="planet57/tools/buildmagic/task.properties"/>
+ <moduleinfo/>
<call target="init-hook" unless="bypass-init-hook"/>
-
- <!-- Resolve all properties & install filters -->
<resolver force="${buildmagic.resolveproperties.force}"/>
<propertyfilter all="${buildmagic.propertyfilter.all}"/>
-
- <!-- Mark things as initialized -->
<property name="initialized-already" value="true"/>
</target>
@@ -184,13 +182,19 @@
</target>
-
<!-- ================================================================== -->
<!-- Compile -->
<!-- ================================================================== -->
- <!-- Compile everything -->
- <target name="compile" depends="compile-classes"
+ <!--
+ | Compile everything.
+ |
+ | This target should depend on other compile-* targets for each
+ | different type of compile that needs to be performed, short of
+ | documentation compiles.
+ -->
+ <target name="compile"
+ depends="compile-classes"
description="Compile all source files."/>
<!-- Compile all class files -->
@@ -213,16 +217,28 @@
</javac>
</target>
+ <!-- Compile resource files -->
+ <target name="compile-resources" depends="init">
+ <mkdir dir="${build.resources}"/>
+ <copy todir="${build.resources}" filtering="yes">
+ <fileset dir="${source.resources}">
+ <include name="**/*"/>
+ </fileset>
+ </copy>
+ </target>
+
<!-- ================================================================== -->
<!-- Build Jars -->
<!-- ================================================================== -->
- <!-- Build all jar files -->
+ <!--
+ | Build all jar files.
+ -->
<target name="jars" depends="compile" description="Builds all jar files.">
<mkdir dir="${build.jars}"/>
- <!-- Build the jboss-j2ee.jar -->
+ <!-- Build the j2ee jar -->
<jar jarfile="${build.jars}/jboss-j2ee.jar">
<fileset dir="${build.classes}">
<include name="**"/>
@@ -231,7 +247,7 @@
</fileset>
</jar>
- <!-- Build the jboss-jdbc_ext.jar -->
+ <!-- Build the jdbc ext jar -->
<jar jarfile="${build.jars}/jboss-jdbc_ext.jar">
<fileset dir="${build.classes}">
<!-- only include jdbc classes -->
@@ -245,11 +261,24 @@
<!-- Build documents -->
<!-- ================================================================== -->
- <!-- Create all generated documenation -->
- <target name="docs" depends="javadocs"
+ <!--
+ | Create all generated documenation.
+ |
+ | This target should depend on other docs-* targets for each
+ | different type of docuementation that is to be generated.
+ -->
+ <target name="docs" depends="docs-api"
description="Builds all documentation."/>
+
+ <!-- Javadocs is an exception, but provide a docs-api to conform. -->
+ <target name="docs-api" depends="javadocs"/>
- <!-- Check if we need to build javadocs -->
+ <!--
+ | Check if we need to build javadocs
+ |
+ | Javadocs will only be generated if one or more .java source files
+ | is newer than the generated index.html.
+ -->
<target name="javadocs-check" depends="init">
<!-- if index.html is newer than the sources we are up to date -->
<uptodate property="javadoc-generated-already"
@@ -262,7 +291,9 @@
</target>
<!-- Generate Javadoc if we are out of date -->
- <target name="javadocs" depends="javadocs-check"
unless="javadoc-generated-already">
+ <target name="javadocs"
+ depends="javadocs-check"
+ unless="javadoc-generated-already">
<javadoc packagenames="${javadoc.packages}"
sourcepath="${source.java}"
destdir="${build.api}"
@@ -276,42 +307,59 @@
package="${javadoc.package}"
protected="${javadoc.protected}"
private="${javadoc.private}"
+ encoding="${javadoc.encoding}"
use="${javadoc.use}"
verbose="${javadoc.verbose}">
- <!-- <group title="Common" packages="*"/> -->
+ <group title="JDBC Extension" packages="javax.sql*"/>
+ <group title="J2EE" packages="javax*"/>
</javadoc>
</target>
<!-- ================================================================== -->
- <!-- Builds a release distribution. -->
+ <!-- Release/Install file copying. -->
<!-- ================================================================== -->
- <target name="release-files" depends="all">
- <mkdir dir="${module.release}"/>
-
- <!-- Release the generated jars -->
- <mkdir dir="${release.lib}"/>
- <copy todir="${release.lib}" filtering="no">
- <fileset dir="${build.jars}">
+ <!--
+ | This target is a helper for release and install to consolidate the
+ | task logic required to copy files.
+ -->
+ <target name="copy-files">
+ <!-- Copy the generated libraries -->
+ <mkdir dir="${to.lib}"/>
+ <copy todir="${to.lib}" filtering="no">
+ <fileset dir="${from.lib}">
<include name="**/*"/>
</fileset>
</copy>
- <!-- Release the generated javadocs -->
- <mkdir dir="${release.api}"/>
- <copy todir="${release.api}" filtering="no">
- <fileset dir="${build.api}">
+ <!-- Copy the generated javadocs -->
+ <mkdir dir="${to.api}"/>
+ <copy todir="${to.api}" filtering="no">
+ <fileset dir="${from.api}">
<include name="**/*"/>
</fileset>
</copy>
</target>
- <target name="release" depends="release-files"
- description="Builds a release distribution.">
- <mkdir dir="${module.release}"/>
+
+ <!-- ================================================================== -->
+ <!-- Builds a release distribution. -->
+ <!-- ================================================================== -->
+
+ <target name="release"
+ depends="all"
+ description="Builds a release distribution.">
+ <!-- Copy the files to release -->
+ <antcall target="copy-files">
+ <param name="to.lib" value="${release.lib}"/>
+ <param name="from.lib" value="${build.jars}"/>
+ <param name="to.api" value="${release.api}"/>
+ <param name="from.api" value="${build.api}"/>
+ </antcall>
<!-- Build a jar for the release -->
+ <mkdir dir="${module.release}"/>
<mkdir dir="${module.output}"/>
<jar jarfile="${module.output}/${module.name}-${build.id}.jar">
<fileset dir="${module.release}">
@@ -322,7 +370,7 @@
<!-- ================================================================== -->
- <!-- Install release into project namespace. -->
+ <!-- Install release files into project output. -->
<!-- ================================================================== -->
<target name="install-check" depends="init">
@@ -330,24 +378,15 @@
<require property="install.module.api"/>
</target>
- <target name="install" depends="install-check,release-files"
+ <target name="install" depends="install-check, release"
description="Installs released files into project namespace.">
-
- <!-- Install the generated jars -->
- <mkdir dir="${install.lib}"/>
- <copy todir="${install.lib}" filtering="no">
- <fileset dir="${release.lib}">
- <include name="**/*"/>
- </fileset>
- </copy>
-
- <!-- Install the generated javadocs -->
- <mkdir dir="${install.module.api}"/>
- <copy todir="${install.module.api}" filtering="no">
- <fileset dir="${release.api}">
- <include name="**/*"/>
- </fileset>
- </copy>
+ <!-- Copy the files to project -->
+ <antcall target="copy-files">
+ <param name="to.lib" value="${install.lib}"/>
+ <param name="from.lib" value="${release.lib}"/>
+ <param name="to.api" value="${install.module.api}"/>
+ <param name="from.api" value="${release.api}"/>
+ </antcall>
</target>
@@ -374,12 +413,29 @@
<!-- ================================================================== -->
<!-- Other Targets -->
<!-- ================================================================== -->
+
+ <target name="help">
+ <projecthelp>
+ <header/>
+ <header> The JBoss J2EE source module.</header>
+ <header/>
+ <footer/>
+ <footer> * -projecthelp for all targets</footer>
+ <footer> * -help for full options</footer>
+ </projecthelp>
+ </target>
- <target name="main" depends="jars"
- description="Executes the default target (jars)."/>
+ <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="min" depends="compile"
+ description="Builds a minimal subset."/>
<target name="tests" depends="init"
description="Execute all tests."/>
1.1.2.3 +16 -24 jboss-j2ee/Attic/config.xml
Index: config.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-j2ee/Attic/config.xml,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- config.xml 2001/07/28 00:48:00 1.1.2.2
+++ config.xml 2001/07/29 00:52:30 1.1.2.3
@@ -14,7 +14,7 @@
<!-- -->
<!-- ====================================================================== -->
-<!-- $Id: config.xml,v 1.1.2.2 2001/07/28 00:48:00 user57 Exp $ -->
+<!-- $Id: config.xml,v 1.1.2.3 2001/07/29 00:52:30 user57 Exp $ -->
<!-- ================================================================== -->
<!-- Module Setup -->
@@ -33,14 +33,7 @@
<!-- Tool Setup -->
<!-- ================================================================== -->
- <!-- BuildMagic -->
- <property name="buildmagic.root" value="${tools.root}/planet57/buildmagic"/>
- <property name="buildmagic.lib" value="${buildmagic.root}/lib"/>
- <path id="buildmagic.classpath">
- <fileset dir="${buildmagic.lib}">
- <include name="**/*.jar"/>
- </fileset>
- </path>
+ <!-- No tool dependencies -->
<!-- ================================================================== -->
@@ -48,15 +41,15 @@
<!-- ================================================================== -->
<!-- Java Authentication and Authorization Service (JAAS) -->
- <property name="jaas.root" value="${thirdparty.root}/sun/jaas"/>
- <property name="jaas.lib" value="${jaas.root}/lib"/>
- <path id="jaas.classpath">
- <pathelement path="${jaas.lib}/jaas.jar"/>
+ <property name="sun.jaas.root" value="${thirdparty.root}/sun/jaas"/>
+ <property name="sun.jaas.lib" value="${sun.jaas.root}/lib"/>
+ <path id="sun.jaas.classpath">
+ <pathelement path="${sun.jaas.lib}/jaas.jar"/>
</path>
<!-- The combined library classpath -->
- <path id="classpath.library">
- <path refid="jaas.classpath"/>
+ <path id="library.classpath">
+ <path refid="sun.jaas.classpath"/>
</path>
@@ -72,7 +65,7 @@
-->
<!-- The combined depedant module classpath -->
- <path id="classpath.dependentmodules">
+ <path id="dependentmodule.classpath">
</path>
@@ -81,20 +74,20 @@
<!-- ================================================================== -->
<!-- The combined thirdparty classpath -->
- <path id="classpath.thirdparty">
- <path refid="classpath.library"/>
- <path refid="classpath.dependentmodules"/>
+ <path id="thirdparty.classpath">
+ <path refid="library.classpath"/>
+ <path refid="dependentmodule.classpath"/>
</path>
- <!-- ${classpath} and ${classpath.local} must have a value -->
+ <!-- classpath and local.classpath must have a value using with a path -->
<property name="classpath" value=""/>
- <property name="classpath.local" value=""/>
+ <property name="local.classpath" value=""/>
<!-- The classpath required to build classes. -->
<path id="javac.classpath">
<pathelement path="${classpath}"/>
- <pathelement path="${classpath.local}"/>
- <path refid="classpath.thirdparty"/>
+ <pathelement path="${local.classpath}"/>
+ <path refid="thirdparty.classpath"/>
</path>
<!-- Packages to include when generating api documentation -->
@@ -113,7 +106,6 @@
<property name="build.classes" value="${module.build}/classes"/>
<property name="build.jars" value="${module.build}/lib"/>
<property name="build.api" value="${module.build}/api"/>
- <property name="build.resources" value="${module.build}/resources"/>
<!-- Where release generated files will go -->
<property name="release.lib" value="${module.release}/lib"/>
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development