Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2420 - in development/main/magic/core/src/main/net/dpml/magic: . builder model project

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: peter AT neubauer.se
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2420 - in development/main/magic/core/src/main/net/dpml/magic: . builder model project
  • Date: Tue, 26 Apr 2005 15:20:20 -0400

Author: peter AT neubauer.se
Date: Tue Apr 26 15:20:19 2005
New Revision: 2420

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

development/main/magic/core/src/main/net/dpml/magic/builder/IndexBuilder.java
development/main/magic/core/src/main/net/dpml/magic/model/Resource.java

development/main/magic/core/src/main/net/dpml/magic/project/ProjectPath.java
Log:
more debugging for build index error, formatting


Modified: development/main/magic/core/src/main/net/dpml/magic/Index.java
==============================================================================
--- development/main/magic/core/src/main/net/dpml/magic/Index.java
(original)
+++ development/main/magic/core/src/main/net/dpml/magic/Index.java Tue
Apr 26 15:20:19 2005
@@ -21,28 +21,22 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
-import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Hashtable;

import net.dpml.lang.NullArgumentException;
-
import net.dpml.magic.builder.ElementHelper;
import net.dpml.magic.builder.IndexBuilder;
import net.dpml.magic.builder.XMLDefinitionBuilder;
-
import net.dpml.magic.model.Definition;
+import net.dpml.magic.model.Info;
+import net.dpml.magic.model.Module;
import net.dpml.magic.model.Resource;
import net.dpml.magic.model.ResourceRef;
-import net.dpml.magic.model.Module;
-import net.dpml.magic.model.Info;
-
import net.dpml.transit.Transit;
import net.dpml.transit.TransitException;
-
import net.dpml.transit.artifact.Handler;
-
import net.dpml.transit.repository.Repository;
import net.dpml.transit.repository.StandardLoader;

@@ -51,12 +45,8 @@
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Property;
import org.apache.tools.ant.types.DataType;
-
import org.w3c.dom.Element;

-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
/**
* A Index is an immutable data object that aggregates a suite of buildable
* project defintions relative to local and external dependencies.
@@ -94,15 +84,15 @@

/**
* Creation of a new home using a supplied index.
- * @param project the ant project establishing the home
+ * @param proj the ant project establishing the home
* @param system the magic system instance
* @param index the magic project index
* @exception NullArgumentException if any of the supplied arguments are
null.
*/
- public Index( Project project, IndexBuilder system, File index )
+ public Index( Project proj, IndexBuilder system, File index )
throws TransitException, NullArgumentException
{
- if( null == project )
+ if( null == proj )
{
throw new NullArgumentException( "project" );
}
@@ -117,7 +107,7 @@
throw new NullArgumentException( "index" );
}

- setProject( project );
+ setProject( proj );

if( !index.exists() )
{
@@ -131,10 +121,10 @@

final File user = new File( System.getProperty( "user.home" ) );
final File props = new File( user, "magic.properties" );
- loadProperties( project, props );
+ loadProperties( proj, props );

File base = m_index.getParentFile();
- processModuleProperties( project, base );
+ processModuleProperties( proj, base );

//
// load the initial context
@@ -142,22 +132,22 @@

m_repository = new StandardLoader();
File home = getHomeDirectory();
- if( null == project.getProperty( HOME_KEY ) )
+ if( null == proj.getProperty( HOME_KEY ) )
{
- project.setNewProperty( HOME_KEY, home.getAbsolutePath() );
+ proj.setNewProperty( HOME_KEY, home.getAbsolutePath() );
}
File magic = new File( home, "magic.properties" );
- loadProperties( project, magic );
+ loadProperties( proj, magic );

//
// load the system wide properties
//

File siteUserProperties = new File( Transit.DPML_PREFS,
"magic/user.properties" );
- loadProperties( project, siteUserProperties );
+ loadProperties( proj, siteUserProperties );

File siteProperties = new File( Transit.DPML_PREFS,
"magic/magic.properties" );
- loadProperties( project, siteProperties );
+ loadProperties( proj, siteProperties );

//
// build the index
@@ -168,16 +158,16 @@
log( "Resources: " + n, Project.MSG_VERBOSE );
}

- private void processModuleProperties( Project project, File base )
+ private void processModuleProperties( Project proj, File base )
{
if( null == base )
{
return;
}
File module = new File( base, "module.properties" );
- loadProperties( project, module );
+ loadProperties( proj, module );
File parent = base.getParentFile();
- processModuleProperties( project, parent );
+ processModuleProperties( proj, parent );
}

//-------------------------------------------------------------
@@ -295,9 +285,9 @@
* definition.
* @return TRUE is the resource is a definition
*/
- public boolean isaDefinition( final ResourceRef ref )
+ public boolean isaDefinition( final ResourceRef reference )
{
- return ( getResource( ref ) instanceof Definition );
+ return ( getResource( reference ) instanceof Definition );
}

