incubator-easyant-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1382307 - in /incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks: AbstractImport.java Import.java
Date Sat, 08 Sep 2012 14:14:42 GMT
Author: jlboudart
Date: Sat Sep  8 14:14:42 2012
New Revision: 1382307

URL: http://svn.apache.org/viewvc?rev=1382307&view=rev
Log:
Make changing option configurable on import

Modified:
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/AbstractImport.java
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/Import.java

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/AbstractImport.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/AbstractImport.java?rev=1382307&r1=1382306&r2=1382307&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/AbstractImport.java
(original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/AbstractImport.java
Sat Sep  8 14:14:42 2012
@@ -14,7 +14,6 @@ import org.apache.tools.ant.Project;
 import org.apache.tools.ant.taskdefs.ImportTask;
 import org.apache.tools.ant.types.Path;
 
-
 /**
  * This abstract task is used to include / import modules.
  * 
@@ -37,6 +36,7 @@ public abstract class AbstractImport ext
     private String buildConfigurations;
     private String mainConf = "default";
     private String providedConf = "provided";
+    private boolean changing = false;
 
     public AbstractImport() {
         super();
@@ -45,11 +45,12 @@ public abstract class AbstractImport ext
     /**
      * Import a module
      * 
-     * @param moduleRevisionId {@link ModuleRevisionId} of main artifact
+     * @param moduleRevisionId
+     *            {@link ModuleRevisionId} of main artifact
      * @param report
      *            a resolved report of the module to import
      */
-    protected void importModule(ModuleRevisionId moduleRevisionId,ResolveReport report) {
+    protected void importModule(ModuleRevisionId moduleRevisionId, ResolveReport report)
{
         // Check dependency on core
         checkCoreCompliance(report, providedConf);
 
@@ -63,7 +64,8 @@ public abstract class AbstractImport ext
             } else if ("jar".equals(artifact.getType())) {
                 path.createPathElement().setLocation(artifact.getLocalFile());
             } else {
-                handleOtherResourceFile(moduleRevisionId, artifact.getName(), artifact.getExt(),
artifact.getLocalFile());
+                handleOtherResourceFile(moduleRevisionId, artifact.getName(), artifact.getExt(),
+                        artifact.getLocalFile());
             }
         }
         if (antFile != null && antFile.exists()) {
@@ -105,12 +107,16 @@ public abstract class AbstractImport ext
      * The '.artifact' is optional when module name and artifact name are the same. [organisation].[module].[type].file
      * </p>
      * 
-     * @param moduleRevisionId a {@link ModuleRevisionId} of the main artifact
-     * @param artifactName artifact name
-     * @param artifactExtension artifact extension name
+     * @param moduleRevisionId
+     *            a {@link ModuleRevisionId} of the main artifact
+     * @param artifactName
+     *            artifact name
+     * @param artifactExtension
+     *            artifact extension name
      * @param localResourceFile
      */
-    protected void handleOtherResourceFile(ModuleRevisionId moduleRevisionId, String artifactName,
String artifactExtension, File localResourceFile) {
+    protected void handleOtherResourceFile(ModuleRevisionId moduleRevisionId, String artifactName,
+            String artifactExtension, File localResourceFile) {
         StringBuilder sb = new StringBuilder();
         sb.append(moduleRevisionId.getOrganisation());
         sb.append("#");
@@ -123,7 +129,9 @@ public abstract class AbstractImport ext
         sb.append(artifactExtension);
         sb.append(".file");
 
-        getProject().log("registering location of artifact " + artifactName + " ext" + artifactExtension
+ " on " +sb.toString(),Project.MSG_DEBUG);
+        getProject().log(
+                "registering location of artifact " + artifactName + " ext" + artifactExtension
+ " on "
+                        + sb.toString(), Project.MSG_DEBUG);
 
         getProject().setNewProperty(sb.toString(), localResourceFile.getAbsolutePath());
     }
@@ -320,4 +328,12 @@ public abstract class AbstractImport ext
 
     }
 
+    public boolean isChanging() {
+        return changing;
+    }
+
+    public void setChanging(boolean changing) {
+        this.changing = changing;
+    }
+
 }
\ No newline at end of file

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/Import.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/Import.java?rev=1382307&r1=1382306&r2=1382307&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/Import.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/Import.java Sat Sep
 8 14:14:42 2012
@@ -97,7 +97,7 @@ public class Import extends AbstractImpo
         } else {
             try {
                 ResolveReport report = getEasyAntIvyInstance().getResolveEngine().resolve(moduleRevisionId,
-                        configureResolveOptions(), true);
+                        configureResolveOptions(), isChanging());
                 importModule(moduleRevisionId,report);
             } catch (ParseException e) {
                 throw new BuildException("Can't parse module descriptor", e);
@@ -203,4 +203,5 @@ public class Import extends AbstractImpo
     public void setMrid(String mrid) {
         this.mrid = mrid;
     }
+    
 }



Mime
View raw message