Skip to Content.
Sympa Menu

notify-dpml - r1431 - in trunk/main/lang/process: etc etc/test src/main/net/dpml/lang/product src/test/net/dpml/lang/process

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1431 - in trunk/main/lang/process: etc etc/test src/main/net/dpml/lang/product src/test/net/dpml/lang/process
  • Date: Sat, 6 May 2006 19:33:14 +0200

Author: mcconnell
Date: 2006-05-06 19:33:09 +0200 (Sat, 06 May 2006)
New Revision: 1431

Added:

trunk/main/lang/process/src/main/net/dpml/lang/product/DirectoryDirective.java
trunk/main/lang/process/src/main/net/dpml/lang/product/FileDirective.java
Removed:

trunk/main/lang/process/src/main/net/dpml/lang/product/DirectoryProductDirective.java
Modified:
trunk/main/lang/process/etc/process.xsd
trunk/main/lang/process/etc/test/sample.xml

trunk/main/lang/process/src/test/net/dpml/lang/process/ProcessXsdTestCase.java
Log:
moving forward with product/process model


Modified: trunk/main/lang/process/etc/process.xsd
===================================================================
--- trunk/main/lang/process/etc/process.xsd 2006-05-04 16:42:43 UTC (rev
1430)
+++ trunk/main/lang/process/etc/process.xsd 2006-05-06 17:33:09 UTC (rev
1431)
@@ -54,33 +54,29 @@
</complexContent>
</complexType>

- <simpleType name="PolicyType">
- <restriction base="string">
- <enumeration value="optional"/>
- <enumeration value="conditional"/>
- </restriction>
- </simpleType>
+ <!-- generic process definition -->

- <!-- process definitions -->
-
<complexType name="ProcessType">
<sequence>
<element name="dependencies" type="this:DependenciesType"
minOccurs="0" maxOccurs="1"/>
<element name="consumes" type="this:ConsumesType" minOccurs="0"
maxOccurs="1"/>
- <element name="produces" type="this:ProducesType" minOccurs="0"
maxOccurs="1"/>
<element name="validators" type="this:ValidatorsType" minOccurs="0"
maxOccurs="1"/>
+ <element name="params" type="anyType" minOccurs="0" maxOccurs="1"/>
</sequence>
<attribute name="name" type="string" use="required"/>
<attribute name="class" type="string" use="required"/>
<attribute name="implicit" type="boolean" default="false"/>
+ <attribute name="produces" type="string" use="optional"/>
</complexType>
+
+ <complexType name="ParametersType" abstract="true"/>

<complexType name="DependenciesType">
<sequence>
- <element name="include" type="this:DependencyType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="dependency" type="this:DependencyType" minOccurs="0"
maxOccurs="unbounded"/>
</sequence>
</complexType>
-
+
<complexType name="ValidatorsType">
<sequence>
<element name="include" type="this:DependencyType" minOccurs="0"
maxOccurs="unbounded"/>
@@ -120,7 +116,7 @@
</extension>
</complexContent>
</complexType>
-
+
<complexType name="SelectorType">
<attribute name="name" type="string"/>
</complexType>
@@ -129,5 +125,42 @@
<attribute name="id" type="string"/>
</complexType>

+ <simpleType name="PolicyType">
+ <restriction base="string">
+ <enumeration value="optional"/>
+ <enumeration value="conditional"/>
+ </restriction>
+ </simpleType>
+
+ <complexType name="SelectionParameters">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="include" type="this:SelectorType"/>
+ <element name="exclude" type="this:SelectorType"/>
+ </choice>
+ <attribute name="defaultIncludes" type="string"/>
+ <attribute name="defaultExcludes" type="string"/>
+ </complexType>
+
+ <complexType name="SelectiveProcess">
+ <complexContent>
+ <extension base="this:ProcessType">
+ <sequence>
+ <element name="selection" type="this:SelectionParameters"
minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- specialized production types -->
+
+ <complexType name="JarParameters">
+ <complexContent>
+ <extension base="this:SelectionParameters">
+ <attribute name="compress" type="boolean" use="optional"
default="true"/>
+ <attribute name="index" type="boolean" use="optional"
default="true"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
</schema>


