Skip to Content.
Sympa Menu

notify-dpml - r2037 - in trunk: . etc etc/debian main/depot/build/etc/bin main/depot/build/src/main/dpml/build main/depot/tools/src/main/dpml/tools/tasks main/metro/main main/metro/main/etc/bin main/metro/main/src/main/dpml/metro/console main/metro/part/etc main/metro/station/etc/bin main/metro/station/src/main/dpml/station/console main/transit/core main/transit/core/src/main/net/dpml/transit

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: davidoff at BerliOS <davidoff AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r2037 - in trunk: . etc etc/debian main/depot/build/etc/bin main/depot/build/src/main/dpml/build main/depot/tools/src/main/dpml/tools/tasks main/metro/main main/metro/main/etc/bin main/metro/main/src/main/dpml/metro/console main/metro/part/etc main/metro/station/etc/bin main/metro/station/src/main/dpml/station/console main/transit/core main/transit/core/src/main/net/dpml/transit
  • Date: Sun, 16 Sep 2007 17:17:38 +0200

Author: davidoff
Date: 2007-09-16 17:17:36 +0200 (Sun, 16 Sep 2007)
New Revision: 2037

Added:
trunk/etc/debian/
trunk/etc/debian/postinst
trunk/etc/debian/prerm
trunk/setup.sh
Removed:
trunk/main/metro/part/etc/bin/
Modified:
trunk/bootstrap
trunk/bootstrap.xml
trunk/build.xml
trunk/index.xml
trunk/main/depot/build/etc/bin/build
trunk/main/depot/build/src/main/dpml/build/Main.java
trunk/main/depot/tools/src/main/dpml/tools/tasks/JUnitTestTask.java
trunk/main/metro/main/build.xml
trunk/main/metro/main/etc/bin/metro
trunk/main/metro/main/src/main/dpml/metro/console/Main.java
trunk/main/metro/station/etc/bin/station
trunk/main/metro/station/src/main/dpml/station/console/Main.java
trunk/main/transit/core/bootstrap.xml
trunk/main/transit/core/build.xml
trunk/main/transit/core/src/main/net/dpml/transit/Artifact.java
trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
Log:
1. addition of a new protocol handler supporting readonly shared
configuration data
2. updating the Transit system to support/recognize the configuration:
protocol
3. updating bootstrap abd jdpml deliverable builds
4. addition of a debian installation
5. update to the definition of the DPML_SYSTEM location to /opt/dpml/share
6. enhanced exception handling in the depot builder

Modified: trunk/bootstrap
===================================================================
--- trunk/bootstrap 2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/bootstrap 2007-09-16 15:17:36 UTC (rev 2037)
@@ -61,7 +61,7 @@
dpmlExternal()
{
cd main/external
- build clean install
+ bash ../depot/build/target/bin/build clean install
cd ../..
}


Modified: trunk/bootstrap.xml
===================================================================
--- trunk/bootstrap.xml 2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/bootstrap.xml 2007-09-16 15:17:36 UTC (rev 2037)
@@ -58,7 +58,7 @@

<target name="setup" depends="dpml-setup,junit-setup"/>

- <target name="dpml-setup"
depends="dpml-home,dpml-data,dpml-prefs,dpml-system"/>
+ <target name="dpml-setup"
depends="dpml-home,dpml-data,dpml-prefs,dpml-system,dpml-config"/>

<target name="dpml-home-environment" if="dpml.home.declared">
<property name="dpml.home" location="${ENV.DPML_HOME}"/>
@@ -105,6 +105,11 @@
<property name="dpml.system" location="${dpml.home}/share"/>
<mkdir dir="${dpml.system}"/>
</target>
+
+ <target name="dpml-config" depends="dpml-system">
+ <property name="dpml.config" location="${dpml.system}/config"/>
+ <mkdir dir="${dpml.config}"/>
+ </target>

