Author: maartenc
Date: Fri Dec 7 15:54:54 2007
New Revision: 602278
URL: http://svn.apache.org/viewvc?rev=602278&view=rev
Log:
FIX: XmlModuleDescriptorWriter doesn't write the deprecated attribute of the "ivy-module/configurations/conf"
element (IVY-664)
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=602278&r1=602277&r2=602278&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Fri Dec 7 15:54:54 2007
@@ -61,7 +61,8 @@
- IMPROVEMENT: Decrease memory footprint (IVY-662)
-- FIX: XMLModuleDescriptorWriter does not write extra attributes (IVY-471) (thanks to Mikkel
Bjerg)
+- FIX: XmlModuleDescriptorWriter doesn't write the deprecated attribute of the "ivy-module/configurations/conf"
element (IVY-664)
+- FIX: XMLModuleDescriptorWriter does not write extra attributes (IVY-471) (with contribution
from Mikkel Bjerg)
- FIX: latest compatible conflict manager fails with circular dependencies and dynamic revision
(IVY-663)
- FIX: Strict conflictmanager seems to not support dynamic revisions (IVY-474)
- FIX: NPE in namespace transformation during the ivy:findrevision and ivy:resolve task execution
(IVY-659) (thanks to Andrea Bernardo Ciddio)
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java?rev=602278&r1=602277&r2=602278&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java Fri
Dec 7 15:54:54 2007
@@ -61,26 +61,30 @@
private Visibility visibility;
private boolean transitive = true;
+
+ private String deprecated;
/**
- * @param name
- * @param visibility
- * @param description
- * @param ext
+ * Creates a new configuration.
+ *
+ * @param name the name of the configuration
*/
- public Configuration(String name, Visibility visibility, String description, String[]
ext) {
- this(name, visibility, description, ext, true);
+ public Configuration(String name) {
+ this(name, Visibility.PUBLIC, null, null, true, null);
}
/**
- * @param name
- * @param visibility
- * @param description
- * @param ext
- * @param transitive
+ * Creates a new configuration.
+ *
+ * @param name the name of the configuration
+ * @param visibility the visibility of the configuration
+ * @param description a description
+ * @param ext the configurations to extend from
+ * @param transitive indicates if the configuration is transitive
+ * @param deprecated the deprecation message
*/
- public Configuration(String name, Visibility visibility, String description, String[]
ext,
- boolean transitive) {
+ public Configuration(String name, Visibility visibility, String description, String[]
ext,
+ boolean transitive, String deprecated) {
if (name == null) {
throw new NullPointerException("null configuration name not allowed");
}
@@ -99,15 +103,17 @@
}
}
this.transitive = transitive;
+ this.deprecated = deprecated;
}
/**
- * @param name
+ * Returns the deprecation message, or <tt>null</tt> if not specified.
+ * @return Returns the deprecation message.
*/
- public Configuration(String name) {
- this(name, Visibility.PUBLIC, null, null);
+ public String getDeprecated() {
+ return deprecated;
}
-
+
/**
* @return Returns the description. It may be null.
*/
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?rev=602278&r1=602277&r2=602278&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
Fri Dec 7 15:54:54 2007
@@ -76,51 +76,51 @@
public static final Configuration[] MAVEN2_CONFIGURATIONS = new Configuration[] {
new Configuration("default", Visibility.PUBLIC,
"runtime dependencies and master artifact can be used with this conf",
- new String[] {"runtime", "master"}),
+ new String[] {"runtime", "master"}, true, null),
new Configuration(
"master",
Visibility.PUBLIC,
"contains only the artifact published by this module itself, "
+ "with no transitive dependencies",
- new String[0]),
+ new String[0], true, null),
new Configuration(
"compile",
Visibility.PUBLIC,
"this is the default scope, used if none is specified. "
+ "Compile dependencies are available in all classpaths.",
- new String[0]),
+ new String[0], true, null),
new Configuration(
"provided",
Visibility.PUBLIC,
"this is much like compile, but indicates you expect the JDK or a container
"
+ "to provide it. "
+ "It is only available on the compilation classpath, and is not transitive.",
- new String[0]),
+ new String[0], true, null),
new Configuration(
"runtime",
Visibility.PUBLIC,
"this scope indicates that the dependency is not required for compilation,
"
+ "but is for execution. It is in the runtime and test classpaths, "
+ "but not the compile classpath.",
- new String[] {"compile"}),
+ new String[] {"compile"}, true, null),
new Configuration(
"test",
Visibility.PRIVATE,
"this scope indicates that the dependency is not required for normal
use of "
+ "the application, and is only available for the test compilation and
"
+ "execution phases.",
- new String[0]),
+ new String[0], true, null),
new Configuration(
"system",
Visibility.PUBLIC,
"this scope is similar to provided except that you have to provide the
JAR "
+ "which contains it explicitly. The artifact is always available and
is not "
+ "looked up in a repository.",
- new String[0]),
+ new String[0], true, null),
};
private static final Configuration OPTIONAL_CONFIGURATION = new Configuration("optional",
- Visibility.PUBLIC, "contains all optional dependencies", new String[0]);
+ Visibility.PUBLIC, "contains all optional dependencies", new String[0], true,
null);
private static final Map MAVEN2_CONF_MAPPING = new HashMap();
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java?rev=602278&r1=602277&r2=602278&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
Fri Dec 7 15:54:54 2007
@@ -383,15 +383,16 @@
String transitiveValue = attributes.getValue("transitive");
boolean transitive = (transitiveValue == null) ? true : Boolean
.valueOf(attributes.getValue("transitive")).booleanValue();
+ String deprecated = attributes.getValue("deprecated");
Configuration configuration = new Configuration(conf,
Configuration.Visibility
.getVisibility(visibility == null ? "public"
: visibility), ivy.substitute(attributes
.getValue("description")), ext == null ? null : ext
- .split(","), transitive);
+ .split(","), transitive, deprecated);
ExtendableItemHelper.fillExtraAttributes(configuration, attributes,
new String[] {"name", "visibility", "extends", "transitive",
- "description"});
+ "description", "deprecated"});
md.addConfiguration(configuration);
break;
case PUB:
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java?rev=602278&r1=602277&r2=602278&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
Fri Dec 7 15:54:54 2007
@@ -309,6 +309,9 @@
}
out.print("\"");
}
+ if (confs[i].getDeprecated() != null) {
+ out.print(" deprecated=\"" + XMLHelper.escape(confs[i].getDeprecated())
+ "\"");
+ }
printExtraAttributes(confs[i].getExtraAttributes(), out, " ");
out.println("/>");
}
Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java?rev=602278&r1=602277&r2=602278&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
Fri Dec 7 15:54:54 2007
@@ -628,8 +628,8 @@
// should have imported configurations
assertNotNull(md.getConfigurations());
assertEquals(Arrays.asList(new Configuration[] {
- new Configuration("conf1", Visibility.PUBLIC, "", new String[0]),
- new Configuration("conf2", Visibility.PRIVATE, "", new String[0])}), Arrays
+ new Configuration("conf1", Visibility.PUBLIC, "", new String[0], true, null),
+ new Configuration("conf2", Visibility.PRIVATE, "", new String[0], true, null)}),
Arrays
.asList(md.getConfigurations()));
DependencyDescriptor[] dependencies = md.getDependencies();
@@ -660,9 +660,9 @@
// should have imported configurations and added the one defined in the file itself
assertNotNull(md.getConfigurations());
assertEquals(Arrays.asList(new Configuration[] {
- new Configuration("conf1", Visibility.PUBLIC, "", new String[0]),
- new Configuration("conf2", Visibility.PRIVATE, "", new String[0]),
- new Configuration("conf3", Visibility.PUBLIC, "", new String[0])}), Arrays
+ new Configuration("conf1", Visibility.PUBLIC, "", new String[0], true, null),
+ new Configuration("conf2", Visibility.PRIVATE, "", new String[0], true, null),
+ new Configuration("conf3", Visibility.PUBLIC, "", new String[0], true, null)}),
Arrays
.asList(md.getConfigurations()));
DependencyDescriptor[] dependencies = md.getDependencies();
@@ -695,8 +695,8 @@
// should have imported configurations
assertNotNull(md.getConfigurations());
assertEquals(Arrays.asList(new Configuration[] {
- new Configuration("conf1", Visibility.PUBLIC, "", new String[0]),
- new Configuration("conf2", Visibility.PRIVATE, "", new String[0])}), Arrays
+ new Configuration("conf1", Visibility.PUBLIC, "", new String[0], true, null),
+ new Configuration("conf2", Visibility.PRIVATE, "", new String[0], true, null)}),
Arrays
.asList(md.getConfigurations()));
DependencyDescriptor[] dependencies = md.getDependencies();
@@ -731,8 +731,8 @@
// should have imported configurations
assertNotNull(md.getConfigurations());
assertEquals(Arrays.asList(new Configuration[] {
- new Configuration("conf1", Visibility.PUBLIC, "", new String[0]),
- new Configuration("conf2", Visibility.PRIVATE, "", new String[0])}), Arrays
+ new Configuration("conf1", Visibility.PUBLIC, "", new String[0], true, null),
+ new Configuration("conf2", Visibility.PRIVATE, "", new String[0], true, null)}),
Arrays
.asList(md.getConfigurations()));
DependencyDescriptor[] dependencies = md.getDependencies();
|