Modified: trunk/main/lang/process/etc/test/sample.xml
===================================================================
--- trunk/main/lang/process/etc/test/sample.xml 2006-05-04 16:42:43 UTC (rev
1430)
+++ trunk/main/lang/process/etc/test/sample.xml 2006-05-06 17:33:09 UTC (rev
1431)
@@ -53,7 +53,8 @@

<!-- processes -->

- <process name="prepare-main"
class="net.dpml.tools.process.PrepareMainProcess">
+ <process name="prepare-main"
class="net.dpml.tools.process.PrepareMainProcess"
+ produces="target.build.main.dir">
<consumes>
<input xsi:type="Selection" id="etc.main" filtering="false">
<include
name="**/*.exe,**/*.jar*,**/*.dll,**/*.gif,**/*.jpeg,**/*.jpg,**/*.ico,**/*.png,**/*.keystore"/>
@@ -62,80 +63,85 @@
<exclude
name="**/*.exe,**/*.jar*,**/*.dll,**/*.gif,**/*.jpeg,**/*.jpg,**/*.ico,**/*.png,**/*.keystore"/>
</input>
</consumes>
- <produces id="target.build.main.dir"/>
</process>

- <process name="prepare-test"
class="net.dpml.tools.process.PrepareTestProcess">
+ <process name="prepare-test"
class="net.dpml.tools.process.PrepareTestProcess"
+ produces="target.build.test.dir">
<consumes policy="conditional">
<input id="target.build.main.dir"/>
<input id="src.test" policy="optional"/>
</consumes>
- <produces id="target.build.test.dir"/>
</process>

- <process name="compile-main"
class="net.dpml.tools.process.CompileMainProcess" implicit="true">
+ <process name="compile-main"
class="net.dpml.tools.process.CompileMainProcess" implicit="true"
+ produces="target.classes.main.dir">
<consumes>
<input xsi:type="Selection" id="target.build.main.dir"
policy="conditional">
<exclude name="**/*.java,**/package.html"/>
</input>
</consumes>
- <produces id="target.classes.main.dir"/>
</process>

- <process name="compile-test"
class="net.dpml.tools.process.CompileTestProcess" implicit="true">
+ <process name="compile-test"
class="net.dpml.tools.process.CompileTestProcess" implicit="true"
+ produces="target.classes.test.dir">
<consumes>
<input id="target.classes.main.dir"/>
<input id="target.build.test.dir" policy="conditional"/>
</consumes>
- <produces id="target.classes.test.dir"/>
</process>

- <process name="setup-junit"
class="net.dpml.tools.process.PrepareJUnitProcess">
+ <process name="setup-junit"
class="net.dpml.tools.process.PrepareJUnitProcess"
+ produces="target.test.dir">
<dependencies>
- <include id="prepare-test"/>
+ <dependency id="prepare-test"/>
</dependencies>
<consumes policy="conditional">
<input id="etc.test"/>
</consumes>
- <produces id="target.test.dir"/>
</process>

- <process name="jar" class="net.dpml.tools.process.JarProcess">
+ <process name="jar" class="net.dpml.tools.process.JarProcess"
+ produces="target.deliverables.jar">
<consumes>
<input id="target.classes.main.dir" policy="conditional"/>
</consumes>
- <produces id="target.deliverables.jar"/>
<validators>
<include id="junit"/>
</validators>
+ <params xsi:type="this:JarParameters" index="true" compress="true">
+ <include name="**/*.*"/>
+ <exclude name="**/package.html"/>
+ </params>
</process>

