incubator-easyant-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1414967 - in /incubator/easyant/core/trunk/src/main/java/org/apache/easyant: core/EasyAntEngine.java core/EasyAntMagicNames.java tasks/AbstractEasyAntTask.java tasks/SubModule.java
Date Wed, 28 Nov 2012 22:22:58 GMT
Author: jlboudart
Date: Wed Nov 28 22:22:57 2012
New Revision: 1414967

URL: http://svn.apache.org/viewvc?rev=1414967&view=rev
Log:
Fix issue with easyant ivy instance in submodules
IvyInstance was shared with submodules and, we were retrieving wrong informations from root
level (like ivy.configurations)

Modified:
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMagicNames.java
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/AbstractEasyAntTask.java
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java?rev=1414967&r1=1414966&r2=1414967&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
(original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
Wed Nov 28 22:22:57 2012
@@ -400,6 +400,8 @@ public class EasyAntEngine {
      */
     public void initProject(Project project) {
         project.init();
+        project.addReference(EasyAntMagicNames.EASYANT_ENGINE_REF, this);
+
         // set user-define properties
         Enumeration<?> properties = configuration.getDefinedProps().propertyNames();
         while (properties.hasMoreElements()) {

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMagicNames.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMagicNames.java?rev=1414967&r1=1414966&r2=1414967&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMagicNames.java
(original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMagicNames.java
Wed Nov 28 22:22:57 2012
@@ -180,4 +180,9 @@ public interface EasyAntMagicNames {
      * Property specifying executed targets in current project
      */
     public static final String PROJECT_EXECUTED_TARGETS = "project.executed.targets";
+
+    /**
+     * Name of EasyAntEngine reference
+     */
+    public static final String EASYANT_ENGINE_REF = "easyant.engine.ref";
 }

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/AbstractEasyAntTask.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/AbstractEasyAntTask.java?rev=1414967&r1=1414966&r2=1414967&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/AbstractEasyAntTask.java
(original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/AbstractEasyAntTask.java
Wed Nov 28 22:22:57 2012
@@ -17,6 +17,8 @@
  */
 package org.apache.easyant.tasks;
 
+import org.apache.easyant.core.EasyAntEngine;
+import org.apache.easyant.core.EasyAntMagicNames;
 import org.apache.easyant.core.ivy.IvyInstanceHelper;
 import org.apache.ivy.Ivy;
 import org.apache.ivy.ant.IvyAntSettings;
@@ -75,4 +77,8 @@ public class AbstractEasyAntTask extends
         return IvyInstanceHelper.buildProjectIvyReference(getProject());
     }
 
+    protected EasyAntEngine getEasyAntEngine() {
+        return (EasyAntEngine) getProject().getReference(EasyAntMagicNames.EASYANT_ENGINE_REF);
+    }
+
 }

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java?rev=1414967&r1=1414966&r2=1414967&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java Wed
Nov 28 22:22:57 2012
@@ -35,7 +35,6 @@ import org.apache.easyant.core.ant.liste
 import org.apache.easyant.core.ant.listerners.MultiModuleLogger;
 import org.apache.easyant.core.ant.listerners.SubBuildExecutionTimer;
 import org.apache.easyant.core.ivy.IvyInstanceHelper;
-import org.apache.ivy.ant.IvyAntSettings;
 import org.apache.ivy.ant.IvyPublish;
 import org.apache.ivy.ant.IvyResolve;
 import org.apache.tools.ant.BuildException;
@@ -45,7 +44,6 @@ import org.apache.tools.ant.MagicNames;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.ProjectComponent;
 import org.apache.tools.ant.ProjectHelper;
-import org.apache.tools.ant.Task;
 import org.apache.tools.ant.taskdefs.Ant;
 import org.apache.tools.ant.taskdefs.Property;
 import org.apache.tools.ant.types.Path;
@@ -57,7 +55,7 @@ import org.apache.tools.ant.util.StringU
 /**
  * This task is used to manage orchestration of submodules.
  */
-public class SubModule extends Task {
+public class SubModule extends AbstractEasyAntTask {
 
     private boolean failOnError = true;
     private boolean verbose = false;
@@ -272,11 +270,6 @@ public class SubModule extends Task {
 
         // copy all User properties
         addAlmostAll(getProject().getUserProperties(), subModule, PropertyType.USER);
-
-        // copy easyantIvyInstance
-        IvyAntSettings ivyAntSettings = IvyInstanceHelper.getEasyAntIvyAntSettings(getProject());
-        subModule.addReference(EasyAntMagicNames.EASYANT_IVY_INSTANCE, ivyAntSettings);
-
         // inherit meta.target directory, for shared build repository.
         String metaTarget = getProject().getProperty("meta.target");
         if (metaTarget != null) {
@@ -294,6 +287,8 @@ public class SubModule extends Task {
         overrideProperties(subModule);
         addReferences(subModule);
 
+        getEasyAntEngine().configureEasyAntIvyInstance(subModule);
+
         subModule.setName(file.getName());
         subModule.setBaseDir(directory);
         return subModule;



Mime
View raw message