maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r759482 - in /maven/components/trunk/maven-project-builder/src: main/java/org/apache/maven/project/builder/ main/java/org/apache/maven/project/processor/ test/java/org/apache/maven/project/processor/
Date Sat, 28 Mar 2009 15:16:42 GMT
Author: sisbell
Date: Sat Mar 28 15:16:40 2009
New Revision: 759482

URL: http://svn.apache.org/viewvc?rev=759482&view=rev
Log:
Descriptions inherited. Modified API to add listeners to processors. Still need to modify
the listener API as weell.

Removed:
    maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/ModelNodeProcessor.java
Modified:
    maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/BuildProcessor.java
    maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ModelProcessor.java
    maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ProcessorContext.java
    maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/processor/ModelProcessorTest.java

Modified: maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/BuildProcessor.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/BuildProcessor.java?rev=759482&r1=759481&r2=759482&view=diff
==============================================================================
--- maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/BuildProcessor.java
(original)
+++ maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/BuildProcessor.java
Sat Mar 28 15:16:40 2009
@@ -25,20 +25,29 @@
 
 import org.apache.maven.model.Build;
 import org.apache.maven.model.BuildBase;
-import org.apache.maven.model.Dependency;
 import org.apache.maven.model.Extension;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.model.PluginManagement;
 import org.apache.maven.model.Resource;
+import org.apache.maven.shared.model.ModelEventListener;
 
 public class BuildProcessor
     extends BaseProcessor
 {
+	private List<ModelEventListener> listeners;
+	
     public BuildProcessor( Collection<Processor> processors )
     {
         super( processors );
-    }
+        listeners = new ArrayList<ModelEventListener>();
+    }    
+    
+    public BuildProcessor( Collection<Processor> processors, List<ModelEventListener>
listeners)
+    {
+        super( processors );
+        listeners = (listeners == null) ? new ArrayList<ModelEventListener>() : new
ArrayList<ModelEventListener>(listeners);
+    }     
     
     public void processWithProfile( BuildBase build, Model target )    
     {

Modified: maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ModelProcessor.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ModelProcessor.java?rev=759482&r1=759481&r2=759482&view=diff
==============================================================================
--- maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ModelProcessor.java
(original)
+++ maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ModelProcessor.java
Sat Mar 28 15:16:40 2009
@@ -106,9 +106,13 @@
         if ( isChildMostSpecialized )
         {
             t.setName( c.getName() );
-            t.setDescription( c.getDescription() );
         }
-
+        
+        if(c.getDescription() != null)
+        {
+        	t.setDescription( c.getDescription() );	
+        }
+                
         if ( c.getInceptionYear() != null )
         {
             t.setInceptionYear( c.getInceptionYear() );

Modified: maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ProcessorContext.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ProcessorContext.java?rev=759482&r1=759481&r2=759482&view=diff
==============================================================================
--- maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ProcessorContext.java
(original)
+++ maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ProcessorContext.java
Sat Mar 28 15:16:40 2009
@@ -51,6 +51,7 @@
 import org.apache.maven.project.builder.ProjectUri;
 import org.apache.maven.shared.model.DomainModel;
 import org.apache.maven.shared.model.InterpolatorProperty;
+import org.apache.maven.shared.model.ModelEventListener;
 import org.apache.maven.shared.model.ModelProperty;
 import org.apache.maven.shared.model.ModelTransformerContext;
 import org.codehaus.plexus.util.WriterFactory;
@@ -169,18 +170,11 @@
 
         return models;
     }
-    
-    /**
-     * Parent domain models on bottom.
-     * 
-     * @param domainModels
-     * @return
-     * @throws IOException
-     */
+
     public static PomClassicDomainModel build( List<DomainModel> domainModels,
-                                               List<InterpolatorProperty> interpolationProperties
)
-        throws IOException
-    {  
+            List<InterpolatorProperty> interpolationProperties, List<ModelEventListener>
listeners)
+	throws IOException
+	{  
         PomClassicDomainModel child = null;
         for ( DomainModel domainModel : domainModels )
         {   
@@ -223,7 +217,20 @@
         {
             modelProperties = model.getModelProperties();
         }
-        return new PomClassicDomainModel( modelProperties );
+        return new PomClassicDomainModel( modelProperties );	    	
+	}
+    /**
+     * Parent domain models on bottom.
+     * 
+     * @param domainModels
+     * @return
+     * @throws IOException
+     */
+    public static PomClassicDomainModel build( List<DomainModel> domainModels,
+                                               List<InterpolatorProperty> interpolationProperties
)
+        throws IOException
+    {  
+    	return build(domainModels, interpolationProperties, null);
     }
     
     private static Model processModelsForInheritance(List<Model> models, List<Processor>
processors)

Modified: maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/processor/ModelProcessorTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/processor/ModelProcessorTest.java?rev=759482&r1=759481&r2=759482&view=diff
==============================================================================
--- maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/processor/ModelProcessorTest.java
(original)
+++ maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/processor/ModelProcessorTest.java
Sat Mar 28 15:16:40 2009
@@ -117,17 +117,6 @@
         assertEquals( "description", targetModel.getDescription() );
     }
 
-    public void testDescriptionNotSpecialized()
-    {
-        Model targetModel = new Model();
-        Model childModel = new Model();
-        childModel.setDescription( "description" );
-
-        ModelProcessor mp = new ModelProcessor( new ArrayList<Processor>() );
-        mp.process( null, childModel, targetModel, false );
-        assertNull( targetModel.getDescription() );
-    }
-
     public void testInceptionYearFromChild()
     {
         Model targetModel = new Model();



Mime
View raw message