- <process name="junit" class="net.dpml.tools.process.JavaUnitProcess">
+ <process name="junit" class="net.dpml.tools.process.JUnitProcess"
+ produces="target.reports.test.dir">
<dependencies>
- <include id="jar"/>
- <include id="compile-test"/>
+ <dependency id="jar"/>
+ <dependency id="compile-test"/>
</dependencies>
<consumes>
<input id="target.test.dir"/>
<input id="target.classes.test.dir" policy="conditional"/>
</consumes>
- <produces id="target.reports.test.dir"/>
+ <params xsi:type="this:SelectionParameters"/>
</process>

<process name="rmic" class="net.dpml.tools.process.RMICProcess">
<dependencies>
- <include id="compile-main"/>
+ <dependency id="compile-main"/>
</dependencies>
<consumes>
<input id="target.classes.main.dir" policy="conditional"/>
</consumes>
+ <params xsi:type="this:SelectionParameters"/>
</process>

- <process name="part" class="net.dpml.tools.process.PartProcess">
+ <process name="part" class="net.dpml.tools.process.PartProcess"
+ produces="target.deliverables.part">
<consumes>
<input id="target.classes.main.dir"/>
</consumes>
- <produces id="target.deliverables.part"/>
</process>

</configuration>

Copied:
trunk/main/lang/process/src/main/net/dpml/lang/product/DirectoryDirective.java
(from rev 1430,
trunk/main/lang/process/src/main/net/dpml/lang/product/DirectoryProductDirective.java)
===================================================================
---
trunk/main/lang/process/src/main/net/dpml/lang/product/DirectoryProductDirective.java
2006-05-04 16:42:43 UTC (rev 1430)
+++
trunk/main/lang/process/src/main/net/dpml/lang/product/DirectoryDirective.java
2006-05-06 17:33:09 UTC (rev 1431)
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2006 Stephen J. McConnell
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.lang.product;
+
+/**
+ * The DirectoryProductDirective class describes a working directory.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DirectoryDirective extends AbstractProductDirective
+{
+ private final String m_path;
+
+ public DirectoryDirective( final String name, final InfoDirective info,
String path )
+ {
+ super( name, info );
+
+ if( null == path )
+ {
+ throw new NullPointerException( "path" );
+ }
+
+ m_path = path;
+ }
+
+ /**
+ * Get the product name.
+ * @return the product name.
+ */
+ public String getPath()
+ {
+ return m_path;
+ }
+
+ /**
+ * Compare this object with another for equality.
+ * @param other the other object
+ * @return true if equal
+ */
+ public boolean equals( Object other )
+ {
+ if( super.equals( other ) && ( other instanceof DirectoryDirective )
)
+ {
+ DirectoryDirective object = (DirectoryDirective) other;
+ return m_path.equals( object.m_path );
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Compute the hash value.
+ * @return the hashcode value
+ */
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= hashValue( m_path );
+ return hash;
+ }
+}

