Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1698 - in development/main/home: . transit/etc transit/tools/src/main/net/dpml/transit transit/tools/src/main/net/dpml/transit/tools

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: r1698 - in development/main/home: . transit/etc transit/tools/src/main/net/dpml/transit transit/tools/src/main/net/dpml/transit/tools
  • Date: Wed, 02 Feb 2005 13:07:42 +0100

Author: mcconnell
Date: Wed Feb 2 13:07:41 2005
New Revision: 1698

Added:

development/main/home/transit/tools/src/main/net/dpml/transit/tools/GetTask.java
Modified:
development/main/home/build.xml
development/main/home/standard.xml
development/main/home/transit/etc/project.module
development/main/home/transit/tools/src/main/net/dpml/transit/antlib.xml
Log:
1. add the ant buildfile used in transit as a template that we use when
building magic core
2. add note concerning missing manaifest
3. add dpml-transit-tools project to the module definition and add ant as a
transit module resource dependency
4. add a GetTask to handle the transit based get of a reosurce (needed in the
magic core build)
5. update the antlib description to include 'get'

Modified: development/main/home/build.xml
==============================================================================
--- development/main/home/build.xml (original)
+++ development/main/home/build.xml Wed Feb 2 13:07:41 2005
@@ -115,6 +115,11 @@
<include name="NOTICE.TXT"/>
</fileset>
</copy>
+ <!-- add the standard.xml build procedure as a template -->
+ <property name="templates" value="${local}/dpml/transit/templates"/>
+ <echo>Adding build template to ${templates}</echo>
+ <mkdir dir="${templates}"/>
+ <copy tofile="${templates}/standard.template"
file="${basedir}/standard.xml"/>
</target>

<target name="install.children">
@@ -129,15 +134,7 @@
<ant dir="transit" inheritall="false"/>
</target>

- <target name="update.setup">
- <available file="${bundle}" property="bundle.available"/>
- </target>
-
- <target name="update.check" depends="update.setup"
unless="bundle.available">
- <ant target="dist"/>
- </target>
-
- <target name="update" depends="update.check, init">
+ <target name="update" depends="install">
<echo>

#----------------------------------------------------------------------------------
# Updating Ant. ${user.dir}/.ant/lib

Modified: development/main/home/standard.xml
==============================================================================
--- development/main/home/standard.xml (original)
+++ development/main/home/standard.xml Wed Feb 2 13:07:41 2005
@@ -232,6 +232,10 @@
<jar destfile="${target.deliverables.jars.dir}/${project.filename}"
basedir="${target.classes.dir}"
includes="**/*.class,**/*.xml,**/*.properties"/>
+
+ <!--
+ ADD MANIFEST
+ -->
<checksum fileext=".md5"
file="${target.deliverables.jars.dir}/${project.filename}"/>
</target>


Modified: development/main/home/transit/etc/project.module
==============================================================================
--- development/main/home/transit/etc/project.module (original)
+++ development/main/home/transit/etc/project.module Wed Feb 2 13:07:41
2005
@@ -35,6 +35,19 @@
</info>
</resource>

+ <resource key="dpml-transit-tools">
+ <info>
+ <group>dpml/transit</group>
+ <name>dpml-transit-tools</name>
+ <version>@PROJECT-VERSION@</version>
+ <type>jar</type>
+ </info>
+ <dependencies>
+ <include key="dpml-transit-main"/>
+ <include key="ant"/>
+ </dependencies>
+ </resource>
+
<resource key="dpml-transit-plugin">
<info>
<group>dpml/transit</group>
@@ -52,6 +65,15 @@
</dependencies>
</resource>

+ <resource key="ant">
+ <info>
+ <group>ant</group>
+ <name>ant</name>
+ <version>1.6.2</version>
+ <type>jar</type>
+ </info>
+ </resource>
+
</resources>

</module>

Modified:
development/main/home/transit/tools/src/main/net/dpml/transit/antlib.xml
==============================================================================
--- development/main/home/transit/tools/src/main/net/dpml/transit/antlib.xml
(original)
+++ development/main/home/transit/tools/src/main/net/dpml/transit/antlib.xml
Wed Feb 2 13:07:41 2005
@@ -3,4 +3,5 @@
<taskdef name="init" classname="net.dpml.transit.tools.MainTask"/>
<taskdef name="plugin" classname="net.dpml.transit.tools.PluginTask"/>
<taskdef name="import"
classname="net.dpml.transit.tools.ImportArtifactTask"/>
+ <taskdef name="get" classname="net.dpml.transit.tools.GetTask"/>
</antlib>

Added:
development/main/home/transit/tools/src/main/net/dpml/transit/tools/GetTask.java
==============================================================================
--- (empty file)
+++
development/main/home/transit/tools/src/main/net/dpml/transit/tools/GetTask.java
Wed Feb 2 13:07:41 2005
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2005 Stephen 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.transit.tools;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+
+import net.dpml.transit.artifact.Handler;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+
+/**
+ * The get task handles the retrival of a rresource and the binding of the
resource filename
+ * to a project property.
+ *
+ * @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
+ * @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
+ */
+public class GetTask extends org.apache.tools.ant.Task
+{
+ /**
+ * The uri of the artifact to load.
+ */
+ private String m_uri;
+
+ /**
+ * The name of a property under which the locally cached artifact
filename will be bound.
+ */
+ private String m_name;
+
+
+ /**
+ * Set the artifact uri of the plugin from which the task is to be loaded.
+ * @param uri an artifact plugin uri
+ */
+ public void setUri( String uri )
+ {
+ m_uri = uri;
+ }
+
+ /**
+ * Set the artifact uri of the plugin from which the task is to be loaded.
+ * @param uri an artifact plugin uri
+ */
+ public void setProperty( String name )
+ {
+ m_name = name;
+ }
+
+ /**
+ * Return the artifact uri of the plugin.
+ * @return the plugin uri
+ */
+ public URI getURI()
+ {
+ try
+ {
+ return new URI( m_uri.toString() );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Cound not convert the supplied uri spec ["
+ + m_uri
+ + "] to a formal URI.";
+ throw new BuildException( error, e, getLocation() );
+ }
+ }
+
+ /**
+ * Return the artifact uri of the plugin.
+ * @return the plugin uri
+ */
+ public String getPropertyName()
+ {
+ if( null == m_name )
+ {
+ final String error =
+ "The required 'property' attribute is not declared.";
+ throw new BuildException( error, getLocation() );
+ }
+ else
+ {
+ return m_name;
+ }
+ }
+
+ /**
+ * Load the plugin and handle registration of listeners, tasks, and antlib
+ * declarations based on the nested nested task directives.
+ * @exception BuildException if an error occurs during plugin loading or
deployment
+ */
+ public void execute() throws BuildException
+ {
+ if( null == m_uri )
+ {
+ final String error =
+ "Missing uri attribute.";
+ throw new BuildException( error, getLocation() );
+ }
+
+ String name = getPropertyName();
+
+ try
+ {
+ String spec = getURI().toString();
+ URL url = new URL( (URL) null, spec, new Handler() );
+ File file = (File) url.getContent( new Class[]{ File.class } );
+ getProject().setNewProperty( name, file.getAbsolutePath() );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Unexpected error while attempting to resolve artifact uri ["
+ + m_uri;
+ throw new BuildException( error, e, getLocation() );
+ }
+ }
+
+}



  • svn commit: r1698 - in development/main/home: . transit/etc transit/tools/src/main/net/dpml/transit transit/tools/src/main/net/dpml/transit/tools, mcconnell, 02/02/2005

Archive powered by MHonArc 2.6.24.

Top of Page