<target name="junit-download" depends="dpml-data"
unless="junit.cache.available">
<mkdir dir="${dpml.local.cache}/junit/jars"/>

Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/build.xml 2007-09-16 15:17:36 UTC (rev 2037)
@@ -33,16 +33,18 @@
<property name="prefs" location="${bundle}/prefs"/>
<property name="data" location="${bundle}/data"/>
<property name="share" location="${bundle}/share"/>
- <property name="share.docs" location="${share}/docs"/>
+ <property name="share.config" location="${share}/config"/>
+ <property name="share.docs" location="${share}/docs"/>
<property name="share.lib" location="${share}/lib"/>
<mkdir dir="${data}"/>
<mkdir dir="${prefs}"/>
<mkdir dir="${share.docs}"/>
+ <mkdir dir="${share.config}"/>
</target>

<target name="package" depends="standard.package,javadoc"/>

- <target name="install" depends="standard.install,zip,tar,nsis">
+ <target name="install" depends="standard.install,zip,tar,debian,nsis">
<copy todir="${dpml.data}">
<fileset dir="${share}">
<include name="docs/**"/>
@@ -76,8 +78,44 @@
</fileset>
</copy>
<echo>Created target/dist/dpml-sdk-win32-${project.version}.exe</echo>
- </target>
+ </target>

+ <target name="debian" depends="prepare">
+ <echo>Building Debian Installer</echo>
+ <x:get uri="artifact:jar:com/google/code/ant-deb/ant-deb-task#20070903"
property="debian.jar"/>
+ <path id="debian.path">
+ <pathelement location="${debian.jar}"/>
+ </path>
+ <taskdef resource="ant_deb_task.properties" classpathref="debian.path"/>
+ <!--<mkdir dir="${basedir}/target/debian"/>-->
+ <deb
+ todir="${basedir}/target/debian"
+ package="dpml-sdk"
+ section="devel"
+ depends="sun-java6-jdk"
+ postinst="${basedir}/target/debian/postinst"
+ prerm="${basedir}/target/debian/prerm">
+ <version upstream="${project.version}"/>
+ <maintainer name="davidoff" email="davidoff AT dpml.net"/>
+ <description synopsis="Digital Product Management Library
SDK">http://www.dpml.net</description>
+ <tarfileset dir="target/bundle"
prefix="opt/dpml-sdk-${project.version}" filemode="755">
+ <include name="share/bin/build"/>
+ <include name="share/bin/station"/>
+ <include name="share/bin/metro"/>
+ </tarfileset>
+ <tarfileset dir="target/bundle"
prefix="opt/dpml-sdk-${project.version}">
+ <include name="share/bin/build.policy"/>
+ <include name="share/bin/station.policy"/>
+ <include name="share/bin/metro.policy"/>
+ <include name="share/config/**"/>
+ <include name="share/local/**"/>
+ <include name="share/lib/**"/>
+ <include name="prefs/**"/>
+ <include name="data/**"/>
+ </tarfileset>
+ </deb>
+ </target>
+
<target name="zip" depends="bundle,replicate" description="Creates a
binary w32 distribution.">
<property name="filename" value="dpml-sdk-win32-${project.version}.zip"/>
<property name="ziploc" location="target/dist"/>
@@ -124,7 +162,7 @@
<checksum file="${dist}/${tarfilename}.gz" fileext=".md5"/>
</target>

- <target name="bundle" depends="standard.install,data,prefs,bin,lib"> <!--
removed docs -->
+ <target name="bundle" depends="standard.install,data,prefs,bin,lib,config">
<copy todir="${bundle}" filtering="true">
<fileset dir="${basedir}">
<include name="LICENSE.TXT"/>
@@ -148,6 +186,17 @@
<x:property name="transit.path" ref="dpml/transit/dpml-transit-main"
feature="path" type="jar"/>
<copy file="${transit.path}"
tofile="${share.lib}/ext/dpml-transit-main.jar"/>
</target>
+
+ <target name="config" depends="prepare">
+ <x:property name="transit.main.basedir"
ref="dpml/transit/dpml-transit-main" feature="basedir"/>
+ <property name="transit.config" location="${share.config}/dpml/transit"/>
+ <mkdir dir="${transit.config}"/>
+ <copy todir="${transit.config}" filtering="false">
+ <fileset dir="${transit.main.basedir}/target/config">
+ <include name="**/*"/>
+ </fileset>
+ </copy>
+ </target>