Deleted:
trunk/main/lang/process/src/main/net/dpml/lang/product/DirectoryProductDirective.java
===================================================================
---
trunk/main/lang/process/src/main/net/dpml/lang/product/DirectoryProductDirective.java
2006-05-04 16:42:43 UTC (rev 1430)
+++
trunk/main/lang/process/src/main/net/dpml/lang/product/DirectoryProductDirective.java
2006-05-06 17:33:09 UTC (rev 1431)
@@ -1,80 +0,0 @@
-/*
- * Copyright 2006 Stephen J. McConnell
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.dpml.lang.product;
-
-/**
- * The DirectoryProductDirective class describes a working directory.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class DirectoryProductDirective extends AbstractProductDirective
-{
- private final String m_path;
-
- public DirectoryProductDirective( final String name, final InfoDirective
info, String path )
- {
- super( name, info );
-
- if( null == path )
- {
- throw new NullPointerException( "path" );
- }
-
- m_path = path;
- }
-
- /**
- * Get the product name.
- * @return the product name.
- */
- public String getPath()
- {
- return m_path;
- }
-
- /**
- * Compare this object with another for equality.
- * @param other the other object
- * @return true if equal
- */
- public boolean equals( Object other )
- {
- if( super.equals( other ) && ( other instanceof
DirectoryProductDirective ) )
- {
- DirectoryProductDirective object = (DirectoryProductDirective)
other;
- return m_path.equals( object.m_path );
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Compute the hash value.
- * @return the hashcode value
- */
- public int hashCode()
- {
- int hash = super.hashCode();
- hash ^= hashValue( m_path );
- return hash;
- }
-}

Added:
trunk/main/lang/process/src/main/net/dpml/lang/product/FileDirective.java
===================================================================
--- trunk/main/lang/process/src/main/net/dpml/lang/product/FileDirective.java
2006-05-04 16:42:43 UTC (rev 1430)
+++ trunk/main/lang/process/src/main/net/dpml/lang/product/FileDirective.java
2006-05-06 17:33:09 UTC (rev 1431)
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2006 Stephen J. McConnell
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.lang.product;
+
+/**
+ * The FileDirective class describes a deliverable produced by a process.
+ * A file is normally associated with a colocated MD5 and ASC resource.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class FileDirective extends AbstractProductDirective
+{
+ private final String m_type;
+
+ /**
+ * Creation of a new file directive.
+ * @param name the product identifier
+ * @param info supplimentary product info
+ * @param type the artifact type
+ */
+ public FileDirective( final String name, final InfoDirective info,
String type )
+ {
+ super( name, info );
+
+ if( null == type )
+ {
+ throw new NullPointerException( "type" );
+ }
+
+ m_type = type;
+ }
+
+ /**
+ * Get the product type name.
+ * @return the product type.
+ */
+ public String getType()
+ {
+ return m_type;
+ }
+
+ /**
+ * Compare this object with another for equality.
+ * @param other the other object
+ * @return true if equal
+ */
+ public boolean equals( Object other )
+ {
+ if( super.equals( other ) && ( other instanceof FileDirective ) )
+ {
+ FileDirective object = (FileDirective) other;
+ return m_type.equals( object.m_type );
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Compute the hash value.
+ * @return the hashcode value
+ */
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= hashValue( m_type );
+ return hash;
+ }
+}

Modified:
trunk/main/lang/process/src/test/net/dpml/lang/process/ProcessXsdTestCase.java
===================================================================
---
trunk/main/lang/process/src/test/net/dpml/lang/process/ProcessXsdTestCase.java
2006-05-04 16:42:43 UTC (rev 1430)
+++
trunk/main/lang/process/src/test/net/dpml/lang/process/ProcessXsdTestCase.java
2006-05-06 17:33:09 UTC (rev 1431)
@@ -326,15 +326,7 @@

private String getProcessProductionID( Element process )
{
- Element produces = ElementHelper.getChild( process, "produces" );
- if( null == produces )
- {
- return null;
- }
- else
- {
- return ElementHelper.getAttribute( produces, "id" );
- }
+ return ElementHelper.getAttribute( process, "produces" );
}

private Element[] getInputElements( Element process )
@@ -361,16 +353,15 @@
fail( error );
}
}
- Element produces = ElementHelper.getChild( process, "produces" );
- if( null != produces )
+ String id = getProcessProductionID( process );
+ if( null != id )
{
- String id = ElementHelper.getAttribute( produces, "id" );
Element product = (Element) m_products.get( id );
if( null == product )
{
final String error =
"Output production assertion:\n"
- + DecodingException.list( produces )
+ + DecodingException.list( process )
+ "\n references an unknown product: "
+ id;
fail( error );




  • r1431 - in trunk/main/lang/process: etc etc/test src/main/net/dpml/lang/product src/test/net/dpml/lang/process, mcconnell at BerliOS, 05/06/2006

Archive powered by MHonArc 2.6.24.

Top of Page