/**
@@ -403,8 +393,8 @@
public Resource getResource( final String key )
throws BuildException
{
- final ResourceRef ref = new ResourceRef( key );
- return getResource( ref );
+ final ResourceRef reference = new ResourceRef( key );
+ return getResource( reference );
}

/**
@@ -412,10 +402,10 @@
* @return the resource mathing the reference
* @exception BuildException if the resource is unknown
*/
- public Resource getResource( final ResourceRef ref )
+ public Resource getResource( final ResourceRef reference )
throws BuildException
{
- final String key = ref.getKey();
+ final String key = reference.getKey();
final Resource resource = (Resource) m_resources.get( key );
if( null == resource )
{
@@ -432,8 +422,8 @@
public Definition getDefinition( final String key )
throws BuildException
{
- final ResourceRef ref = new ResourceRef( key );
- return getDefinition( ref );
+ final ResourceRef reference = new ResourceRef( key );
+ return getDefinition( reference );
}

/**
@@ -441,10 +431,10 @@
* @return the definition mathing the reference
* @exception BuildException if the definition is unknown
*/
- public Definition getDefinition( final ResourceRef ref )
+ public Definition getDefinition( final ResourceRef reference )
throws BuildException
{
- final Resource resource = getResource( ref );
+ final Resource resource = getResource( reference );
if( resource instanceof Definition )
{
return (Definition) resource;
@@ -452,7 +442,7 @@
else
{
final String error =
- "Reference [" + ref + "] does not refer to a projects.";
+ "Reference [" + reference + "] does not refer to a projects.";
throw new BuildException( error );
}
}
@@ -787,10 +777,10 @@
|| "project".equals( tag ) );
}

- protected void loadProperties( final Project project, final File file )
+ protected void loadProperties( final Project proj, final File file )
throws BuildException
{
- final Property props = (Property) project.createTask( "property" );
+ final Property props = (Property) proj.createTask( "property" );
props.init();
props.setFile( file );
props.execute();

Modified:
development/main/magic/core/src/main/net/dpml/magic/builder/IndexBuilder.java
==============================================================================
---
development/main/magic/core/src/main/net/dpml/magic/builder/IndexBuilder.java
(original)
+++
development/main/magic/core/src/main/net/dpml/magic/builder/IndexBuilder.java
Tue Apr 26 15:20:19 2005
@@ -69,14 +69,14 @@
// constructor
//-------------------------------------------------------------

- public IndexBuilder( final Project project ) throws BuildException
+ public IndexBuilder( final Project proj ) throws BuildException
{
- this( project, null );
+ this( proj, null );
}

- public IndexBuilder( final Project project, File index ) throws
BuildException
+ public IndexBuilder( final Project proj, File index ) throws
BuildException
{
- setProject( project );
+ setProject( proj );

log( "magic builder established", Project.MSG_VERBOSE );

@@ -84,37 +84,39 @@

if( null == m_signature )
{
- project.setProperty( BUILD_SIGNATURE_KEY, "SNAPSHOT" );
+ proj.setProperty( BUILD_SIGNATURE_KEY, "SNAPSHOT" );
}
else
{
- project.setProperty( BUILD_SIGNATURE_KEY, m_signature );
+ proj.setProperty( BUILD_SIGNATURE_KEY, m_signature );
log( "release: " + m_signature, Project.MSG_VERBOSE );
}

if( null == index )
{
log( "locating index", Project.MSG_VERBOSE );
- File file = getIndexFile( project );
- m_index = constructIndex( project, file );
+ File file = getIndexFile( proj );
+ m_index = constructIndex( proj, file );
}
else
{
- m_index = constructIndex( project, index );
+ m_index = constructIndex( proj, index );
}
}

- private Index constructIndex( Project project, File file )
+ private Index constructIndex( Project proj, File file )
{
try
{
- return new Index( project, this, file );
+ return new Index( proj, this, file );
}
catch( Throwable e )
{
e.printStackTrace();
final String error =
- "Internal error while attempting to construct index.";
+ "Internal error while attempting to construct index."+
+ "file:" + file.getAbsolutePath() +
+ "project:" + proj.toString();
throw new BuildException( error );
}
}
@@ -171,9 +173,9 @@
}
}

- private File getIndexFile( Project project )
+ private File getIndexFile( Project proj )
{
- File basedir = project.getBaseDir();
+ File basedir = proj.getBaseDir();
return resolve( basedir, true );
}


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
Tue Apr 26 15:20:19 2005
@@ -17,23 +17,21 @@

package net.dpml.magic.model;

-import net.dpml.lang.NullArgumentException;
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;

+import net.dpml.lang.NullArgumentException;
import net.dpml.magic.Index;
import net.dpml.magic.UnknownResourceException;
import net.dpml.transit.artifact.Handler;
-import net.dpml.lang.NullArgumentException;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Path;

-import java.io.File;
-import java.net.URL;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* Defintion of a resource.
*

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
Tue Apr 26 15:20:19 2005
@@ -58,11 +58,11 @@
/**
* Creation of a new path relative to a supplied project.
*
- * @param project the current ant project
+ * @param proj the current ant project
*/
- public ProjectPath( Project project )
+ public ProjectPath( Project proj )
{
- super( project );
+ super( proj );
}

/**



  • svn commit: r2420 - in development/main/magic/core/src/main/net/dpml/magic: . builder model project, peter, 04/26/2005

Archive powered by MHonArc 2.6.24.

Top of Page