<target name="prefs" depends="prepare">
<x:property name="transit.main.basedir"
ref="dpml/transit/dpml-transit-main" feature="basedir"/>
@@ -183,16 +232,17 @@
<target name="bin" depends="prepare">
<x:property name="build.basedir" ref="dpml/depot/dpml-depot-build"
feature="basedir"/>
<x:property name="metro.basedir" ref="dpml/metro/dpml-metro-main"
feature="basedir"/>
- <x:property name="part.basedir" ref="dpml/metro/dpml-metro-part"
feature="basedir"/>
<x:property name="station.basedir" ref="dpml/metro/dpml-metro-station"
feature="basedir"/>
<property name="share.bin" location="${share}/bin"/>
<mkdir dir="${share.bin}"/>
<copy todir="${share.bin}" filtering="false">
- <fileset dir="${part.basedir}/target/bin"/>
<fileset dir="${build.basedir}/etc/bin"/>
<fileset dir="${metro.basedir}/etc/bin"/>
<fileset dir="${station.basedir}/etc/bin"/>
</copy>
+ <chmod file="${share.bin}/build" perm="ugo+rx"/>
+ <chmod file="${share.bin}/metro" perm="ugo+rx"/>
+ <chmod file="${share.bin}/station" perm="ugo+rx"/>
</target>

<target name="checkstyle" depends="prepare">

Added: trunk/etc/debian/postinst
===================================================================
--- trunk/etc/debian/postinst 2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/etc/debian/postinst 2007-09-16 15:17:36 UTC (rev 2037)
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Copyright 2007 Stephen J. McConnell
+
+sudo ln -s /opt/dpml-sdk-@BUILD-VERSION@ /opt/dpml
+sudo ln -s /opt/dpml/share/bin/build /usr/bin/build
+sudo ln -s /opt/dpml/share/bin/metro /usr/bin/metro
+sudo ln -s /opt/dpml/share/bin/station /usr/bin/station
+sudo ln -s /opt/dpml/share/config/dpml/transit /etc/transit
+
+


Property changes on: trunk/etc/debian/postinst
___________________________________________________________________
Name: svn:executable
+ *

Added: trunk/etc/debian/prerm
===================================================================
--- trunk/etc/debian/prerm 2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/etc/debian/prerm 2007-09-16 15:17:36 UTC (rev 2037)
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Copyright 2007 Stephen J. McConnell
+
+sudo rm -f /usr/bin/station
+sudo rm -f /usr/bin/metro
+sudo rm -f /usr/bin/build
+
+sudo rm -f /opt/dpml
+sudo rm -f /etc/transit
+


Property changes on: trunk/etc/debian/prerm
___________________________________________________________________
Name: svn:executable
+ *

Modified: trunk/index.xml
===================================================================
--- trunk/index.xml 2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/index.xml 2007-09-16 15:17:36 UTC (rev 2037)
@@ -20,7 +20,7 @@
<property name="project.svn.host"
value="svn://svn.berlios.de/dpml/trunk/main"/>
<property name="project.major.version" value="2"/>
<property name="project.minor.version" value="1"/>
- <property name="project.micro.version" value="0"/>
+ <property name="project.micro.version" value="1"/>
<property name="project.javadoc.linksource" value="false"/>
</properties>


Modified: trunk/main/depot/build/etc/bin/build
===================================================================
--- trunk/main/depot/build/etc/bin/build 2007-09-16 03:28:31 UTC (rev
2036)
+++ trunk/main/depot/build/etc/bin/build 2007-09-16 15:17:36 UTC (rev
2037)
@@ -7,7 +7,7 @@
fi

if [ "$DPML_SYSTEM" = "" ]; then
- export DPML_SYSTEM="$DPML_HOME/share"
+ export $DPML_SYSTEM="/opt/dpml/share"
fi

