Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1597 - in development/main: magic/core/src/main/net/dpml/magic/model magic/core/src/main/net/dpml/magic/project magic/core/src/main/net/dpml/magic/tasks transit transit/handler util

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1597 - in development/main: magic/core/src/main/net/dpml/magic/model magic/core/src/main/net/dpml/magic/project magic/core/src/main/net/dpml/magic/tasks transit transit/handler util
  • Date: Fri, 28 Jan 2005 22:45:32 +0100

Author: mcconnell
Date: Fri Jan 28 22:45:31 2005
New Revision: 1597

Modified:
development/main/magic/core/src/main/net/dpml/magic/model/Resource.java

development/main/magic/core/src/main/net/dpml/magic/project/ProjectPath.java
development/main/magic/core/src/main/net/dpml/magic/tasks/BarTask.java
development/main/transit/handler/build.xml
development/main/transit/module.xml
development/main/util/module.xml
Log:
Add support to the Resource.getPath() method to take a module filtering flag
(default is false). If module filting is set to true then the path returned
is restricted to the resources within the module.

Modified:
development/main/magic/core/src/main/net/dpml/magic/model/Resource.java
==============================================================================
--- development/main/magic/core/src/main/net/dpml/magic/model/Resource.java
(original)
+++ development/main/magic/core/src/main/net/dpml/magic/model/Resource.java
Fri Jan 28 22:45:31 2005
@@ -227,7 +227,7 @@
*/
public Path getPath( final Project project, final int mode )
{
- return getPath( project, mode, "jar" );
+ return getPath( project, mode, "jar", false );
}

/**
@@ -238,7 +238,7 @@
* @param filter a value of "*" for any or a type identifier such as "jar"
* @exception NullArgumentException if the supplied project argument is
null.
*/
- public Path getPath( final Project project, final int mode, String
filter )
+ public Path getPath( final Project project, final int mode, String
filter, boolean moduleFilter )
throws NullArgumentException
{
if( null == project )
@@ -255,13 +255,16 @@
if( ! visited.contains( ref ) )
{
final Resource resource = getResource( project, ref );
- Info info = resource.getInfo();
- String type = info.getType();
- if( ( "*".equals( filter ) || filter.equals( type ) )
- && !"".equals( type ) & !"theme".equals( type ) )
+ if( filterModule( resource, moduleFilter ) )
{
- final File file = resource.getArtifact( project );
- path.createPathElement().setLocation( file );
+ Info info = resource.getInfo();
+ String type = info.getType();
+ if( ( "*".equals( filter ) || filter.equals( type ) )
+ && !"".equals( type ) & !"theme".equals( type ) )
+ {
+ final File file = resource.getArtifact( project );
+ path.createPathElement().setLocation( file );
+ }
}
visited.add( ref );
}
@@ -269,6 +272,18 @@
return path;
}

+ private boolean filterModule( Resource resource, boolean module )
+ {
+ if( !module )
+ {
+ return true;
+ }
+ else
+ {
+ return getModule().equals( resource.getModule() );
+ }
+ }
+
private Resource getResource( Project project, ResourceRef ref )
{
try

Modified:
development/main/magic/core/src/main/net/dpml/magic/project/ProjectPath.java
==============================================================================
---
development/main/magic/core/src/main/net/dpml/magic/project/ProjectPath.java
(original)
+++
development/main/magic/core/src/main/net/dpml/magic/project/ProjectPath.java
Fri Jan 28 22:45:31 2005
@@ -46,6 +46,7 @@
private Context m_context;
private String m_key;
private String m_type = "jar";
+ private boolean m_module = false;
private int m_mode = Policy.RUNTIME;
private boolean m_initialized = false;
private boolean m_resolve = true;
@@ -87,6 +88,16 @@
}

