ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r601620 - in /ant/ivy/core/trunk/src/java/org/apache/ivy: ant/IvyMakePom.java plugins/parser/m2/PomModuleDescriptorWriter.java
Date Thu, 06 Dec 2007 05:27:49 GMT
Author: xavier
Date: Wed Dec  5 21:27:46 2007
New Revision: 601620

URL: http://svn.apache.org/viewvc?rev=601620&view=rev
Log:
- add headerfile attribute on makepom task to be able to add a license header
- replace <optional/> by <optional>true</optional>

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyMakePom.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyMakePom.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyMakePom.java?rev=601620&r1=601619&r2=601620&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyMakePom.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyMakePom.java Wed Dec  5 21:27:46 2007
@@ -30,8 +30,10 @@
 import org.apache.ivy.plugins.parser.m2.PomModuleDescriptorWriter;
 import org.apache.ivy.plugins.parser.m2.PomModuleDescriptorWriter.ConfigurationScopeMapping;
 import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser;
+import org.apache.ivy.util.FileUtil;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
+import org.apache.tools.ant.util.FileUtils;
 
 /**
  * Convert an ivy file to a pom
@@ -56,6 +58,8 @@
 
     private File pomFile = null;
 
+    private File headerFile = null;
+
     private File ivyFile = null;
 
     private Collection mappings = new ArrayList();
@@ -75,6 +79,14 @@
     public void setIvyFile(File ivyFile) {
         this.ivyFile = ivyFile;
     }
+
+    public File getHeaderFile() {
+        return headerFile;
+    }
+
+    public void setHeaderFile(File headerFile) {
+        this.headerFile = headerFile;
+    }
     
     public Mapping createMapping() {
         Mapping mapping = new Mapping();
@@ -92,7 +104,8 @@
             }
             ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(
                 getSettings(), ivyFile.toURL(), false);
-            PomModuleDescriptorWriter.write(md, 
+            PomModuleDescriptorWriter.write(md,
+                headerFile == null ? null : FileUtil.readEntirely(getHeaderFile()),
                 mappings.isEmpty() 
                     ? PomModuleDescriptorWriter.DEFAULT_MAPPING
                     : new ConfigurationScopeMapping(getMappingsMap()), pomFile);

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java?rev=601620&r1=601619&r2=601620&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java
Wed Dec  5 21:27:46 2007
@@ -109,7 +109,7 @@
                     out.println("      <scope>" + scope + "</scope>");
                 }
                 if (mapping.isOptional(dds[i].getModuleConfigurations())) {
-                    out.println("      <optional/>");
+                    out.println("      <optional>true</optional>");
                 }
                 out.println("    </dependency>");
             }



Mime
View raw message