incubator-easyant-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1389520 - in /incubator/easyant/core/trunk/src/main/java/org/apache/easyant: core/parser/DefaultEasyAntXmlModuleDescriptorParser.java core/parser/EasyAntModuleDescriptorParser.java tasks/LoadModule.java
Date Mon, 24 Sep 2012 19:12:47 GMT
Author: jlboudart
Date: Mon Sep 24 19:12:47 2012
New Revision: 1389520

URL: http://svn.apache.org/viewvc?rev=1389520&view=rev
Log:
EasyAntMDParser shouldn't have to know activeBuildConfigurations : it's a parser

Modified:
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/DefaultEasyAntXmlModuleDescriptorParser.java
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/EasyAntModuleDescriptorParser.java
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/LoadModule.java

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/DefaultEasyAntXmlModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/DefaultEasyAntXmlModuleDescriptorParser.java?rev=1389520&r1=1389519&r2=1389520&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/DefaultEasyAntXmlModuleDescriptorParser.java
(original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/DefaultEasyAntXmlModuleDescriptorParser.java
Mon Sep 24 19:12:47 2012
@@ -28,7 +28,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.apache.easyant.core.BuildConfigurationHelper;
 import org.apache.easyant.core.EasyAntConstants;
 import org.apache.easyant.core.descriptor.AdvancedInheritableItem;
 import org.apache.easyant.core.descriptor.DefaultEasyAntDescriptor;
@@ -77,12 +76,6 @@ public class DefaultEasyAntXmlModuleDesc
 
     private EasyAntModuleDescriptor easyAntModuleDescriptor;
 
-    private String activeBuildConfigurations;
-
-    public void setActiveBuildConfigurations(String activeBuildConfigurations) {
-        this.activeBuildConfigurations = activeBuildConfigurations;
-    }
-
     public EasyAntModuleDescriptor getEasyAntModuleDescriptor() {
         return easyAntModuleDescriptor;
     }
@@ -274,9 +267,7 @@ public class DefaultEasyAntXmlModuleDesc
             handleInheritedScopeAttribute(attributes, plugin);
 
             currentPluginDescriptor = plugin;
-            if (BuildConfigurationHelper.contains(conf, activeBuildConfigurations)) {
-                easyAntModuleDescriptor.addPlugin(plugin);
-            }
+            easyAntModuleDescriptor.addPlugin(plugin);
 
             handlePropertyAsAttribute(attributes, conf);
         }
@@ -450,26 +441,24 @@ public class DefaultEasyAntXmlModuleDesc
                 conf = currentPluginDescriptor.getBuildConfigurations();
             }
 
-            if (BuildConfigurationHelper.contains(conf, activeBuildConfigurations)) {
-                // if bindtarget tag is a subelement and look if an alias was
-                // defined on the plugin
-                if (EasyAntState.PLUGIN == easyAntState && currentPluginDescriptor.getAs()
!= null) {
-                    // check if the fully qualified name was defined, if not get
-                    // the alias defined on the plugin
-                    if (!target.startsWith(currentPluginDescriptor.getAs())) {
-                        target = currentPluginDescriptor.getAs() + target;
-                    }
-
+            // if bindtarget tag is a subelement and look if an alias was
+            // defined on the plugin
+            if (EasyAntState.PLUGIN == easyAntState && currentPluginDescriptor.getAs()
!= null) {
+                // check if the fully qualified name was defined, if not get
+                // the alias defined on the plugin
+                if (!target.startsWith(currentPluginDescriptor.getAs())) {
+                    target = currentPluginDescriptor.getAs() + target;
                 }
-                // put this variable on the context
-                ExtensionPointMappingDescriptor extensionPointMappingDescriptor = new ExtensionPointMappingDescriptor();
-                extensionPointMappingDescriptor.setBuildConfigurations(conf);
-                // TODO: add a facility to get plugin alias if this is a
-                // declared as a subelement
-                extensionPointMappingDescriptor.setTarget(target);
-                extensionPointMappingDescriptor.setExtensionPoint(toExtensionPoint);
-                easyAntModuleDescriptor.addExtensionPointMapping(extensionPointMappingDescriptor);
+
             }
+            // put this variable on the context
+            ExtensionPointMappingDescriptor extensionPointMappingDescriptor = new ExtensionPointMappingDescriptor();
+            extensionPointMappingDescriptor.setBuildConfigurations(conf);
+            // TODO: add a facility to get plugin alias if this is a
+            // declared as a subelement
+            extensionPointMappingDescriptor.setTarget(target);
+            extensionPointMappingDescriptor.setExtensionPoint(toExtensionPoint);
+            easyAntModuleDescriptor.addExtensionPointMapping(extensionPointMappingDescriptor);
 
         }
 
@@ -505,20 +494,17 @@ public class DefaultEasyAntXmlModuleDesc
                     String key = (String) enumeration.nextElement();
                     String value = getSettings().substitute(props.getProperty(key));
 
-                    if (BuildConfigurationHelper.contains(conf, activeBuildConfigurations))
{
-                        // put this variable on the context
-                        IvyContext.getContext().getSettings().getVariableContainer().setVariable(key,
value, true);
-                        PropertyDescriptor property = new PropertyDescriptor(key);
-                        property.setValue(value);
-                        property.setBuildConfigurations(conf);
-
-                        applyInheritableItemAttributesFromPlugin(property);
-                        // override with explicit inherited scope attributes
-                        handleInheritedScopeAttribute(attributes, property);
+                    // put this variable on the context
+                    IvyContext.getContext().getSettings().getVariableContainer().setVariable(key,
value, true);
+                    PropertyDescriptor property = new PropertyDescriptor(key);
+                    property.setValue(value);
+                    property.setBuildConfigurations(conf);
 
-                        easyAntModuleDescriptor.getProperties().put(key, property);
-                    }
+                    applyInheritableItemAttributesFromPlugin(property);
+                    // override with explicit inherited scope attributes
+                    handleInheritedScopeAttribute(attributes, property);
 
+                    easyAntModuleDescriptor.getProperties().put(key, property);
                 }
             } else {
                 if (attributes.getValue("name") == null) {
@@ -527,21 +513,17 @@ public class DefaultEasyAntXmlModuleDesc
                 String propertyName = getSettings().substitute(attributes.getValue("name"));
                 String value = getSettings().substitute(attributes.getValue("value"));
 
-                if (BuildConfigurationHelper.contains(conf, activeBuildConfigurations)) {
-                    // put this variable on the context
-                    IvyContext.getContext().getSettings().getVariableContainer().setVariable(propertyName,
value, true);
-                    PropertyDescriptor property = new PropertyDescriptor(propertyName, getMd().getModuleRevisionId());
-                    property.setValue(value);
-                    property.setBuildConfigurations(conf);
-
-                    applyInheritableItemAttributesFromPlugin(property);
-                    // override with explicit inherited scope attributes
-                    handleInheritedScopeAttribute(attributes, property);
-
-                    easyAntModuleDescriptor.getProperties().put(propertyName, property);
-
-                }
+                // put this variable on the context
+                IvyContext.getContext().getSettings().getVariableContainer().setVariable(propertyName,
value, true);
+                PropertyDescriptor property = new PropertyDescriptor(propertyName, getMd().getModuleRevisionId());
+                property.setValue(value);
+                property.setBuildConfigurations(conf);
+
+                applyInheritableItemAttributesFromPlugin(property);
+                // override with explicit inherited scope attributes
+                handleInheritedScopeAttribute(attributes, property);
 
+                easyAntModuleDescriptor.getProperties().put(propertyName, property);
             }
         }
 
