ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1480665 - in /ant/easyant/core/trunk/src/main/java/org/apache/easyant: core/EasyAntMagicNames.java tasks/SubModule.java
Date Thu, 09 May 2013 14:31:00 GMT
Author: jlboudart
Date: Thu May  9 14:31:00 2013
New Revision: 1480665

URL: http://svn.apache.org/r1480665
Log:
set submodule property when running subprojects, it can be used by plugins to trigger different
behavior on submodules

Modified:
    ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMagicNames.java
    ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java

Modified: ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMagicNames.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMagicNames.java?rev=1480665&r1=1480664&r2=1480665&view=diff
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMagicNames.java (original)
+++ ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntMagicNames.java Thu
May  9 14:31:00 2013
@@ -118,6 +118,9 @@ public interface EasyAntMagicNames {
      */
     public static final String EASYANT_BUILD_REPOSITORY = "easyant.build.repository";
 
+    /**
+     * Name of the property containing agregator target directory
+     */
     public static final String META_TARGET = "meta.target";
 
     /**
@@ -185,4 +188,9 @@ public interface EasyAntMagicNames {
      * Name of EasyAntEngine reference
      */
     public static final String EASYANT_ENGINE_REF = "easyant.engine.ref";
+
+    /**
+     * Name of the property telling if we are in a submodule
+     */
+    public static final String SUBMODULE = "submodule";
 }

Modified: ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java?rev=1480665&r1=1480664&r2=1480665&view=diff
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java (original)
+++ ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SubModule.java Thu May 
9 14:31:00 2013
@@ -262,6 +262,8 @@ public class SubModule extends AbstractE
     private Project configureSubModule(File file, File directory) {
         Project subModule = getProject().createSubProject();
 
+        subModule.setNewProperty(EasyAntMagicNames.SUBMODULE, "true");
+
         subModule.setJavaVersionProperty();
         for (int i = 0; i < getProject().getBuildListeners().size(); i++) {
             BuildListener buildListener = (BuildListener) getProject().getBuildListeners().elementAt(i);
@@ -274,10 +276,10 @@ public class SubModule extends AbstractE
         // copy all User properties
         addAlmostAll(getProject().getUserProperties(), subModule, PropertyType.USER);
         // inherit meta.target directory, for shared build repository.
-        String metaTarget = getProject().getProperty("meta.target");
+        String metaTarget = getProject().getProperty(EasyAntMagicNames.META_TARGET);
         if (metaTarget != null) {
             File metaDir = getProject().resolveFile(metaTarget);
-            subModule.setNewProperty("meta.target", metaDir.getAbsolutePath());
+            subModule.setNewProperty(EasyAntMagicNames.META_TARGET, metaDir.getAbsolutePath());
         }
         // inherit easyant offline base
         String offlineBaseDir = getProject().getProperty(EasyAntMagicNames.OFFLINE_BASE_DIRECTORY);



Mime
View raw message