incubator-easyant-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1415526 - in /incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks: AbstractEasyAntTask.java LoadModule.java SubModule.java
Date Fri, 30 Nov 2012 07:41:25 GMT
Author: jlboudart
Date: Fri Nov 30 07:41:24 2012
New Revision: 1415526

URL: http://svn.apache.org/viewvc?rev=1415526&view=rev
Log:
Inherit OFFLINE_BASE_DIRECTORY from root project

Modified:
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/AbstractEasyAntTask.java
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/LoadModule.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/tasks/AbstractEasyAntTask.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/AbstractEasyAntTask.java?rev=1415526&r1=1415525&r2=1415526&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
Fri Nov 30 07:41:24 2012
@@ -78,7 +78,10 @@ public class AbstractEasyAntTask extends
     }
 
     protected EasyAntEngine getEasyAntEngine() {
-        return (EasyAntEngine) getProject().getReference(EasyAntMagicNames.EASYANT_ENGINE_REF);
+        EasyAntEngine easyAntEngine = (EasyAntEngine) getProject().getReference(EasyAntMagicNames.EASYANT_ENGINE_REF);
+        if (easyAntEngine == null) {
+            easyAntEngine = new EasyAntEngine();
+        }
+        return easyAntEngine;
     }
-
-}
+}
\ No newline at end of file

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=1415526&r1=1415525&r2=1415526&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 Fri
Nov 30 07:41:24 2012
@@ -150,9 +150,10 @@ public class LoadModule extends Abstract
         // to easyant ivy instance
         if (!EasyAntMagicNames.EASYANT_IVY_INSTANCE.equals(projectIvyInstanceProp)) {
             configureProjectIvyinstance(projectIvyInstanceProp);
-            configureProjectOfflineResolver();
         }
 
+        configureProjectOfflineResolver();
+
         if (shouldUseBuildRepository()) {
             configureBuildRepository(IvyInstanceHelper.getProjectIvyAntSettings(getProject()));
         }
@@ -170,16 +171,22 @@ public class LoadModule extends Abstract
      *            {@link Project} where repository will be configured
      */
     private void configureProjectOfflineResolver() {
-        getProject().setProperty(EasyAntMagicNames.OFFLINE_PROJECT_RESOLVER,
-                EasyAntConstants.DEFAULT_OFFLINE_PROJECT_RESOLVER);
-        ConfigureBuildScopedRepository projectOfflineRepository = new ConfigureBuildScopedRepository();
-        projectOfflineRepository.setGenerateWrapperResoler(false);
-        projectOfflineRepository.setName(getProject().getProperty(EasyAntMagicNames.OFFLINE_PROJECT_RESOLVER));
-        projectOfflineRepository.setDictator(Project.toBoolean(getProject().getProperty(
-                EasyAntMagicNames.EASYANT_OFFLINE)));
-        projectOfflineRepository.setSettingsRef(IvyInstanceHelper.buildProjectIvyReference(getProject()));
-        projectOfflineRepository.setTarget(getProject().getProperty(EasyAntMagicNames.OFFLINE_BASE_DIRECTORY));
-        initTask(projectOfflineRepository).execute();
+        if (EasyAntMagicNames.EASYANT_IVY_INSTANCE.equals(IvyInstanceHelper.getProjectIvyInstanceName(getProject())))
{
+            getProject().setProperty(EasyAntMagicNames.OFFLINE_PROJECT_RESOLVER,
+                    getProject().getProperty(EasyAntMagicNames.OFFLINE_EASYANT_RESOLVER));
+        } else {
+
+            getProject().setProperty(EasyAntMagicNames.OFFLINE_PROJECT_RESOLVER,
+                    EasyAntConstants.DEFAULT_OFFLINE_PROJECT_RESOLVER);
+            ConfigureBuildScopedRepository projectOfflineRepository = new ConfigureBuildScopedRepository();
+            projectOfflineRepository.setGenerateWrapperResoler(false);
+            projectOfflineRepository.setName(getProject().getProperty(EasyAntMagicNames.OFFLINE_PROJECT_RESOLVER));
+            projectOfflineRepository.setDictator(Project.toBoolean(getProject().getProperty(
+                    EasyAntMagicNames.EASYANT_OFFLINE)));
+            projectOfflineRepository.setSettingsRef(IvyInstanceHelper.buildProjectIvyReference(getProject()));
+            projectOfflineRepository.setTarget(getProject().getProperty(EasyAntMagicNames.OFFLINE_BASE_DIRECTORY));
+            initTask(projectOfflineRepository).execute();
+        }
     }
 
     /**

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=1415526&r1=1415525&r2=1415526&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 Fri
Nov 30 07:41:24 2012
@@ -276,6 +276,11 @@ public class SubModule extends AbstractE
             File metaDir = getProject().resolveFile(metaTarget);
             subModule.setNewProperty("meta.target", metaDir.getAbsolutePath());
         }
+        // inherit easyant offline base
+        String offlineBaseDir = getProject().getProperty(EasyAntMagicNames.OFFLINE_BASE_DIRECTORY);
+        if (offlineBaseDir != null) {
+            subModule.setInheritedProperty(EasyAntMagicNames.OFFLINE_BASE_DIRECTORY, offlineBaseDir);
+        }
 
         subModule.initProperties();
 



Mime
View raw message