if [ "$BUILD_SECURITY_POLICY" = "" ] ; then

Modified: trunk/main/depot/build/src/main/dpml/build/Main.java
===================================================================
--- trunk/main/depot/build/src/main/dpml/build/Main.java 2007-09-16
03:28:31 UTC (rev 2036)
+++ trunk/main/depot/build/src/main/dpml/build/Main.java 2007-09-16
15:17:36 UTC (rev 2037)
@@ -40,7 +40,8 @@

import dpml.library.impl.DefaultLibrary;

-import java.io.File;
+import java.io.File;
+import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
@@ -140,6 +141,13 @@
{
m_library = new DefaultLibrary( m_logger );
}
+ catch( FileNotFoundException e )
+ {
+ final String error =
+ "Index not found.";
+ m_logger.error( error );
+ return -1;
+ }
catch( Throwable e )
{
final String error =
@@ -178,12 +186,18 @@

CommandLine line = getCommandLine( args );
m_verbose = line.hasOption( VERBOSE_OPTION );
+
+ if( line.hasOption( VERSION_OPTION ) )
+ {
+ printVersionMessage();
+ return 0;
+ }

// setup the build version

- if( line.hasOption( VERSION_OPTION ) )
+ if( line.hasOption( SIGNATURE_OPTION ) )
{
- String version = (String) line.getValue( VERSION_OPTION,
"SNAPSHOT" );
+ String version = (String) line.getValue( SIGNATURE_OPTION,
"SNAPSHOT" );
System.setProperty( "build.signature", version );
if( m_verbose )
{
@@ -242,6 +256,20 @@
return -1;
}
}
+
+ private void printVersionMessage()
+ {
+ StringBuffer buffer = new StringBuffer( "version" );
+ buffer.append( "\n" );
+ buffer.append( "\n DPML Depot" );
+ buffer.append( "\n Version @PROJECT-VERSION@" );
+ buffer.append( "\n Codebase " +
getClass().getProtectionDomain().getCodeSource().getLocation() );
+ buffer.append( "\n Copyright 2005-2007 Stephen J. McConnell" );
+ buffer.append( "\n Digital Product Management Library" );
+ buffer.append( "\n" );
+ String message = buffer.toString();
+ m_logger.info( message );
+ }

private CommandLine getCommandLine( String[] args ) throws Exception
{
@@ -605,6 +633,13 @@
.withRequired( false )
.create();

+ private static final Option VERSION_OPTION =
+ OPTION_BUILDER
+ .withShortName( "version" )
+ .withDescription( "List version information and exit." )
+ .withRequired( false )
+ .create();
+
private static final Option SELECT_OPTION =
OPTION_BUILDER
.withShortName( "select" )
@@ -666,15 +701,16 @@
.withRequired( false )
.create();

- private static final Option VERSION_OPTION =
+ private static final Option SIGNATURE_OPTION =
OPTION_BUILDER
- .withShortName( "version" )
- .withDescription( "Build version." )
+ .withShortName( "signature" )
+ .withShortName( "sig" )
+ .withDescription( "Build version signature." )
.withRequired( false )
.withArgument(
ARGUMENT_BUILDER
- .withDescription( "Created artifact version." )
- .withName( "version" )
+ .withDescription( "Created artifact version signature." )
+ .withName( "signature" )
.withMinimum( 1 )
.withMaximum( 1 )
.create() )
@@ -690,7 +726,7 @@
private static final Option BUILDER_URI_OPTION =
OPTION_BUILDER
.withShortName( "plugin" )
- .withDescription( "Default builder plugin uri." )
+ .withDescription( "Builder plugin uri." )
.withRequired( false )
.withArgument(
ARGUMENT_BUILDER
@@ -722,7 +758,7 @@
.withOption( CONSUMERS_OPTION )
.withOption( VERBOSE_OPTION )
.withOption( BUILDER_URI_OPTION )
- .withOption( VERSION_OPTION )
+ .withOption( SIGNATURE_OPTION )
.withOption( DECIMAL_OPTION )
.withOption( VALIDATE_OPTION )
.withOption( PROPERTY_OPTION )
@@ -732,6 +768,7 @@
GROUP_BUILDER
.withName( "options" )
.withOption( HELP_OPTION )
+ .withOption( VERSION_OPTION )
.withOption( LIST_GROUP )
.withOption( BUILD_GROUP )
.withOption( TARGETS )

Modified: trunk/main/depot/tools/src/main/dpml/tools/tasks/JUnitTestTask.java
===================================================================
--- trunk/main/depot/tools/src/main/dpml/tools/tasks/JUnitTestTask.java
2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/main/depot/tools/src/main/dpml/tools/tasks/JUnitTestTask.java
2007-09-16 15:17:36 UTC (rev 2037)
@@ -408,7 +408,7 @@
{
final File logProperties = new File( working, "logging.properties" );
if( logProperties.exists() )
- {
+ {
final Environment.Variable log = new Environment.Variable();
log.setKey( "dpml.logging.config" );
try

Modified: trunk/main/metro/main/build.xml
===================================================================
--- trunk/main/metro/main/build.xml 2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/main/metro/main/build.xml 2007-09-16 15:17:36 UTC (rev 2037)
@@ -4,6 +4,10 @@
xmlns:x="antlib:dpml.tools">

<x:import uri="local:template:dpml/tools/standard"/>
+
+ <condition property="isWindows" value="true">
+ <os family="windows"/>
+ </condition>

<available property="metro.exe.available"
file="${dpml.system}/bin/metro.exe"/>

@@ -30,7 +34,7 @@
</chmod>
</target>

- <target name="bin" depends="standard.install" unless="metro.exe.available">
+ <target name="bin" depends="standard.install" if="isWindows"
unless="metro.exe.available">
<mkdir dir="${dpml.system}/bin"/>
<copy todir="${dpml.system}" preservelastmodified="true">
<fileset dir="target">

Modified: trunk/main/metro/main/etc/bin/metro
===================================================================
--- trunk/main/metro/main/etc/bin/metro 2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/main/metro/main/etc/bin/metro 2007-09-16 15:17:36 UTC (rev 2037)
@@ -7,7 +7,7 @@
fi

if [ "$DPML_SYSTEM" = "" ]; then
- export DPML_SYSTEM="$DPML_HOME/share"
+ export DPML_SYSTEM="/opt/dpml/share"
fi

if [ "$METRO_SECURITY_POLICY" = "" ] ; then

Modified: trunk/main/metro/main/src/main/dpml/metro/console/Main.java
===================================================================
--- trunk/main/metro/main/src/main/dpml/metro/console/Main.java 2007-09-16
03:28:31 UTC (rev 2036)
+++ trunk/main/metro/main/src/main/dpml/metro/console/Main.java 2007-09-16
15:17:36 UTC (rev 2037)
@@ -435,8 +435,10 @@
buffer.append( "\n" );
buffer.append( "\n DPML Metro" );
buffer.append( "\n Version @PROJECT-VERSION@" );
+ buffer.append( "\n Codebase " +
getClass().getProtectionDomain().getCodeSource().getLocation() );
buffer.append( "\n Copyright 2005-2007 Stephen J. McConnell" );
buffer.append( "\n Digital Product Management Library" );
+ buffer.append( "\n" );
String message = buffer.toString();
m_logger.info( message );
}

Modified: trunk/main/metro/station/etc/bin/station
===================================================================
--- trunk/main/metro/station/etc/bin/station 2007-09-16 03:28:31 UTC (rev
2036)
+++ trunk/main/metro/station/etc/bin/station 2007-09-16 15:17:36 UTC (rev
2037)
@@ -7,7 +7,7 @@
fi

if [ "$DPML_SYSTEM" = "" ]; then
- export DPML_SYSTEM="$DPML_HOME/share"
+ export DPML_SYSTEM="/opt/dpml/share"
fi

if [ "$STATION_SECURITY_POLICY" = "" ] ; then

Modified: trunk/main/metro/station/src/main/dpml/station/console/Main.java
===================================================================
--- trunk/main/metro/station/src/main/dpml/station/console/Main.java
2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/main/metro/station/src/main/dpml/station/console/Main.java
2007-09-16 15:17:36 UTC (rev 2037)
@@ -833,6 +833,7 @@
buffer.append( "\n Codebase " +
getClass().getProtectionDomain().getCodeSource().getLocation() );
buffer.append( "\n Copyright 2005-2007 Stephen J. McConnell" );
buffer.append( "\n Digital Product Management Library" );
+ buffer.append( "\n" );
String message = buffer.toString();
m_logger.info( message );
}

Modified: trunk/main/transit/core/bootstrap.xml
===================================================================
--- trunk/main/transit/core/bootstrap.xml 2007-09-16 03:28:31 UTC (rev
2036)
+++ trunk/main/transit/core/bootstrap.xml 2007-09-16 15:17:36 UTC (rev
2037)
@@ -54,6 +54,15 @@
<antcall target="execute.jar.asc"/>
<echo>

#----------------------------------------------------------------------------------
+# Updating Transit Copnfig. ${dpml.config}/dpml/transit
+#----------------------------------------------------------------------------------
+ </echo>
+ <mkdir dir="${dpml.config}/dpml/transit"/>
+ <copy preservelastmodified="true" toDir="${dpml.config}/dpml/transit">
+ <fileset dir="${basedir}/target/config"/>
+ </copy>
+ <echo>
+#----------------------------------------------------------------------------------
# Updating Transit Prefs. ${dpml.prefs}/dpml/transit

#----------------------------------------------------------------------------------
</echo>

Modified: trunk/main/transit/core/build.xml
===================================================================
--- trunk/main/transit/core/build.xml 2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/main/transit/core/build.xml 2007-09-16 15:17:36 UTC (rev 2037)
@@ -8,6 +8,15 @@
<target name="update">
<echo>

#----------------------------------------------------------------------------------
+# Updating Transit Config. ${dpml.config}/dpml/transit
+#----------------------------------------------------------------------------------
+ </echo>
+ <mkdir dir="${dpml.config}/dpml/transit"/>
+ <copy preservelastmodified="true" toDir="${dpml.config}/dpml/transit">
+ <fileset dir="${basedir}/target/config"/>
+ </copy>
+ <echo>
+#----------------------------------------------------------------------------------
# Updating Transit Prefs. ${dpml.prefs}/dpml/transit

#----------------------------------------------------------------------------------
</echo>

Modified: trunk/main/transit/core/src/main/net/dpml/transit/Artifact.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Artifact.java
2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/main/transit/core/src/main/net/dpml/transit/Artifact.java
2007-09-16 15:17:36 UTC (rev 2037)
@@ -49,8 +49,13 @@
* Constant scheme name for the local protocol.
*/
public static final String LOCAL = "local";
+
+ /**
+ * Constant scheme name for the configuration protocol.
+ */
+ public static final String CONFIGURATION = "configuration";

- static final long serialVersionUID = 1L;
+ static final long serialVersionUID = 2L;

//
------------------------------------------------------------------------
// static
@@ -304,6 +309,10 @@
{
return true;
}
+ else if( CONFIGURATION.equals( scheme ) )
+ {
+ return true;
+ }
else
{
return LOCAL.equals( scheme );
@@ -566,6 +575,10 @@
{
return toURL( new dpml.transit.local.Handler() );
}
+ else if( CONFIGURATION.equals( scheme ) )
+ {
+ return toURL( new dpml.transit.configuration.Handler() );
+ }
else
{
final String error =

Modified: trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
2007-09-16 15:17:36 UTC (rev 2037)
@@ -102,6 +102,11 @@
* Transit share key (alias to dpml.system).
*/
private static final String SHARE_KEY = "dpml.share";
+
+ /**
+ * Transit config key.
+ */
+ private static final String CONFIG_KEY = "dpml.config";

/**
* DPML environment variable string.
@@ -137,6 +142,12 @@
* dependent.
*/
public static final File PREFS;
+
+ /**
+ * The Transit shared config directory. The location of this diectory is
system
+ * dependent.
+ */
+ public static final File CONFIG;

/**
* The Transit system version.
@@ -173,12 +184,14 @@
SYSTEM = resolveSystemDirectory( HOME );
DATA = resolveDataDirectory( HOME );
PREFS = resolvePreferencesDirectory( HOME );
+ CONFIG = resolveConfigDirectory( SYSTEM );

System.setProperty( SYSTEM_KEY, SYSTEM.getAbsolutePath() );
System.setProperty( SHARE_KEY, SYSTEM.getAbsolutePath() );
System.setProperty( HOME_KEY, HOME.getAbsolutePath() );
System.setProperty( DATA_KEY, DATA.getAbsolutePath() );
System.setProperty( PREFS_KEY, PREFS.getAbsolutePath() );
+ System.setProperty( CONFIG_KEY, CONFIG.getAbsolutePath() );
}

/**
@@ -432,6 +445,28 @@
return new File( dir, "prefs" );
}
}
+
+ /**
+ * Resolve the DPML config directory. The value
+ * returned may be overriden by setting a 'dpml.config'
+ * system property otherwise the default value returned
+ * will be equivalent to <tt>${dpml.system}/config</tt>.
+ *
+ * @param dir the default system directory
+ * @return the transit shared configuration directory
+ */
+ private static File resolveConfigDirectory( File dir )
+ {
+ String path = System.getProperty( CONFIG_KEY );
+ if( null != path )
+ {
+ return new File( path );
+ }
+ else
+ {
+ return new File( dir, "config" );
+ }
+ }

//------------------------------------------------------------------
// static internal
@@ -444,7 +479,7 @@

/**
* Resolve the transit configuration using the default resource path
- * <tt>local:xml:dpml/transit/config</tt>. If the resource does not exist
a classic
+ * <tt>configuration:xml:dpml/transit/config</tt>. If the resource does
not exist a classic
* default scenario will be returned.
*
* @return the transit configuration directive
@@ -460,11 +495,11 @@
}
else
{
- File prefs = Transit.PREFS;
- File config = new File( prefs, STANDARD_PATH );
- if( config.exists() )
+ File config = Transit.CONFIG;
+ File configuration = new File( config, STANDARD_PATH );
+ if( configuration.exists() )
{
- URI uri = config.toURI();
+ URI uri = configuration.toURI();
URL url = uri.toURL();
return loadTransitDirective( url );
}
@@ -505,8 +540,8 @@
}
else
{
- File prefs = Transit.PREFS;
- File alt = new File( prefs, path );
+ File config = Transit.CONFIG;
+ File alt = new File( config, path );
if( alt.exists() )
{
return alt.toURI().toURL();

Added: trunk/setup.sh
===================================================================
--- trunk/setup.sh 2007-09-16 03:28:31 UTC (rev 2036)
+++ trunk/setup.sh 2007-09-16 15:17:36 UTC (rev 2037)
@@ -0,0 +1,7 @@
+#!/bin/sh
+export DPML_HOME="$HOME/.dpml"
+export DPML_SYSTEM="$DPML_HOME/share"
+export PATH="$DPML_SYSTEM/bin:$PATH"
+
+echo "SYSTEM: " $DPML_SYSTEM
+


Property changes on: trunk/setup.sh
___________________________________________________________________
Name: svn:executable
+ *




  • r2037 - in trunk: . etc etc/debian main/depot/build/etc/bin main/depot/build/src/main/dpml/build main/depot/tools/src/main/dpml/tools/tasks main/metro/main main/metro/main/etc/bin main/metro/main/src/main/dpml/metro/console main/metro/part/etc main/metro/station/etc/bin main/metro/station/src/main/dpml/station/console main/transit/core main/transit/core/src/main/net/dpml/transit, davidoff at BerliOS, 09/16/2007

Archive powered by MHonArc 2.6.24.

Top of Page