@@ -608,9 +590,7 @@ public class DefaultEasyAntXmlModuleDesc
          */
         protected void mergeEasyantPlugins(List<PluginDescriptor> plugins) {
             for (PluginDescriptor plugin : plugins) {
-                if (plugin.isInheritable()
-                        && BuildConfigurationHelper
-                                .contains(plugin.getBuildConfigurations(), activeBuildConfigurations))
{
+                if (plugin.isInheritable()) {
                     StringBuilder sb = new StringBuilder("Merging plugin : ");
                     sb.append(plugin.toString());
                     if (plugin.getSourceModule() != null) {
@@ -632,8 +612,7 @@ public class DefaultEasyAntXmlModuleDesc
         protected void mergeEasyantProperties(Map<String, PropertyDescriptor> properties)
{
             for (Iterator<PropertyDescriptor> iterator = properties.values().iterator();
iterator.hasNext();) {
                 PropertyDescriptor prop = iterator.next();
-                if (prop.isInheritable()
-                        && BuildConfigurationHelper.contains(prop.getBuildConfigurations(),
activeBuildConfigurations)) {
+                if (prop.isInheritable()) {
                     IvyContext.getContext().getSettings().getVariableContainer()
                             .setVariable(prop.getName(), prop.getValue(), true);
                     StringBuilder sb = new StringBuilder("Merging property");

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/EasyAntModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/EasyAntModuleDescriptorParser.java?rev=1389520&r1=1389519&r2=1389520&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/EasyAntModuleDescriptorParser.java
(original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/EasyAntModuleDescriptorParser.java
Mon Sep 24 19:12:47 2012
@@ -22,8 +22,6 @@ import org.apache.ivy.plugins.parser.Mod
 
 public interface EasyAntModuleDescriptorParser extends ModuleDescriptorParser {
 
-    void setActiveBuildConfigurations(String activeBuildConfigurations);
-    
     EasyAntModuleDescriptor getEasyAntModuleDescriptor();
-    
+
 }

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/LoadModule.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/LoadModule.java?rev=1389520&r1=1389519&r2=1389520&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/LoadModule.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/LoadModule.java Mon
Sep 24 19:12:47 2012
@@ -254,7 +254,6 @@ public class LoadModule extends Abstract
         log("Loading EasyAnt module descriptor :" + parser.getClass().getName(), Project.MSG_DEBUG);
 
         try {
-            parser.setActiveBuildConfigurations(getProject().getProperty(EasyAntMagicNames.ACTIVE_BUILD_CONFIGURATIONS));
             parser.parseDescriptor(getEasyAntIvyInstance().getSettings(), buildModule.toURI().toURL(),
new URLResource(
                     buildModule.toURI().toURL()), true);
             EasyAntModuleDescriptor md = parser.getEasyAntModuleDescriptor();



Mime
View raw message