notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r1632 - in trunk: central/site/src/docs/depot/tutorials main/depot/tools/builder/src/main/net/dpml/tools/tasks main/metro/model main/metro/runtime main/metro/state main/metro/test tutorials/tooling/complex/build tutorials/tooling/complex/build/api tutorials/tooling/complex/build/impl
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r1632 - in trunk: central/site/src/docs/depot/tutorials main/depot/tools/builder/src/main/net/dpml/tools/tasks main/metro/model main/metro/runtime main/metro/state main/metro/test tutorials/tooling/complex/build tutorials/tooling/complex/build/api tutorials/tooling/complex/build/impl
- Date: Sat, 22 Jul 2006 16:17:20 +0200
Author: mcconnell
Date: 2006-07-22 16:17:19 +0200 (Sat, 22 Jul 2006)
New Revision: 1632
Added:
trunk/main/metro/model/test.properties
trunk/main/metro/runtime/test.properties
trunk/main/metro/state/test.properties
trunk/main/metro/test/test.properties
Modified:
trunk/central/site/src/docs/depot/tutorials/complex.xml
trunk/central/site/src/docs/depot/tutorials/export.xml
trunk/central/site/src/docs/depot/tutorials/modules.xml
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/JUnitTestTask.java
trunk/tutorials/tooling/complex/build/api/
trunk/tutorials/tooling/complex/build/impl/
trunk/tutorials/tooling/complex/build/index.xml
Log:
more tutorial content
Modified: trunk/central/site/src/docs/depot/tutorials/complex.xml
===================================================================
--- trunk/central/site/src/docs/depot/tutorials/complex.xml 2006-07-22
08:58:01 UTC (rev 1631)
+++ trunk/central/site/src/docs/depot/tutorials/complex.xml 2006-07-22
14:17:19 UTC (rev 1632)
@@ -11,11 +11,14 @@
<section name="Multi-Project Build Sequencing">
<p>
- An important aspect of Depot is the support for transitive
- dependency management. Dependencies between project are maintained
- relative to the following scopes:
+ An important feature of Depot is the support for transitive
+ dependency management.
</p>
+ <p>
+ Dependencies between project are maintained relative to the following
scopes:
+ </p>
+
<table>
<tr>
<td>build</td>
@@ -42,11 +45,11 @@
<tr>
<td>test</td>
<td>
- Declaration of one or test dependencies. Test scoped dependencies
+ Declaration of one or more test dependencies. Test scoped
dependencies
are used to suppliment transitive runtime dependencies and are
typically
- applied to the automation of test-cases. An import aspect of
- of test scope dependencies is the abiluity to separate test
concerns from
- runtime concerns - ensuring that runtime meta-data is not
poluted with
+ applied to test-case automation . An important aspect of of
test scoped
+ dependencies is the ability to separate test concerns from
runtime
+ concerns - ensuring that runtime meta-data is not polluted with
test related information.
</td>
</tr>
@@ -55,25 +58,39 @@
<subsection name="index.xml">
<p>
- Our index file has been updated to declare two projects named widget
and gizmo
- and we have relocated our index file to a directory above the
respective
- project basedirs. The <tt>gizmo</tt> project is declaring a
build-time dependency
- on the <tt>widget</tt> project which simply ensures that
<tt>widget</tt> will be
- built before <tt>gizmo</tt>. Basedir values for both projects are
declared as
- immidiate subdirectories relative to the location of the index.xml
file.
+ Our index file has been updated to declare two projects :
<tt>clock-api</tt> and
+ <tt>clock-impl</tt>. The API project declares an interface and the
impl project
+ is an implementation of that API. As such, the impl project has a
runtime
+ dependency on the API (and the test-time dependencies on ant-junit).
</p>
<pre>
<?xml version="1.0" encoding="ISO-8859-1"?>
<index xmlns="link:xsd:dpml/lang/dpml-module#1.0">
- <font color="darkred"><project name="widget" basedir="widget"/>
+ <font color="darkred"><imports>
+ <import uri="link:module:ant"/>
+ <import uri="link:module:dpml"/>
+ </imports>
+
+ <project name="clock-api" basedir="api">
+ <types>
+ <type id="jar"/>
+ </types>
+ </project>
- <project name="gizmo" basedir="gizmo">
- <dependencies>
- <build>
- <include key="widget"/>
- </build>
+ <project name="clock-impl" basedir="impl">
+ <types>
+ <type id="jar"/>
+ </types>
+ <dependencies>
+ <runtime>
+ <include key="clock-api"/>
+ </runtime>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
</dependencies>
</project></font>
@@ -82,120 +99,145 @@
</subsection>
- <subsection name="Listing project sequence">
+ <subsection name="Listing project dependencies">
<p>
- Before building our projects we will take a moment to look at the
build
- tools <tt>-list</tt> option.
+ If we set our current directory to the parent directoriy of the two
projects and
+ invoke the <tt>build-list</tt> (or <tt>build -l</tt> for short), we
get a listing of
+ all of the projects in scope:
</p>
-
- <pre>$ cd central\tutorials\tooling\complex\build</pre>
-
- <p>
- The following command list all project below our current directory
- in proper build sequence:
- </p>
-
- <pre>
+
+<pre>
$ build -list
Selection: [2]
[1] project:widget#SNAPSHOT
[2] project:gizmo#SNAPSHOT
</pre>
-
- </subsection>
-
- <subsection name="Listing project details">
-
<p>
- We can also list information about a specific project as shown in
the following
- example where we are requesting a detailing listing of the gizmo
project.
+ Using the <tt>-e</tt> (expand) and <tt>-s</tt> (select) option we
can view the
+ full dependency scenario:
</p>
<pre>
-$ build -list -select gizmo
-Listing project: gizmo
+$ build -list -expand -select clock-impl
+Listing project: clock-impl
-project:gizmo#SNAPSHOT
+project:clock-impl#SNAPSHOT
version: SNAPSHOT
- basedir: D:\dpml\tutorials\tooling\complex\build\gizmo
- build phase providers: (1)
- project:widget#SNAPSHOT</pre>
-
- <p>
- Just for reference - the above command can be simplified to:
- </p>
+ basedir: D:\dpml\tutorials\tooling\complex\build\impl
+ types: (1)
+ jar
+ runtime providers: (1)
+ project:clock-api#SNAPSHOT
+ test providers: (7)
+ resource:ant/ant-launcher#1.6.5
+ resource:ant/ant-trax#1.6.5
+ resource:ant/ant-xslp#1.6.5
+ resource:ant/ant#1.6.5
+ resource:junit/junit#3.8.1
+ resource:ant/ant-junit#1.6.5
+ resource:dpml/transit/dpml-transit-main#SNAPSHOT</pre>
-<pre>$ build -l -s gizmo</pre>
-
</subsection>
- <subsection name="Addition build options">
-
- <p>For additional information on the build tool command options
- the <tt>-help</tt> option is always available.
- </p>
-
-<pre>$ build -help</pre>
-
- </subsection>
-
<subsection name="Building the projects ..">
<p>
- In the following example the <tt>build</tt> command is invoked
- in the parent directory to the widget and gizmo projects. As such
- the build tool will evaluate all projects declared in the index and
- establish a build selection that includes all projects with a basedir
- that is equal to or deeper that our current directory. This selction
- is then sorted in terms of build-time dependencies resulting in
widget
- appearing before gizmo. The build tool then initiates the build of
- each project. If there is a failure of an indivial build then the
+ In the following build example the <tt>build</tt> command is invoked
+ in the parent directory. As such the build tool will evaluate all
+ projects declared in the index and establish a build selection that
+ includes all projects with a basedir that is equal to or deeper that
+ our current directory. This selection is subsequently sorted
+ resulting in the api project appearing before the implementation
+ project. The build tool then initiates the build of each project
+ sequentally. If there is a failure of an indivial build then the
multi-project build sequence will fail.
</p>
- <pre>
-$ build
-[2788 ] [INFO ] (depot.build): Initiating build sequence: (2)
+<pre>$ build
+[2036 ] [INFO ] (depot.build): Initiating build sequence: (2)
- (1) widget
- (2) gizmo
+ (1) clock-api
+ (2) clock-impl
-------------------------------------------------------------------------
-widget#SNAPSHOT
+clock-api#SNAPSHOT
-------------------------------------------------------------------------
+init:
+
+prepare:
+[x:prepare] Created dir: D:\dpml\tutorials\tooling\complex\build\api\target
+[x:prepare] Created dir:
D:\dpml\tutorials\tooling\complex\build\api\target\build\main
+[x:prepare] Copying 1 file to
D:\dpml\tutorials\tooling\complex\build\api\target\build\main
+
build:
- [echo] Executing WIDGET build
+ [javac] Created dir:
D:\dpml\tutorials\tooling\complex\build\api\target\classes\main
+ [javac] Compiling 1 source file to
D:\dpml\tutorials\tooling\complex\build\api\target\classes\main
+package:
+ [jar] Created dir:
D:\dpml\tutorials\tooling\complex\build\api\target\deliverables\jars
+ [jar] Building jar:
D:\dpml\tutorials\tooling\complex\build\api\target\deliverables\jars\clock-api-SNAPSHOT.jar
+ [jar] Creating md5 checksum
+
+test:
+
+install:
+[x:install] Copying 2 files to D:\system\dpml\data\cache
+
BUILD SUCCESSFUL
-Total time: 0 seconds
+Total time: 3 seconds
-------------------------------------------------------------------------
-gizmo#SNAPSHOT
+clock-impl#SNAPSHOT
-------------------------------------------------------------------------
+init:
+
+prepare:
+[x:prepare] Created dir: D:\dpml\tutorials\tooling\complex\build\impl\target
+[x:prepare] Created dir:
D:\dpml\tutorials\tooling\complex\build\impl\target\build\main
+[x:prepare] Copying 1 file to
D:\dpml\tutorials\tooling\complex\build\impl\target\build\main
+[x:prepare] Created dir:
D:\dpml\tutorials\tooling\complex\build\impl\target\build\test
+[x:prepare] Copying 1 file to
D:\dpml\tutorials\tooling\complex\build\impl\target\build\test
+[x:prepare] Created dir:
D:\dpml\tutorials\tooling\complex\build\impl\target\test
+
build:
- [echo] Executing GIZMO build
+ [javac] Created dir:
D:\dpml\tutorials\tooling\complex\build\impl\target\classes\main
+ [javac] Compiling 1 source file to
D:\dpml\tutorials\tooling\complex\build\impl\target\classes\main
+ [javac] Created dir:
D:\dpml\tutorials\tooling\complex\build\impl\target\classes\test
+ [javac] Compiling 1 source file to
D:\dpml\tutorials\tooling\complex\build\impl\target\classes\test
+package:
+ [jar] Created dir:
D:\dpml\tutorials\tooling\complex\build\impl\target\deliverables\jars
+ [jar] Building jar:
D:\dpml\tutorials\tooling\complex\build\impl\target\deliverables\jars\clock-impl-SNAPSHOT.jar
+ [jar] Creating md5 checksum
+
+test:
+ [junit] Created dir:
D:\dpml\tutorials\tooling\complex\build\impl\target\reports\test
+ [junit] Executing forked test.
+ [junit] Running org.acme.impl.test.DemoTestCase
+ [junit] [13005] [INFO ] (test): 11:28 PM, CST
+ [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.218 sec
+
+install:
+[x:install] Copying 2 files to D:\system\dpml\data\cache
+
BUILD SUCCESSFUL
-Total time: 0 seconds
- </pre>
+Total time: 2 seconds</pre>
</subsection>
<subsection name="Summary">
<p>
- This tutorial has introduced the subject of build-scoped dependencies
- and how these dependencyt declarations impact build sequencing. In
practice
- you will not generally need build-time dependency declarations -
instead it
- is much more common to see runtime dependencies linking projects
together, and
- its within runtime depedencies that we can do things like automatic
classloader
- chain construction.
+ This tutorial has introduced the subject of scoped dependencies
+ and how these dependency declarations impact build sequencing and
classpath
+ construction. In addition the tutorial has demonstrated
multi-project build
+ sequencing (covering information listing and build execution).
</p>
<p>
Modified: trunk/central/site/src/docs/depot/tutorials/export.xml
===================================================================
--- trunk/central/site/src/docs/depot/tutorials/export.xml 2006-07-22
08:58:01 UTC (rev 1631)
+++ trunk/central/site/src/docs/depot/tutorials/export.xml 2006-07-22
14:17:19 UTC (rev 1632)
@@ -30,26 +30,42 @@
<pre>
<?xml version="1.0" encoding="ISO-8859-1"?>
-<index xmlns="link:xsd:dpml/lang/dpml-module#1.0">
-
+<index xmlns="link:xsd:dpml/lang/dpml-module#1.0">
+
+ <imports>
+ <import uri="link:module:ant"/>
+ <import uri="link:module:dpml"/>
+ </imports>
+
<module name="org/acme" basedir=".">
<font color="darkred"><types>
<type id="module" version="1.0">
</types></font>
- <project name="widget" basedir="widget"/>
+ <project name="clock-api" basedir="api">
+ <types>
+ <type id="jar"/>
+ </types>
+ </project>
- <project name="gizmo" basedir="gizmo">
- <dependencies>
- <build>
- <include key="widget"/>
- </build>
+ <project name="clock-impl" basedir="impl">
+ <types>
+ <type id="jar"/>
+ </types>
+ <dependencies>
+ <runtime>
+ <include key="clock-api"/>
+ </runtime>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
</dependencies>
</project>
-
- <font color="darkred"></module></font>
+ </module>
+
</index>
</pre>
@@ -67,37 +83,8 @@
<source><![CDATA[
<?xml version="1.0" encoding="ISO-8859-1"?>
-<module name="org"
- xmlns="link:xsd:dpml/lang/dpml-module#1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
- <module name="acme" version="SNAPSHOT">
-
- <types>
- <type id="module" version="1.0"/>
- </types>
-
- <resource name="widget" version="SNAPSHOT">
- </resource>
-
- <resource name="gizmo" version="SNAPSHOT">
- </resource>
-
- </module>
-
-</module>
]]></source>
- <p>
- Something imprant to note is that the above listing includes our two
- projects <tt>widget</tt> and <tt>gizmo</tt> together with the
enclosing
- module. In effect a module that declares a basedir is considered as
a
- buildable project. Sometime it is convinient to handle application
level
- packaging and installer creation concerns at the level of a module
build,
- but more interesting is the potential for exporting a module
definition
- for use by third-parties.
- </p>
-
</subsection>
</section>
Modified: trunk/central/site/src/docs/depot/tutorials/modules.xml
===================================================================
--- trunk/central/site/src/docs/depot/tutorials/modules.xml 2006-07-22
08:58:01 UTC (rev 1631)
+++ trunk/central/site/src/docs/depot/tutorials/modules.xml 2006-07-22
14:17:19 UTC (rev 1632)
@@ -36,22 +36,38 @@
<pre>
<?xml version="1.0" encoding="ISO-8859-1"?>
-<index xmlns="link:xsd:dpml/lang/dpml-module#1.0">
-
+<index xmlns="link:xsd:dpml/lang/dpml-module#1.0">
+
+ <imports>
+ <import uri="link:module:ant"/>
+ <import uri="link:module:dpml"/>
+ </imports>
+
<font color="darkred"><module name="org/acme" basedir="."></font>
- <project name="widget" basedir="widget"/>
+ <project name="clock-api" basedir="api">
+ <types>
+ <type id="jar"/>
+ </types>
+ </project>
- <project name="gizmo" basedir="gizmo">
- <dependencies>
- <build>
- <include key="widget"/>
- </build>
+ <project name="clock-impl" basedir="impl">
+ <types>
+ <type id="jar"/>
+ </types>
+ <dependencies>
+ <runtime>
+ <include key="clock-api"/>
+ </runtime>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
</dependencies>
</project>
-
+
<font color="darkred"></module></font>
-
+
</index>
</pre>
@@ -72,21 +88,27 @@
Selection: [3]
- <font color="blue">[1] project:org/acme/widget#SNAPSHOT
- [2] project:org/acme/gizmo#SNAPSHOT
+ <font color="blue">[1] project:org/acme/clock-api#SNAPSHOT
+ [2] project:org/acme/clock-impl#SNAPSHOT
[3] module:org/acme/#SNAPSHOT</font>
$</pre>
<p>
- Something imprant to note is that the above listing includes our two
- projects <tt>widget</tt> and <tt>gizmo</tt> together with the
enclosing
+ Something important to note is that the above listing includes our
two
+ projects <tt>clock-api</tt> and <tt>clock-impl</tt> together with
the enclosing
module. In effect a module that declares a basedir is considered as
a
- buildable project. Sometime it is convinient to handle application
level
+ buildable project. Sometimes it is convinient to handle application
level
packaging and installer creation concerns at the level of a module
build,
but more interesting is the potential for exporting a module
definition
for use by third-parties.
</p>
+
+ <p>
+ Our <a href="export.html">next tutorial</a> presents an example of
the creation
+ of a module artifact suitable for use by third-party projects that
want to reference
+ our content.
+ </p>
</subsection>
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/JUnitTestTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/JUnitTestTask.java
2006-07-22 08:58:01 UTC (rev 1631)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/JUnitTestTask.java
2006-07-22 14:17:19 UTC (rev 1632)
@@ -20,6 +20,10 @@
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.FileInputStream;
+import java.util.Enumeration;
+import java.util.Properties;
import java.util.StringTokenizer;
import net.dpml.library.Type;
@@ -347,6 +351,33 @@
junit.addConfiguredSysproperty( security );
}
+ File base = project.getBaseDir();
+ final File properties = new File( base, "test.properties" );
+ if( properties.exists() )
+ {
+ Properties props = new Properties();
+ try
+ {
+ InputStream input = new FileInputStream( properties );
+ props.load( input );
+ Enumeration enum = props.propertyNames();
+ while( enum.hasMoreElements() )
+ {
+ String name = (String) enum.nextElement();
+ final Environment.Variable v = new
Environment.Variable();
+ v.setKey( name );
+ v.setValue( props.getProperty( name ) );
+ junit.addConfiguredSysproperty( v );
+ }
+ }
+ catch( IOException ioe )
+ {
+ final String error =
+ "Unexpected IO error while reading " +
properties.toString();
+ throw new BuildException( error, ioe, getLocation() );
+ }
+ }
+
final File logProperties = new File( working, "logging.properties" );
if( logProperties.exists() )
{
@@ -364,11 +395,6 @@
throw new BuildException( error, e );
}
junit.addConfiguredSysproperty( log );
-
- final Environment.Variable logging = new Environment.Variable();
- logging.setKey( "java.util.logging.config.class" );
- logging.setValue( "net.dpml.util.ConfigurationHandler" );
- junit.addConfiguredSysproperty( logging );
}
final Environment.Variable endorsed = new Environment.Variable();
Added: trunk/main/metro/model/test.properties
===================================================================
--- trunk/main/metro/model/test.properties 2006-07-22 08:58:01 UTC (rev
1631)
+++ trunk/main/metro/model/test.properties 2006-07-22 14:17:19 UTC (rev
1632)
@@ -0,0 +1 @@
+java.util.logging.config.class = net.dpml.util.ConfigurationHandler
\ No newline at end of file
Added: trunk/main/metro/runtime/test.properties
===================================================================
--- trunk/main/metro/runtime/test.properties 2006-07-22 08:58:01 UTC (rev
1631)
+++ trunk/main/metro/runtime/test.properties 2006-07-22 14:17:19 UTC (rev
1632)
@@ -0,0 +1 @@
+java.util.logging.config.class = net.dpml.util.ConfigurationHandler
\ No newline at end of file
Added: trunk/main/metro/state/test.properties
===================================================================
--- trunk/main/metro/state/test.properties 2006-07-22 08:58:01 UTC (rev
1631)
+++ trunk/main/metro/state/test.properties 2006-07-22 14:17:19 UTC (rev
1632)
@@ -0,0 +1 @@
+java.util.logging.config.class = net.dpml.util.ConfigurationHandler
\ No newline at end of file
Added: trunk/main/metro/test/test.properties
===================================================================
--- trunk/main/metro/test/test.properties 2006-07-22 08:58:01 UTC (rev
1631)
+++ trunk/main/metro/test/test.properties 2006-07-22 14:17:19 UTC (rev
1632)
@@ -0,0 +1 @@
+java.util.logging.config.class = net.dpml.util.ConfigurationHandler
\ No newline at end of file
Property changes on: trunk/tutorials/tooling/complex/build/api
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: trunk/tutorials/tooling/complex/build/impl
___________________________________________________________________
Name: svn:ignore
+ target
Modified: trunk/tutorials/tooling/complex/build/index.xml
===================================================================
--- trunk/tutorials/tooling/complex/build/index.xml 2006-07-22 08:58:01
UTC (rev 1631)
+++ trunk/tutorials/tooling/complex/build/index.xml 2006-07-22 14:17:19
UTC (rev 1632)
@@ -2,7 +2,6 @@
<index xmlns="link:xsd:dpml/lang/dpml-module#1.0">
<imports>
- <import uri="link:module:junit"/>
<import uri="link:module:ant"/>
<import uri="link:module:dpml"/>
</imports>
- r1632 - in trunk: central/site/src/docs/depot/tutorials main/depot/tools/builder/src/main/net/dpml/tools/tasks main/metro/model main/metro/runtime main/metro/state main/metro/test tutorials/tooling/complex/build tutorials/tooling/complex/build/api tutorials/tooling/complex/build/impl, mcconnell at BerliOS, 07/22/2006
Archive powered by MHonArc 2.6.24.