notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r1604 - in trunk/main/depot/tools/builder/src/main/net/dpml/tools: impl tasks
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r1604 - in trunk/main/depot/tools/builder/src/main/net/dpml/tools: impl tasks
- Date: Wed, 19 Jul 2006 19:27:06 +0200
Author: mcconnell
Date: 2006-07-19 19:26:57 +0200 (Wed, 19 Jul 2006)
New Revision: 1604
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/DefaultContext.java
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/GenericTask.java
Log:
enhancements to error handling
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-07-19 17:00:59 UTC (rev 1603)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/DefaultContext.java
2006-07-19 17:26:57 UTC (rev 1604)
@@ -33,6 +33,7 @@
import net.dpml.library.Type;
import net.dpml.library.Filter;
import net.dpml.library.impl.DefaultLibrary;
+import net.dpml.library.ResourceNotFoundException;
import net.dpml.tools.info.ListenerDirective;
@@ -668,24 +669,11 @@
}
}
- private static Resource newResource( File basedir )
+ private static Resource newResource( File basedir ) throws Exception
{
- try
- {
- Logger logger = new DefaultLogger();
- DefaultLibrary library = new DefaultLibrary( logger );
- return library.locate( basedir.getCanonicalFile() );
- }
- catch( BuildException e )
- {
- throw e;
- }
- catch( Exception ioe )
- {
- final String error =
- "Unexpected error while attempting to construct project
context.";
- throw new RuntimeException( error, ioe );
- }
+ Logger logger = new DefaultLogger();
+ DefaultLibrary library = new DefaultLibrary( logger );
+ return library.locate( basedir.getCanonicalFile() );
}
private static String flatternDependencies( String[] deps )
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/GenericTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/GenericTask.java
2006-07-19 17:00:59 UTC (rev 1603)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/GenericTask.java
2006-07-19 17:26:57 UTC (rev 1604)
@@ -20,11 +20,13 @@
import java.io.File;
+
import net.dpml.tools.Context;
import net.dpml.tools.impl.DefaultContext;
import net.dpml.library.Library;
import net.dpml.library.Resource;
+import net.dpml.library.ResourceNotFoundException;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
@@ -146,24 +148,22 @@
try
{
return new DefaultContext( project );
- //Resource resource = context.getResource();
- //String name = resource.getName();
- //String version = resource.getVersion();
- //project.log(
"\n-------------------------------------------------------------------------"
);
- //project.log( name + "#" + version );
- //project.log(
"-------------------------------------------------------------------------" );
- //project.addReference( "project.context", context );
- //return context;
}
+ catch( ResourceNotFoundException e )
+ {
+ final String message = e.getMessage();
+ final String error = "Resource not found: " + message;
+ throw new BuildException( error, e, getLocation() );
+ }
catch( BuildException e )
{
throw e;
}
- catch( Exception ioe )
+ catch( Exception e )
{
final String error =
"Unexpected error while attempting to construct project
context.";
- throw new RuntimeException( error, ioe );
+ throw new RuntimeException( error, e );
}
}
}
- r1604 - in trunk/main/depot/tools/builder/src/main/net/dpml/tools: impl tasks, mcconnell at BerliOS, 07/19/2006
Archive powered by MHonArc 2.6.24.