/**
+ * Set module filtering. The default value is "*".
+ *
+ * @param module the module name to restrict path elements to.
+ */
+ public void setModule( final boolean module )
+ {
+ m_module = module;
+ }
+
+ /**
* Set the policy concerning path resolution. By default a path
* structure will only be returned if it can be fully resolved. Setting
* the resolve flag to false disables repository resolution of path
entries.
@@ -189,7 +200,8 @@
}

Resource def = getResource();
- Path path = def.getPath( getProject(), getMode(), m_type );
+
+ Path path = def.getPath( getProject(), getMode(), m_type, m_module );

if( null != m_key )
{

Modified:
development/main/magic/core/src/main/net/dpml/magic/tasks/BarTask.java
==============================================================================
--- development/main/magic/core/src/main/net/dpml/magic/tasks/BarTask.java
(original)
+++ development/main/magic/core/src/main/net/dpml/magic/tasks/BarTask.java
Fri Jan 28 22:45:31 2005
@@ -121,6 +121,7 @@
final FileSet fileset = new FileSet();
fileset.setDir( deliverables );
fileset.createInclude().setName( "**/*" );
+ fileset.createExclude().setName( "**/" + BAR_EXT + "s" );
fileset.createExclude().setName( "**/" + BAR_EXT + "s/*.*" );
ZipFileSet deliverablesSet = new BarZipFileSet( fileset );
deliverablesSet.setPrefix( getDefinition().getInfo().getGroup()
);

Modified: development/main/transit/handler/build.xml
==============================================================================
--- development/main/transit/handler/build.xml (original)
+++ development/main/transit/handler/build.xml Fri Jan 28 22:45:31 2005
@@ -43,7 +43,7 @@
</copy>
<jar destfile="${target.deliverables.jars.dir}/${project.filename}"
basedir="${target.classes.dir}"
- includes="**/*.class,**/*.xml,**/*.properties">
+ includes="**/*.*" excludes="**/*.html">
<manifest>
<attribute name="Main-Class" value="${project.jar.main.class}"/>
</manifest>

Modified: development/main/transit/module.xml
==============================================================================
--- development/main/transit/module.xml (original)
+++ development/main/transit/module.xml Fri Jan 28 22:45:31 2005
@@ -17,7 +17,7 @@
limitations under the License.
-->

-<project name="dpml-transit" default="docs" basedir="."
+<project name="dpml-transit" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

@@ -37,7 +37,18 @@
</x:module>
</target>

- <target name="docs" depends="install,junit-report,checkstyle">
+ <target name="install" depends="standard.install,docs">
+ <property name="root" value="${basedir}/target/temp"/>
+ <property name="anchor" value="${root}/${project.version}"/>
+ <mkdir dir="${anchor}"/>
+ <x:path id="util.path" type="*" mode="RUNTIME" module="true"/>
+ <x:replicate refid="util.path" toDir="${anchor}" />
+ <x:bar>
+ <fileset dir="${anchor}"/>
+ </x:bar>
+ </target>
+
+ <target name="docs" depends="standard.install,junit-report,checkstyle">
<x:javadoc overview="overview.html">
<link href="http://java.sun.com/j2se/1.4/docs/api"/>
<link href="http://www.dpml.net/api/commons-cli/1.0"/>

Modified: development/main/util/module.xml
==============================================================================
--- development/main/util/module.xml (original)
+++ development/main/util/module.xml Fri Jan 28 22:45:31 2005
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>

-<project name="dpml-util" default="docs" basedir="."
+<project name="dpml-util" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core">

@@ -11,7 +11,7 @@
<x:module index="index.xml"/>
</target>

- <target name="docs" depends="install,junit-report,checkstyle">
+ <target name="docs" depends="standard.install,junit-report,checkstyle">
<x:javadoc overview="overview.html" title="DPML Utilities API -
${project.version}">
<link href="http://java.sun.com/j2se/1.4/docs/api"/>
</x:javadoc>
@@ -27,4 +27,15 @@
</junitreport>
</target>

+ <target name="install" depends="standard.install,docs">
+ <property name="root" value="${basedir}/target/temp"/>
+ <property name="anchor" value="${root}/${project.version}"/>
+ <mkdir dir="${anchor}"/>
+ <x:path id="util.path" type="*" mode="RUNTIME" module="true"/>
+ <x:replicate refid="util.path" toDir="${anchor}" />
+ <x:bar>
+ <fileset dir="${anchor}"/>
+ </x:bar>
+ </target>
+
</project>



  • svn commit: r1597 - in development/main: magic/core/src/main/net/dpml/magic/model magic/core/src/main/net/dpml/magic/project magic/core/src/main/net/dpml/magic/tasks transit transit/handler util, mcconnell, 01/28/2005

Archive powered by MHonArc 2.6.24.

Top of Page