Author: hibou
Date: Sun Apr 3 14:13:46 2011
New Revision: 1088306
URL: http://svn.apache.org/viewvc?rev=1088306&view=rev
Log:
IVYDE-267
- introducing the IvyDE namespace, to force artifact name mapping
Added:
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/ivy-1.1.xml (with props)
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/jars/
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/jars/ivydens-1.1.jar
(with props)
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/javadocs/
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/javadocs/ivydens-1.1.jar
(with props)
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/javadocs/javadoc-to-map-1.1.jar
(with props)
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/sources/
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/sources/ivydens-1.1.jar
(with props)
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/sources/sources-to-map-1.1.jar
(with props)
Modified:
ant/ivy/ivyde/trunk/doc/release-notes.html
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerMapper.java
Modified: ant/ivy/ivyde/trunk/doc/release-notes.html
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/doc/release-notes.html?rev=1088306&r1=1088305&r2=1088306&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/doc/release-notes.html (original)
+++ ant/ivy/ivyde/trunk/doc/release-notes.html Sun Apr 3 14:13:46 2011
@@ -130,6 +130,7 @@ List of changes since <a href="/ivy/ivyd
<li>NEW: The ivysettings field editor now supports the variable
${ivyproject_loc} which is referencing the current project being resolved
(IVYDE-247)</li>
<li>NEW: Resolve error popups can now be avoided (IVYDE-268)</li>
<li>NEW: Add configuration option to use an extended revision id when
resolving eclipse projects (IVYDE-235) (thanks to Jeffrey M. Metcalf)</li>
+ <li>NEW: Allow specifying source and javadoc mapping on binaries directly
in the ivy.xml (IVYDE-267)</li>
</ul><ul>
<li>IMPROVE: let IvyDE refresh workspace after a resolve (IVYDE-27)
(thanks to Clint Burghduff)</li>
<li>IMPROVE: IvyDE now resolve by batch, then preventing too many
workspace build (IVYDE-177)</li>
Modified:
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerMapper.java
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerMapper.java?rev=1088306&r1=1088305&r2=1088306&view=diff
==============================================================================
---
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerMapper.java
(original)
+++
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerMapper.java
Sun Apr 3 14:13:46 2011
@@ -50,6 +50,10 @@ import org.eclipse.jdt.core.JavaCore;
*/
public class IvyClasspathContainerMapper {
+ private static final String IVYDE_NS =
"http://ant.apache.org/ivy/ivyde/ns/";
+
+ private static final String IVYDE_NS_PREFIX = "ivyde:";
+
private final IProgressMonitor monitor;
private final Ivy ivy;
@@ -117,7 +121,7 @@ public class IvyClasspathContainerMapper
}
interface ArtifactMatcher {
- boolean matchName(String binaryName, String artifactName);
+ boolean matchName(Artifact artifact, String artifactName);
boolean match(Artifact a);
@@ -131,8 +135,7 @@ public class IvyClasspathContainerMapper
for (Iterator iter = all.iterator(); iter.hasNext();) {
ArtifactDownloadReport otherAdr = (ArtifactDownloadReport)
iter.next();
Artifact a = otherAdr.getArtifact();
- if (otherAdr.getLocalFile() != null
- && matcher.matchName(artifact.getName(), a.getName())
+ if (otherAdr.getLocalFile() != null && matcher.matchName(artifact,
a.getName())
&&
a.getModuleRevisionId().equals(artifact.getModuleRevisionId())
&& matcher.match(a)) {
return getArtifactPath(otherAdr);
@@ -148,7 +151,7 @@ public class IvyClasspathContainerMapper
for (int i = 0; i < artifacts.length; i++) {
Artifact metaArtifact = artifacts[i];
if (matcher.match(metaArtifact)) {
- if (matcher.matchName(artifact.getName(),
metaArtifact.getName())) {
+ if (matcher.matchName(artifact, metaArtifact.getName())) {
// we've found a matching artifact, let's provision it
ArtifactDownloadReport metaAdr =
ivy.getResolveEngine().download(
metaArtifact, new DownloadOptions());
@@ -180,8 +183,8 @@ public class IvyClasspathContainerMapper
}
private ArtifactMatcher sourceArtifactMatcher = new ArtifactMatcher() {
- public boolean matchName(String jar, String source) {
- return isArtifactName(jar, source,
conf.getInheritedSourceSuffixes());
+ public boolean matchName(Artifact artifact, String source) {
+ return isArtifactName(artifact, source,
conf.getInheritedSourceSuffixes(), "sources");
}
public boolean match(Artifact a) {
@@ -194,8 +197,8 @@ public class IvyClasspathContainerMapper
};
private ArtifactMatcher javadocArtifactMatcher = new ArtifactMatcher() {
- public boolean matchName(String jar, String javadoc) {
- return isArtifactName(jar, javadoc,
conf.getInheritedJavadocSuffixes());
+ public boolean matchName(Artifact artifact, String javadoc) {
+ return isArtifactName(artifact, javadoc,
conf.getInheritedJavadocSuffixes(), "javadoc");
}
public boolean match(Artifact a) {
@@ -207,7 +210,14 @@ public class IvyClasspathContainerMapper
}
};
- private boolean isArtifactName(String jar, String name, Collection/*
<String> */suffixes) {
+ private boolean isArtifactName(Artifact artifact, String name,
+ Collection/* <String> */suffixes, String type) {
+ String artifactNameToMatch = (String)
artifact.getExtraAttribute(IVYDE_NS_PREFIX + type);
+ if (artifactNameToMatch != null) {
+ // some name is specified, it overrides suffix matching
+ return name.equals(artifactNameToMatch);
+ }
+ String jar = artifact.getName();
if (name.equals(jar)) {
return true;
}
Added: ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/ivy-1.1.xml
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/ivy-1.1.xml?rev=1088306&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/ivy-1.1.xml (added)
+++ ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/ivy-1.1.xml Sun Apr 3
14:13:46 2011
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<ivy-module version="1.0" xmlns:ivyde="http://ant.apache.org/ivy/ivyde/ns/">
+ <info organisation="myorg"
+ module="ivydens"
+ revision="1.1"
+ status="release"
+ publication="20080811152510"
+ default="true"
+ />
+ <configurations>
+ <conf name="default" visibility="public"/>
+ </configurations>
+ <publications>
+ <artifact name="ivydens" type="jar" ext="jar"
conf="default" ivyde:sources="sources-to-map" ivyde:javadoc="javadoc-to-map" />
+ <artifact name="sources-to-map" type="source" ext="jar"
conf="default"/>
+ <artifact name="ivydens" type="source" ext="jar"
conf="default"/>
+ <artifact name="javadoc-to-map" type="javadoc" ext="jar"
conf="default"/>
+ <artifact name="ivydens" type="javadoc" ext="jar"
conf="default"/>
+ </publications>
+</ivy-module>
Propchange: ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/ivy-1.1.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/ivy-1.1.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/ivy-1.1.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/jars/ivydens-1.1.jar
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/jars/ivydens-1.1.jar?rev=1088306&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/jars/ivydens-1.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/javadocs/ivydens-1.1.jar
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/javadocs/ivydens-1.1.jar?rev=1088306&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/javadocs/ivydens-1.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/javadocs/javadoc-to-map-1.1.jar
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/javadocs/javadoc-to-map-1.1.jar?rev=1088306&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/javadocs/javadoc-to-map-1.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/sources/ivydens-1.1.jar
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/sources/ivydens-1.1.jar?rev=1088306&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/sources/ivydens-1.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/sources/sources-to-map-1.1.jar
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/sources/sources-to-map-1.1.jar?rev=1088306&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
ant/ivy/ivyde/trunk/test/fakerepo/myorg/ivydens/sources/sources-to-map-1.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream