notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r1335 - in trunk/main: central/src/docs/about/download depot/tools/builder/src/main/net/dpml/tools/impl depot/tools/builder/src/main/net/dpml/tools/model depot/tools/builder/src/main/net/dpml/tools/tasks metro/runtime
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r1335 - in trunk/main: central/src/docs/about/download depot/tools/builder/src/main/net/dpml/tools/impl depot/tools/builder/src/main/net/dpml/tools/model depot/tools/builder/src/main/net/dpml/tools/tasks metro/runtime
- Date: Fri, 7 Apr 2006 20:54:02 +0200
Author: mcconnell
Date: 2006-04-07 20:53:39 +0200 (Fri, 07 Apr 2006)
New Revision: 1335
Modified:
trunk/main/central/src/docs/about/download/archive.xml
trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/DefaultContext.java
trunk/main/depot/tools/builder/src/main/net/dpml/tools/model/Context.java
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/FeatureTask.java
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PrepareTask.java
trunk/main/metro/runtime/build.xml
Log:
add support for the customization of etc/main and etc/test
Modified: trunk/main/central/src/docs/about/download/archive.xml
===================================================================
--- trunk/main/central/src/docs/about/download/archive.xml 2006-04-07
17:04:32 UTC (rev 1334)
+++ trunk/main/central/src/docs/about/download/archive.xml 2006-04-07
18:53:39 UTC (rev 1335)
@@ -19,6 +19,15 @@
<subsection name="Build @VERSION@">
+ <p>
+ Enhancements include:
+ </p>
+
+ <ul>
+ <li>Support for the declaration of custom etc/main and etc/text
directories.</li>
+ </ul>
+
+
<table>
<tr>
<td>Windows NSIS Installer</td>
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/DefaultContext.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/DefaultContext.java
2006-04-07 17:04:32 UTC (rev 1334)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/DefaultContext.java
2006-04-07 18:53:39 UTC (rev 1335)
@@ -95,6 +95,8 @@
project.setNewProperty( "project.src.main.dir",
getSrcMainDirectory().toString() );
project.setNewProperty( "project.src.test.dir",
getSrcTestDirectory().toString() );
project.setNewProperty( "project.etc.dir",
getEtcDirectory().toString() );
+ project.setNewProperty( "project.etc.main.dir",
getEtcMainDirectory().toString() );
+ project.setNewProperty( "project.etc.test.dir",
getEtcTestDirectory().toString() );
project.setNewProperty( "project.target.dir",
getTargetDirectory().toString() );
project.setNewProperty( "project.target.build.main.dir",
getTargetBuildMainDirectory().toString() );
@@ -268,6 +270,26 @@
}
/**
+ * Return the project etc/main directory.
+ * @return the directory
+ */
+ public File getEtcMainDirectory()
+ {
+ String path = getProperty( "project.etc.main", "etc/main" );
+ return createFile( path );
+ }
+
+ /**
+ * Return the project etc/test directory.
+ * @return the directory
+ */
+ public File getEtcTestDirectory()
+ {
+ String path = getProperty( "project.etc.test", "etc/test" );
+ return createFile( path );
+ }
+
+ /**
* Return the project target directory.
* @return the directory
*/
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/model/Context.java
===================================================================
--- trunk/main/depot/tools/builder/src/main/net/dpml/tools/model/Context.java
2006-04-07 17:04:32 UTC (rev 1334)
+++ trunk/main/depot/tools/builder/src/main/net/dpml/tools/model/Context.java
2006-04-07 18:53:39 UTC (rev 1335)
@@ -60,18 +60,6 @@
String getProperty( String key, String value );
/**
- * Return the value of a property. If the project contains a declaration
- * for the property then that value will be returned, otherwise the
property
- * will be resolved relative to the current resource.
- *
- * @param type the type production
- * @param key the property key
- * @param value the default value
- * @return the property value or null if undefined
- */
- //String getProperty( Type type, String key, String value );
-
- /**
* Return an Ant path suitable for compile or runtime usage. If the
supplied scope is
* less than Scope.RUNTIME a runtime path is returned otherwise the test
path is
* returned.
@@ -124,6 +112,18 @@
File getEtcDirectory();
/**
+ * Return the project etc/main directory.
+ * @return the directory
+ */
+ File getEtcMainDirectory();
+
+ /**
+ * Return the project etc/test directory.
+ * @return the directory
+ */
+ File getEtcTestDirectory();
+
+ /**
* Return the project target directory.
* @return the directory
*/
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/FeatureTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/FeatureTask.java
2006-04-07 17:04:32 UTC (rev 1334)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/FeatureTask.java
2006-04-07 18:53:39 UTC (rev 1335)
@@ -40,7 +40,6 @@
private String m_key;
private String m_ref;
private String m_feature;
- private String m_prefix;
private boolean m_windows = true;
private boolean m_flag = false; // os not set
private String m_type; // optional - used to select type when resolving
uris
@@ -90,15 +89,6 @@
}
/**
- * Set the prefix.
- * @param prefix ??
- */
- public void setPrefix( final String prefix )
- {
- m_prefix = prefix;
- }
-
- /**
* Set the platform.
* @param os a value of 'windows' or 'unix'
*/
@@ -318,87 +308,4 @@
throw new BuildException( error, e );
}
}
-
- /*
- private String getPath( final Resource def )
- {
- if( null == m_prefix )
- {
- final String error =
- "Filter attribute 'prefix' is not declared.";
- throw new BuildException( error );
- }
- if( !m_flag )
- {
- final String error =
- "Filter attribute 'platform' is not declared.";
- throw new BuildException( error );
- }
-
- File cache = getCacheDirectory();
- String root = cache.toString();
- ProjectPath path = new ProjectPath( getProject() );
- path.setMode( "RUNTIME" );
- path.setKey( def.getKey() );
- path.setResolve( false );
- String sequence = path.toString();
- String[] translation = Path.translatePath( getProject(), sequence );
-
- //
- // substitute the cache directory with the prefix symbol
- //
-
- for( int i=0; i < translation.length; i++ )
- {
- String trans = translation[i];
- if( trans.startsWith( root ) )
- {
- String relativeFilename = trans.substring( root.length() );
- log( relativeFilename, Project.MSG_VERBOSE );
- translation[i] = m_prefix + relativeFilename;
- }
- }
-
- //
- // do platform conversion
- //
-
- StringBuffer buffer = new StringBuffer();
- for( int i=0; i < translation.length; i++ )
- {
- String trans = convertString( translation[i] );
- if( i > 0 )
- {
- if( m_windows )
- {
- buffer.append( ";" );
- }
- else
- {
- buffer.append( ":" );
- }
- }
- buffer.append( trans );
- }
-
- return buffer.toString();
- }
- */
- /*
- private String convertString( String value )
- {
- if( !m_flag )
- {
- return value;
- }
- if( m_windows )
- {
- return value.replace( '/', '\\' );
- }
- else
- {
- return value.replace( '\\', '/' );
- }
- }
- */
}
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PrepareTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PrepareTask.java
2006-04-07 17:04:32 UTC (rev 1334)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PrepareTask.java
2006-04-07 18:53:39 UTC (rev 1335)
@@ -131,7 +131,8 @@
{
log( "project does not contain 'test' src.", Project.MSG_VERBOSE
);
}
- if( context.getEtcDirectory().exists() )
+
+ if( context.getEtcMainDirectory().exists() )
{
final String includes =
resource.getProperty( ETC_FILTERED_INCLUDES_KEY,
ETC_FILTERED_INCLUDES_VALUE );
@@ -139,37 +140,49 @@
resource.getProperty( ETC_FILTERED_EXCLUDES_KEY,
ETC_FILTERED_EXCLUDES_VALUE );
//
- // copy ${etc}/test content to ${target}/build/test
+ // copy ${etc}/main content to ${target}/build/main
//
- File etc = context.getEtcDirectory();
- final File etcTest = new File( etc, "test" );
- if( etcTest.exists() )
- {
- final File test = context.getTargetDirectory( "test" );
- copy( etcTest, test, true, includes, excludes );
- copy( etcTest, test, false, excludes, "" );
- }
+ final File etcMain = context.getEtcMainDirectory();
+ final File buildMainDir = context.getTargetDirectory(
"build/main" );
+ copy( etcMain, buildMainDir, true, includes, excludes );
+ copy( etcMain, buildMainDir, false, excludes, "" );
+ }
+
+ if( context.getEtcTestDirectory().exists() )
+ {
+ final String includes =
+ resource.getProperty( ETC_FILTERED_INCLUDES_KEY,
ETC_FILTERED_INCLUDES_VALUE );
+ final String excludes =
+ resource.getProperty( ETC_FILTERED_EXCLUDES_KEY,
ETC_FILTERED_EXCLUDES_VALUE );
//
- // copy ${etc}/main content to ${target}/build/main
+ // copy ${etc}/test content to ${target}/build/test
//
- final File etcMain = new File( etc, "main" );
- if( etcMain.exists() )
- {
- final File buildMainDir = context.getTargetDirectory(
"build/main" );
- copy( etcMain, buildMainDir, true, includes, excludes );
- copy( etcMain, buildMainDir, false, excludes, "" );
- }
+ final File etcTest = context.getEtcTestDirectory();
+ final File test = context.getTargetDirectory( "test" );
+ copy( etcTest, test, true, includes, excludes );
+ copy( etcTest, test, false, excludes, "" );
+ }
+
+ if( context.getEtcDirectory().exists() )
+ {
+ final String includes =
+ resource.getProperty( ETC_FILTERED_INCLUDES_KEY,
ETC_FILTERED_INCLUDES_VALUE );
+ final String excludes =
+ resource.getProperty( ETC_FILTERED_EXCLUDES_KEY,
ETC_FILTERED_EXCLUDES_VALUE );
+ final File etc = context.getEtcDirectory();
//
// ${etc}/* directories (excluding test, main and deliverables)
// directly to the target directory
//
+ String main = context.getEtcMainDirectory().toString() + "/**";
+ String test = context.getEtcTestDirectory().toString() + "/**";
File target = context.getTargetDirectory();
- final String standard = "main/**,test/**,";
+ final String standard = main + "," + test;
copy( etc, target, true, includes, standard + excludes );
copy( etc, target, false, excludes, standard );
}
Modified: trunk/main/metro/runtime/build.xml
===================================================================
--- trunk/main/metro/runtime/build.xml 2006-04-07 17:04:32 UTC (rev 1334)
+++ trunk/main/metro/runtime/build.xml 2006-04-07 18:53:39 UTC (rev 1335)
@@ -45,14 +45,6 @@
</rmic>
</target>
- <!--
- <target name="install" depends="standard.install">
- <x:property feature="uri" type="part" name="builder.uri"/>
- <mkdir dir="${dpml.cache}/dpml/lang/parts"/>
- <echo file="${dpml.cache}/dpml/lang/parts/dpml-component.part.link"
message="${builder.uri}"/>
- </target>
- -->
-
</project>
- r1335 - in trunk/main: central/src/docs/about/download depot/tools/builder/src/main/net/dpml/tools/impl depot/tools/builder/src/main/net/dpml/tools/model depot/tools/builder/src/main/net/dpml/tools/tasks metro/runtime, mcconnell at BerliOS, 04/07/2006
Archive powered by MHonArc 2.6.24.