You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@gump.apache.org by aj...@apache.org on 2004/02/02 13:37:31 UTC
cvs commit: jakarta-gump/src/documentation/content/xdocs/metadata ant.xml
ajack 2004/02/02 04:37:30
Modified: python/gump/model property.py
src/documentation/content/xdocs/metadata ant.xml
Log:
Make 'path' on <property work as specified:
http://jakarta.apache.org/gump/metadata/ant.html#property
Revision Changes Path
1.11 +29 -6 jakarta-gump/python/gump/model/property.py
Index: property.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/model/property.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- property.py 9 Jan 2004 19:57:18 -0000 1.10
+++ property.py 2 Feb 2004 12:37:30 -0000 1.11
@@ -100,11 +100,13 @@
elif self.xml.reference=='jarpath' or self.xml.reference=='jar':
if not workspace.hasProject(self.xml.project):
- responsibleParty.addError('Cannot resolve jar/jarpath of *unknown* [' + self.xml.project + ']')
+ responsibleParty.addError('Cannot resolve jar/jarpath of *unknown* [' \
+ + self.xml.project + ']')
else:
targetProject=workspace.getProject(self.xml.project)
if self.xml.id:
+ # Find the referenced id
for jar in targetProject.getJars():
if jar.getId()==self.xml.id:
if self.xml.reference=='jarpath':
@@ -117,8 +119,10 @@
("jar with id %s was not found in project %s ") % \
(self.xml.id, targetProject.getName()))
elif targetProject.getJarCount()==1:
+ # There is only one, so pick it...
self.setValue(targetProject.getJars()[0].getPath())
elif targetProject.getJarCount()>1:
+ # Don't know which....
responsibleParty.addError( \
("Multiple jars defined by project %s; " + \
"an id attribute is required to select the one you want") % \
@@ -130,11 +134,30 @@
elif self.xml.path:
#
- # Path relative to module's srcdir (doesn't work in workspace)
- #
- self.value=os.path.abspath(os.path.join( \
- parent.getOwner().getModule().getSourceDirectory(), \
- self.xml.path))
+ # If a property on a project..
+ #
+ if not parent==workspace:
+ # If on a referenced project
+ if self.xml.project:
+ if not workspace.hasProject(self.xml.project):
+ responsibleParty.addError('Cannot resolve relative to *unknown* [' + self.xml.project + '] for ' + \
+ self.getName())
+ else:
+ # Relative to referenced project
+ relativeProject=workspace.getProject(self.xml.project)
+ else:
+ # Relative to this project...
+ relativeProject=responsibleParty
+
+ #
+ # Path relative to module's srcdir (doesn't work in workspace)
+ #
+ self.value=os.path.abspath(os.path.join( \
+ relativeProject.getModule().getSourceDirectory(), \
+ self.xml.path))
+ else:
+ responsibleParty.addError('Can\'t have path on property on workspace: ' + \
+ + self.getName())
if not hasattr(self,'value'):
responsibleParty.addError('Unhandled Property: ' + self.getName() + ' on: ' + \
1.3 +2 -2 jakarta-gump/src/documentation/content/xdocs/metadata/ant.xml
Index: ant.xml
===================================================================
RCS file: /home/cvs/jakarta-gump/src/documentation/content/xdocs/metadata/ant.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ant.xml 8 Dec 2003 16:34:14 -0000 1.2
+++ ant.xml 2 Feb 2004 12:37:30 -0000 1.3
@@ -90,8 +90,8 @@
</tr>
<tr>
<td>path</td>
- <td>a path which is to be interpreted relative to the srcdir for the
- project if specified, or this project otherwise. This option is
+ <td>a path which is to be interpreted relative to the srcdir for the module containing
+ the project if specified, or this project otherwise. This option is
ignored if reference is specified.</td>
<td>No</td>
</tr>