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/06 23:22:27 UTC

cvs commit: jakarta-gump/python/gump integrate.py logic.py

ajack       2003/10/06 14:22:27

  Modified:    python/gump integrate.py logic.py
  Log:
  Another stab at dependencies...
  
  Revision  Changes    Path
  1.6       +3 -1      jakarta-gump/python/gump/integrate.py
  
  Index: integrate.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/integrate.py,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- integrate.py	6 Oct 2003 19:39:28 -0000	1.5
  +++ integrate.py	6 Oct 2003 21:22:27 -0000	1.6
  @@ -97,6 +97,8 @@
           result = 0 
       else: 
           result = 1
  +        
  +    return result
   
   # static void main()
   if __name__=='__main__':
  @@ -124,7 +126,7 @@
       #
       result = integrate(workspace, ps, context)
   
  -    log.info('Gump Integration complete. Exit code:' + result)
  +    log.info('Gump Integration complete. Exit code:' + str(result))
             
       # bye!
       sys.exit(result)
  
  
  
  1.18      +27 -14    jakarta-gump/python/gump/logic.py
  
  Index: logic.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/logic.py,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- logic.py	6 Oct 2003 19:58:37 -0000	1.17
  +++ logic.py	6 Oct 2003 21:22:27 -0000	1.18
  @@ -311,7 +311,6 @@
       return (len(getOutputsList(project,pctxt)) > 0)
   
   
  -    
   #
   # Maybe this is dodgy (it is inefficient) but we need some
   # way to get the sun tools for a javac compiler for ant and
  @@ -350,7 +349,8 @@
         elif work.parent:
             path=os.path.normpath(os.path.join(workspace.basedir,work.parent))
         else:
  -          log.error("<work element without nested or parent attributes on " + project.name )
  +          log.error("<work element without nested or parent attributes on " \
  +              + project.name + " in " + project.module)
       
         if path:
             classpath.append(AnnotatedPath(path,pctxt))
  @@ -358,45 +358,58 @@
     # Append dependent projects (including optional)
     if project.depend:
         for depend in project.depend:
  -          classpath += getProjectTreeOutputList(depend,context)  
  +          classpath += getDependOutputList(depend,context)  
     if project.option:    
         for option in project.option:
  -          classpath += getProjectTreeOutputList(option,context)
  +          classpath += getDependOutputList(option,context)
         
     return classpath
     
  -def getProjectTreeOutputList(project,context):      
  +def getDependOutputList(depend,context,logIssues=None):      
     """Get a classpath of outputs for a project (including it's dependencies)"""            
  -  classpath=[]
  +  projectname=depend.project
     
  -  if not Project.list.has_key(project):
  -      if project and project.name:
  -          log.error("Unknown project (in acquiring classpath) " + project.name )
  -      return classpath
  +  if not Project.list.has_key(projectname):
  +      if projectname:
  +          log.error("Unknown project (in acquiring classpath) " + projectname )
  +      return []
         
  +  classpath=[]
  +
     # Context for this project...
  +  project=Project.list[projectname]
     pctxt=context.getProjectContextForProject(project)
     
     # Append JARS for this project
  -  for jar in project.jars():
  +  for jar in depend.jars():
         classpath.append(AnnotatedPath(jar.path,pctxt)) 
         
     # Append sub-projects outputs
     if project.depend:
         for depend in project.depend:
  -        classpath += getProjectTreeOutputList(depend,context)
  +        classpath += getDependOutputList(depend,context,logIssues)
     
     # Append optional sub-project's output (that may not exist)
     if project.option:
         for option in project.option:
  -        classpath += getProjectTreeOutputList(option,context)
  +        classpath += getDependOutputList(option,context,logIssues)
   
     return classpath
     
   # BOOTCLASSPATH?
   def getClasspath(project,workspace,context):
  -  return os.pathsep.join(getClasspathList(project,workspace,context))
  +  return os.pathsep.join(getSimpleClasspathList(getClasspathList(project,workspace,context)))
   
  +def getSimpleClasspathList(cp):
  +    """ Return simple string list """
  +    classpath=[]
  +    for p  in cp:
  +        if isinstance(p,AnnotatedPath):
  +            classpath.append(p.path)
  +        else:
  +            classpath.append(p)
  +    return classpath
  +            
     
   def getAntProperties(workspace,ant):
     """Get properties for a project"""