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 2003/10/02 18:15:29 UTC
cvs commit: jakarta-gump/python/gump logic.py
ajack 2003/10/02 09:15:29
Modified: python/gump logic.py
Log:
Attempt to give inherit="all" since currently we only have inherit="jars"
Revision Changes Path
1.13 +32 -12 jakarta-gump/python/gump/logic.py
Index: logic.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/logic.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- logic.py 1 Oct 2003 18:19:13 -0000 1.12
+++ logic.py 2 Oct 2003 16:15:29 -0000 1.13
@@ -310,10 +310,12 @@
#
# BOOTCLASSPATH?
def getClasspathList(project,workspace):
- """Get classpath for a project (including it's dependencies)"""
- classpath=getSystemClasspathList()
+ """Get a TOTAL classpath for a project (including it's dependencies)"""
- # start with the work directories
+ # Start with the system classpath (later remove this)
+ classpath=getSystemClasspathList()
+
+ # Add this project's work directories
srcdir=Module.list[project.module].srcdir
for work in project.work:
if work.nested:
@@ -322,17 +324,35 @@
classpath.append(os.path.normpath(os.path.join(workspace.basedir,work.parent)))
else:
log.error("<work element without nested or parent attributes on " + project.name )
-
- # Append projects
- for depend in project.depend:
- for jar in depend.jars():
- classpath.append(jar.path)
+
+ # Append dependent projects (including optional)
+ if project.depend:
+ for depend in project.depend:
+ classpath += getProjectTreeOutputList(depend)
+ if project.option:
+ for option in project.option:
+ classpath += getProjectTreeOutputList(option)
+
+ return classpath
- # Append optional projects (that may not exist)
- for option in project.option:
- for jar in option.jars():
- classpath.append(jar.path)
+def getProjectTreeOutputList(project):
+ """Get a classpath of outputs for a project (including it's dependencies)"""
+ classpath=[]
+
+ # Append JARS for this project
+ for jar in project.jars():
+ classpath.append(jar.path)
+ # Append sub-projects outputs
+ if project.depend:
+ for depend in project.depend:
+ classpath += getProjectTreeOutputList(depend)
+
+ # Append optional sub-project's output (that may not exist)
+ if project.option:
+ for option in project.option:
+ classpath += getProjectTreeOutputList(option)
+
return classpath
# BOOTCLASSPATH?