gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: rev 37493 - in gump/trunk/python/gump: build document/xdocs guru language model repository run storage utils
Date Fri, 03 Sep 2004 17:36:02 GMT
Author: ajack
Date: Fri Sep  3 10:36:01 2004
New Revision: 37493

Modified:
   gump/trunk/python/gump/build/builder.py
   gump/trunk/python/gump/build/nant.py
   gump/trunk/python/gump/document/xdocs/documenter.py
   gump/trunk/python/gump/guru/xref.py
   gump/trunk/python/gump/language/csharp.py
   gump/trunk/python/gump/language/java.py
   gump/trunk/python/gump/model/builder.py
   gump/trunk/python/gump/model/depend.py
   gump/trunk/python/gump/model/misc.py
   gump/trunk/python/gump/model/project.py
   gump/trunk/python/gump/model/property.py
   gump/trunk/python/gump/model/workspace.py
   gump/trunk/python/gump/repository/publisher.py
   gump/trunk/python/gump/run/gumpenv.py
   gump/trunk/python/gump/run/gumprun.py
   gump/trunk/python/gump/storage/orphans.py
   gump/trunk/python/gump/utils/domutils.py
Log:
Some NAnt work, renaming jars as outputs (since assemblies != jars)

Modified: gump/trunk/python/gump/build/builder.py
==============================================================================
--- gump/trunk/python/gump/build/builder.py	(original)
+++ gump/trunk/python/gump/build/builder.py	Fri Sep  3 10:36:01 2004
@@ -32,7 +32,7 @@
 	project work is done (based of 'stat's, so --debug can be set in
 	a series of failures)
 	
-	3) Post build tasks (verifying jars exist, publishing to repositories,
+	3) Post build tasks (verifying outputs exist, publishing to repositories,
 	etc).
 
 """
@@ -82,7 +82,7 @@
         self.maven=MavenBuilder(run)
         self.script=ScriptBuilder(run)
 
-        # Place repository in jardir (to be renamed to repodir)
+        # Place repository in repodir
         self.repository=self.run.getOutputsRepository()        
             
     def buildProject(self,project):
@@ -250,24 +250,24 @@
         	
         	No return.
         """
-        log.debug(' ------ Performing post-Build Actions (check jars) for : '+ project.getName())
+        log.debug(' ------ Performing post-Build Actions (check outputs) for : '+ project.getName())
 
         if project.okToPerformWork():
-            if project.hasOutputs():                
+            if project.hasAnyOutputs():                
                 outputs = []
                     
-                # Ensure the jar output were all generated correctly.
+                # Ensure the outputs were all generated correctly.
                 outputsOk=True
-                for jar in project.getJars():
-                    jarPath=os.path.abspath(jar.getPath())
+                for output in project.getOutputs():
+                    outputPath=os.path.abspath(output.getPath())
                     # Add to list of outputs, in case we
                     # fail to find, and need to go list 
                     # directories
-                    outputs.append(jarPath)
-                    if not os.path.exists(jarPath):
+                    outputs.append(outputPath)
+                    if not os.path.exists(outputPath):
                         project.changeState(STATE_FAILED,REASON_MISSING_OUTPUTS)
                         outputsOk=False
-                        project.addError("Missing Output: " + str(jarPath))             
              
+                        project.addError("Missing Output: " + str(outputPath))          
                 
                                  
                 if outputsOk: 
                     # If we have a <license name='...
@@ -338,16 +338,16 @@
 
         self.checkPackage(project)
         
-        if project.hasOutputs():                
+        if project.hasAnyOutputs():                
             outputs = []
                     
-            # Ensure the jar output were all generated correctly.
-            for jar in project.getJars():
-                jarPath=os.path.abspath(jar.getPath())
+            # Ensure the output output were all generated correctly.
+            for output in project.getOutputs():
+                outputPath=os.path.abspath(output.getPath())
                 # Add to list of outputs, in case we
                 # fail to find, and need to go list 
                 # directories
-                outputs.append(jarPath)
+                outputs.append(outputPath)
                 
             # If we have a <license name='...
             if project.hasLicense():
@@ -384,19 +384,19 @@
         if project.okToPerformWork():
             # Check the package was installed correctly...
             outputsOk=1
-            for jar in project.getJars():
-                jarpath=jar.getPath()
-                if jarpath:
-                    if not os.path.exists(jarpath):
+            for output in project.getOutputs():
+                outputpath=output.getPath()
+                if outputpath:
+                    if not os.path.exists(outputpath):
                         project.changeState(STATE_FAILED,REASON_PACKAGE_BAD)
                         outputsOk=False
-                        project.addError("Missing Packaged Jar: " + str(jarpath))
+                        project.addError("Missing Packaged Output: " + str(outputpath))
     
             if outputsOk:
                 project.changeState(STATE_COMPLETE,REASON_PACKAGE)
             else:
                 # Just in case it was so bad it thought it had no
-                # jars to check
+                # outputs to check
                 project.changeState(STATE_FAILED,REASON_PACKAGE_BAD)
                 
                 # List them, why not...
@@ -433,8 +433,8 @@
             artifactsOk=True   
         
             # See if we can use 'stored' artifacts.
-            for jar in project.getJars():
-                id = jar.getId()
+            for output in project.getOutputs():
+                id = output.getId()
                 
                 # Use the repository one...
                 if artifacts.has_key(id):
@@ -443,7 +443,7 @@
                     log.info('Utilize %s from Gump artifact repository for id: %s' % (path,
id))
                     
                     # Stash this fallback...
-                    jar.setPath(path)
+                    output.setPath(path)
                 else:
                     log.info('Failed to find artifact for id %s (Gump Repo has %s in %s)'
% \
                             (id, artifacts.keys(), group))

Modified: gump/trunk/python/gump/build/nant.py
==============================================================================
--- gump/trunk/python/gump/build/nant.py	(original)
+++ gump/trunk/python/gump/build/nant.py	Fri Sep  3 10:36:01 2004
@@ -142,7 +142,7 @@
         # within.
         mergeFile=project.getWorkspace().getMergeFile()
         if mergeFile:
-            cmd.addPrefixedParameter('-D','gump.merge',str(mergeFile),'=')        
+            cmd.addPrefixedParameter('-D:','gump.merge',str(mergeFile),'=')        
     
         # These are from the project and/or workspace
         # These are 'normal' properties.
@@ -162,14 +162,14 @@
         """ Get properties for a project """
         properties=Parameters()
         for property in project.getWorkspace().getProperties()+project.getNAnt().getProperties():
-            properties.addPrefixedNamedParameter('-D',property.name,property.value,'=')
+            properties.addPrefixedNamedParameter('-D:',property.name,property.value,'=')
         return properties
 
     def getNAntSysProperties(self,project):
         """ Get sysproperties for a project """
         properties=Parameters()
         for property in project.getWorkspace().getSysProperties()+project.getNAnt().getSysProperties():
-            properties.addPrefixedNamedParameter('-D',property.name,property.value,'=')
+            properties.addPrefixedNamedParameter('-D:',property.name,property.value,'=')
         return properties
                 
     def preview(self,project,language,stats):        

Modified: gump/trunk/python/gump/document/xdocs/documenter.py
==============================================================================
--- gump/trunk/python/gump/document/xdocs/documenter.py	(original)
+++ gump/trunk/python/gump/document/xdocs/documenter.py	Fri Sep  3 10:36:01 2004
@@ -548,7 +548,7 @@
         #    detailsTable.createEntry("Scratch Directory : ", self.workspace.scratchdir))
   
         # :TODO: We have duplicate dirs? tmp = scratch?
         detailsTable.createEntry("Log Directory : ", self.workspace.logdir)
-        detailsTable.createEntry("Jars Repository : ", self.workspace.jardir)
+        detailsTable.createEntry("Outputs Repository : ", self.workspace.repodir)
         detailsTable.createEntry("CVS Directory : ", self.workspace.cvsdir)
         detailsTable.createEntry("Package Directory : ", self.workspace.pkgdir)
         if not self.workspace.private:
@@ -1636,7 +1636,7 @@
 
             if module.hasArtifacts():
                 if module.artifacts.hasUrl():
-                    repoList.createEntry( "Jars URL: ", module.jars.getUrl())   
+                    repoList.createEntry( "Jars URL: ", module.artifacts.getUrl())   
 
             repoList.createEntry('Redistributable: ', module.isRedistributable())       
      
            
@@ -1788,23 +1788,23 @@
         miscSection=document.createSection('Miscellaneous')
         
         #
-        #	Outputs (e.g. Jars)
+        #	Outputs (e.g. Outputs)
         #
-        if project.hasJars():
+        if project.hasOutputs():
             outputSection = miscSection.createSection('Output Artifacts')
             outputTable = outputSection.createTable(['Name','Artifact Id'])
             
-            for jar in project.getJars():
+            for output in project.getOutputs():
                 outputRow=outputTable.createRow()
                 
-                # The name (path) of the jar
-                outputRow.createData(jar.getName())
+                # The name (path) of the output
+                outputRow.createData(output.getName())
                 
-                # The jar id
-                id=jar.getId() or 'N/A'
+                # The output id
+                id=output.getId() or 'N/A'
                 outputRow.createData(id)    
         else:
-            miscSection.createWarning('No output artifacts (e.g. jars) produced')
+            miscSection.createWarning('No output artifacts (e.g. outputs) produced')
         
         if project.hasBuilder():
             
@@ -3261,13 +3261,13 @@
         pByO=self.documentProjectsByOutput(xref)                
         pxrefRow=pxrefTable.createRow()
         pxrefRow.createData().createLink(pByO, 'Projects By Output')
-        pxrefRow.createData('The outputs for the project, e.g. jars.')
+        pxrefRow.createData('The outputs for the project, e.g. outputs.')
              
         # Projects By Output Ids
         pByOI=self.documentProjectsByOutputId(xref)                
         pxrefRow=pxrefTable.createRow()
         pxrefRow.createData().createLink(pByOI, 'Projects By Output Identifier')
-        pxrefRow.createData('The identifiers for outputs for the project, e.g. jars.')
+        pxrefRow.createData('The identifiers for outputs for the project, e.g. outputs.')
              
         # Projects By Descriptor Location
         pByDL=self.documentProjectsByDescriptorLocation(xref)                
@@ -3452,12 +3452,12 @@
     def documentProjectsByOutput(self,xref):
         fileName='output_project'
         spec=self.resolver.getFileSpec(xref,fileName)
-        document=XDocDocument('Projects By Outputs (e.g. Jars)',	
+        document=XDocDocument('Projects By Outputs (e.g. Outputs)',	
                 spec.getFile() ,
                 self.config,
                 spec.getRootPath())
         
-        outputTable=document.createTable(['Projects By Outputs (e.g. Jars)'])
+        outputTable=document.createTable(['Projects By Outputs (e.g. Outputs)'])
         
         outputMap=xref.getOutputToProjectMap()
         for output in createOrderedList(outputMap.keys()):

Modified: gump/trunk/python/gump/guru/xref.py
==============================================================================
--- gump/trunk/python/gump/guru/xref.py	(original)
+++ gump/trunk/python/gump/guru/xref.py	Fri Sep  3 10:36:01 2004
@@ -105,24 +105,24 @@
     def mapOutputs(self):
         for module in self.workspace.getModules():            
             for project in module.getProjects():                
-                if project.hasJars():
-                    for jar in project.getJars():  
-                        jarName=os.path.basename(jar.getName())  
-                        jarId=jar.getId() or 'No Identifier'
+                if project.hasOutputs():
+                    for output in project.getOutputs():  
+                        outputName=os.path.basename(output.getName())  
+                        outputId=output.getId() or 'No Identifier'
                         
                         # Create a list to hold multiple (if needed)          
-                        if not self.outputToProject.has_key(jarName):
-                            self.outputToProject[jarName]=[]
+                        if not self.outputToProject.has_key(outputName):
+                            self.outputToProject[outputName]=[]
                         
                         # Create a list to hold multiple (if needed)          
-                        if not self.outputIdToProject.has_key(jarId):
-                            self.outputIdToProject[jarId]=[]
+                        if not self.outputIdToProject.has_key(outputId):
+                            self.outputIdToProject[outputId]=[]
                     
                         # Store the Project
-                        if not project in self.outputToProject[jarName]:
-                            self.outputToProject[jarName].append(project)
-                        if not project in self.outputIdToProject[jarId]:
-                            self.outputIdToProject[jarId].append(project)
+                        if not project in self.outputToProject[outputName]:
+                            self.outputToProject[outputName].append(project)
+                        if not project in self.outputIdToProject[outputId]:
+                            self.outputIdToProject[outputId].append(project)
     
     def mapDescriptorLocations(self):
         for module in self.workspace.getModules():            

Modified: gump/trunk/python/gump/language/csharp.py
==============================================================================
--- gump/trunk/python/gump/language/csharp.py	(original)
+++ gump/trunk/python/gump/language/csharp.py	Fri Sep  3 10:36:01 2004
@@ -103,7 +103,7 @@
                Perform this 'dependency' (mandatory or optional)
                
             1) Bring in the JARs (or those specified by id in depend ids)
-            2) Do NOT bring in the working entities (directories/jars)
+            2) Do NOT bring in the working entities (directories/libs)
             3) Bring in the sub-depends (or optional) if inherit='all' or 'hard'
             4) Bring in the runtime sub-depends if inherit='runtime'
             5) Also: *** Bring in any depenencies that the dependency inherits ***
@@ -164,14 +164,14 @@
         # from the repository. [This has been done already,
         # so is transparent here.]
         projectIds=[]
-        for jar in project.getJars():
+        for output in project.getOutputs():
             # Store for double checking
-            if jar.getId(): projectIds.append(jar.getId())
+            if output.getId(): projectIds.append(output.getId())
             
             # If 'all' or in ids list:
-            if (not ids) or (jar.getId() in ids):   
-                if ids: dependStr += ' Id = ' + jar.getId()
-                path=gump.language.path.AnnotatedPath(jar.getId(),jar.path,project,dependency.getOwnerProject(),dependStr)

+            if (not ids) or (output.getId() in ids):   
+                if ids: dependStr += ' Id = ' + output.getId()
+                path=gump.language.path.AnnotatedPath(output.getId(),output.path,project,dependency.getOwnerProject(),dependStr)

           
                 # Add to CLASSPATH
                 if debug:   print str(depth) + ') Append JAR : ' + str(path)

Modified: gump/trunk/python/gump/language/java.py
==============================================================================
--- gump/trunk/python/gump/language/java.py	(original)
+++ gump/trunk/python/gump/language/java.py	Fri Sep  3 10:36:01 2004
@@ -193,7 +193,7 @@
         # from the repository. [This has been done already,
         # so is transparent here.]
         projectIds=[]
-        for jar in project.getJars():
+        for jar in project.getOutputs():
             # Store for double checking
             if jar.getId(): projectIds.append(jar.getId())
             

Modified: gump/trunk/python/gump/model/builder.py
==============================================================================
--- gump/trunk/python/gump/model/builder.py	(original)
+++ gump/trunk/python/gump/model/builder.py	Fri Sep  3 10:36:01 2004
@@ -78,8 +78,8 @@
             # the property
             transferDomAttributes(ddom,pelement)
                 
-            # Fix the reference to a jarpath
-            pelement.setAttribute('reference','jarpath')
+            # Fix the reference to a outputpath
+            pelement.setAttribute('reference','outputpath')
 
             # Name the xmlproperty...
             if hasDomAttribute(ddom,'property'):

Modified: gump/trunk/python/gump/model/depend.py
==============================================================================
--- gump/trunk/python/gump/model/depend.py	(original)
+++ gump/trunk/python/gump/model/depend.py	Fri Sep  3 10:36:01 2004
@@ -27,14 +27,15 @@
 
 # Inheritence
 INHERIT_NONE=0
-INHERIT_JARS=1
+INHERIT_OUTPUTS=1
+INHERIT_JARS=INHERIT_OUTPUTS # Deprecated term, use outputs not jars
 INHERIT_RUNTIME=2
 INHERIT_ALL=3
 INHERIT_HARD=4
 
 inheritDescriptions = { INHERIT_NONE : "None",
            INHERIT_RUNTIME : "Runtime",
-           INHERIT_JARS : "Jars",
+           INHERIT_OUTPUTS : "Outputs",
            INHERIT_ALL : "All",
            INHERIT_HARD : "Hard" }
 
@@ -187,11 +188,11 @@
         Annotatable.dump(self,indent+1,output)
                 
     #
-    # Return the jars for the dependent project (matching
+    # Return the outputs for the dependent project (matching
     # ids, etc.)
     #
-    def jars(self):
-        """ Return the jars reference by this dependency """
+    def outputs(self):
+        """ Return the outputs reference by this dependency """
         result=[]
         
         #
@@ -200,15 +201,15 @@
         if not self.isNoClasspath():
         
             #
-            # IDs is a space separated list of jar ids. If specified
+            # IDs is a space separated list of output ids. If specified
             # then return those that are listed, else all.
             #
             ids=(self.ids or '').split(' ')
             try:
-                for jar in self.project.getJars():
-                    if (not self.ids) or (jar.id in ids): result.append(jar)
+                for output in self.project.getOutputs():
+                    if (not self.ids) or (output.id in ids): result.append(output)
             except:
-                log.warn('Failed to access jars in dependency project [' + self.project +
']')
+                log.warn('Failed to access outputs in dependency project [' + self.project
+ ']')
         
         return result
         

Modified: gump/trunk/python/gump/model/misc.py
==============================================================================
--- gump/trunk/python/gump/model/misc.py	(original)
+++ gump/trunk/python/gump/model/misc.py	Fri Sep  3 10:36:01 2004
@@ -103,13 +103,13 @@
 # represents a <home/> element
 class Home(ModelObject): pass
 
-# represents a <jar/> element
-class Jar(NamedModelObject):
+# represents an <output/> element
+class BaseOutput(NamedModelObject):
     def __init__(self,name,dom,owner):
-    	NamedModelObject.__init__(self,name,dom,owner)
-    	self.id=''
-    	self.type=''
-    	
+        NamedModelObject.__init__(self,name,dom,owner)
+        self.id=''
+        self.type=''
+        
     def setPath(self,path):
         self.path=path
     
@@ -128,6 +128,15 @@
         
     def getType(self):
         return self.type
+        
+# represents a <jar/> element
+class Jar(BaseOutput): 
+    """ Represents a <jar/> element."""
+    pass
+    
+class Assembly(BaseOutput): 
+    """ Represents an <assembly/> element."""
+    pass
 
 class Resolvable(ModelObject):
     """

Modified: gump/trunk/python/gump/model/project.py
==============================================================================
--- gump/trunk/python/gump/model/project.py	(original)
+++ gump/trunk/python/gump/model/project.py	Fri Sep  3 10:36:01 2004
@@ -24,7 +24,8 @@
 
 from gump.model.state import *
 from gump.model.object import ModelObject, NamedModelObject
-from gump.model.misc import Jar,Resultable, Positioned, \
+from gump.model.misc import Jar, Assembly, BaseOutput, \
+                            Resultable, Positioned, \
                             Mkdir, Delete, JunitReport, Work, \
                             AddressPair
 from gump.model.stats import Statable, Statistics
@@ -95,9 +96,9 @@
         self.packageNames=None
         
     	#############################################################
-    	# Outputs
+    	# Outputs (Jars, Assemblies)
     	#
-        self.jars={}        
+        self.outputs={}      
         
     	#############################################################
     	# Misc
@@ -206,14 +207,14 @@
         # :TODO: if a basedir then offset?
         return self.getModule().getViewUrl()
             
-    def addJar(self,jar):
-        self.jars[jar.getName()]=jar
+    def addOutput(self,output):
+        self.outputs[output.getName()]=output
         
-    def getJarCount(self):
-        return len(self.jars)
+    def getOutputCount(self):
+        return len(self.outputs)
         
-    def hasJarWithId(self,id):
-        return self.jars.has_key(id)
+    def hasOutputWithId(self,id):
+        return self.outputs.has_key(id)
         
     def hasLicense(self):
         if self.license: return True
@@ -226,12 +227,18 @@
     def getMkDirs(self): return self.mkdirs
     def getWorks(self): return self.works
         
-    def hasJars(self):
-        if self.jars: return True
+    def hasOutputs(self):
+        if self.outputs: return True
         return False
         
-    def getJars(self):
-        return self.jars.values()
+    def getOutputs(self):
+        return self.outputs.values()
+
+    def hasAnyOutputs(self):
+        """
+        Does this project generate outputs (currently JARs)
+        """
+        return self.hasJars() or self.hasLicense()
         
     def hasPackageNames(self):
         if self.packageNames: return True
@@ -240,8 +247,8 @@
     def getPackageNames(self):
         return self.packageNames
         
-    def getJarAt(self,index):
-        return self.jars.values()[index]
+    def getOutputAt(self,index):
+        return self.outputs.values()[index]
                 
     def isRedistributable(self):
         return self.redistributable or (self.module and self.module.isRedistributable())
@@ -431,38 +438,40 @@
                 self.addError('Missing \'name\' on <license')
         
         #
-        # Resolve jars (outputs)
+        # Resolve jars/assemblies/outputs        
         #
-        for jdom in self.getDomChildIterator('jar'):
-            name=self.expandVariables(
-                    getDomAttributeValue(jdom,'name'))
+        outputTypes={'jar':Jar, 'assembly':Assembly, 'output':BaseOutput}
+        
+        for (tag, clazz) in outputTypes.iteritems():
+            for tdom in self.getDomChildIterator(tag):
+                name=self.expandVariables(
+                        getDomAttributeValue(tdom,'name'))
                     
-            if self.home and name:  
-                jar=Jar(name,jdom,self)
-                jar.complete()
-                jar.setPath(os.path.abspath(os.path.join(self.home,name)))
-                self.addJar(jar)
-            else:
-                self.addError('Missing \'name\' on <jar')
+                if self.home and name:  
+                    output=clazz(name,tdom,self)
+                    output.complete()
+                    output.setPath(os.path.abspath(os.path.join(self.home,name)))
+                    self.addOutput(output)
+                else:
+                    self.addError('Missing \'name\' on <' + tag)
                 
-        # Fix 'ids' on all Jars which don't have them
-        if self.hasJars():
-            if 1 == self.getJarCount():
-                jar=self.getJarAt(0)
-                if not jar.hasId():
-                    self.addDebug('Sole jar [' + os.path.basename(jar.getPath()) + '] identifier
set to project name')
-                    jar.setId(self.getName())    
+                
+        # Fix 'ids' on all Jars/Assemblies/Outputs which don't have them
+        if self.hasOutputs():
+            if 1 == self.getOutputCount():
+                output=self.getOutputAt(0)
+                if not output.hasId():
+                    self.addDebug('Sole output [' + os.path.basename(output.getPath()) +
'] identifier set to project name')
+                    output.setId(self.getName())    
             else:
-                #
                 # :TODO: A work in progress, not sure how
                 # we ought 'construct' ids.
-                #
-                for jar in self.getJars():
-                    if not jar.hasId():
-                        basename=os.path.basename(jar.getPath())
+                for output in self.getOutputs():
+                    if not output.hasId():
+                        basename=os.path.basename(output.getPath())
                         newId=basename
-                        # Strip off .jar
-                        if newId.endswith('.jar'):
+                        # Strip off .jar or .lib (note: both same length)
+                        if newId.endswith('.jar') or newId.endsWith('.lib'):
                             newId=newId[:-4]
                         # Strip off -@@DATE@@
                         datePostfix='-' + str(default.date_s)
@@ -470,8 +479,8 @@
                             reduction=-1 * len(datePostfix)
                             newId=newId[:reduction]
                         # Assign...
-                        self.addDebug('Jar [' + basename + '] identifier set to jar basename:
[' + newId + ']')    
-                        jar.setId(newId)
+                        self.addDebug('Output [' + basename + '] identifier set to output
basename: [' + newId + ']')    
+                        output.setId(newId)
         
         # Grab all the work
         for w in self.getDomChildIterator('work'):
@@ -703,12 +712,6 @@
             outputs.append(gump.language.path.AnnotatedPath(jar.getId(),jarpath,self,None,"Project
output"))                    
         return outputs
                         
-    def hasOutputs(self):
-        """
-        Does this project generate outputs (currently JARs)
-        """
-        return self.hasJars() or self.hasLicense()
-        
     def setLanguageTypeFromString(self,lang=None):
         try:
             self.languageType=Project.LANGUAGE_MAP[lang]

Modified: gump/trunk/python/gump/model/property.py
==============================================================================
--- gump/trunk/python/gump/model/property.py	(original)
+++ gump/trunk/python/gump/model/property.py	Fri Sep  3 10:36:01 2004
@@ -78,41 +78,42 @@
             else:
                 self.setValue(workspace.getProject(project).getModule().getWorkingDirectory())
                 
-        elif reference=='jarpath' or reference=='jar':            
+        elif reference=='jarpath' or reference=='jar' \
+            or reference=='outputpath' or reference=='output':            
             if self.hasDomAttribute('project'):
                 if not workspace.hasProject(project):
                     responsibleParty.addError( \
-                        'Cannot resolve jar/jarpath of *unknown* [' + project + ']')
+                        'Cannot resolve output/outputpath of *unknown* [' + project + ']')
                 else:
                     targetProject=workspace.getProject(project)
                 
                     if self.hasDomAttribute('id'):
                         id=self.getDomAttributeValue('id')
                         # Find the referenced id
-                        for jar in targetProject.getJars():
-                            if jar.getId()==id:
-                                if reference=='jarpath':
-                                    self.setValue(jar.getPath())
+                        for output in targetProject.getOutputs():
+                            if output.getId()==id:
+                                if reference=='jarpath' or reference=='outputpath':
+                                    self.setValue(output.getPath())
                                 else:
-                                    self.setValue(jar.getName())
+                                    self.setValue(output.getName())
                                 break
                         else:
                             responsibleParty.addError(	\
-                               ("jar with id %s was not found in project %s ") % \
+                               ("Output with id %s was not found in project %s ") % \
                                 (id, targetProject.getName()))
                                 
-                    elif targetProject.getJarCount()==1:
+                    elif targetProject.getOutputCount()==1:
                         # There is only one, so pick it...
-                        self.setValue(targetProject.getJars()[0].getPath())
-                    elif  targetProject.getJarCount()>1:
+                        self.setValue(targetProject.getOutputAt(0).getPath())
+                    elif  targetProject.getOutputCount()>1:
 	                    # Don't know which....
 	                    responsibleParty.addError(	\
-                            ("Multiple jars defined by project %s; " + \
+                            ("Multiple outputs defined by project %s; " + \
                             "an id attribute is required to select the one you want") % \
                               (targetProject.getName()))
                     else:
                         responsibleParty.addError(	\
-                            ('Project %s defines no jars as output') % \
+                            ('Project %s defines no outputs') % \
                             (targetProject.getName()))      
             else:
                 responsibleParty.addError('No project specified.')      

Modified: gump/trunk/python/gump/model/workspace.py
==============================================================================
--- gump/trunk/python/gump/model/workspace.py	(original)
+++ gump/trunk/python/gump/model/workspace.py	Fri Sep  3 10:36:01 2004
@@ -244,7 +244,7 @@
         
         self.tmpdir=''
         self.logdir=''
-        self.jardir=''
+        self.repodir=''
         self.cvsdir=''
         self.pkgdir=''
         
@@ -261,7 +261,8 @@
         # Import overrides from DOM
         transferDomInfo(self.element, 
                         self, 
-                        {	'banner-image':'bannerImage',
+                        {	'jardir':'repodir',
+                            'banner-image':'bannerImage',
                             'banner-link' :'bannerLink'})
     
         if not self.basedir:
@@ -269,14 +270,14 @@
             
         if not self.tmpdir: self.tmpdir=os.path.join(self.getBaseDirectory(),"tmp")
         if not self.logdir: self.logdir=os.path.join(self.getBaseDirectory(),"log")
-        if not self.jardir: self.jardir=os.path.join(self.getBaseDirectory(),"repo") 
+        if not self.repodir: self.repodir=os.path.join(self.getBaseDirectory(),"repo") 
         if not self.cvsdir: self.cvsdir=os.path.join(self.getBaseDirectory(),"cvs")
         if not self.pkgdir: self.pkgdir=self.getBaseDirectory()
             
         # Construct dirs on demand         
         if not os.path.exists(self.tmpdir): os.makedirs(self.tmpdir)    
         if not os.path.exists(self.logdir): os.makedirs(self.logdir)
-        if not os.path.exists(self.jardir): os.makedirs(self.jardir)
+        if not os.path.exists(self.repodir): os.makedirs(self.repodir)
         if not os.path.exists(self.cvsdir): os.makedirs(self.cvsdir)
     
         # Get all properties

Modified: gump/trunk/python/gump/repository/publisher.py
==============================================================================
--- gump/trunk/python/gump/repository/publisher.py	(original)
+++ gump/trunk/python/gump/repository/publisher.py	Fri Sep  3 10:36:01 2004
@@ -63,15 +63,15 @@
                     project.addError(message)
                     log.error(message)                     
                                     
-            # For all output artifacts (jars)
-            for jar in project.getJars():
+            # For all output artifacts (outputs)
+            for output in project.getOutputs():
                 # :TODO: Relative to module source?
-                jarPath=os.path.abspath(jar.getPath())
+                outputPath=os.path.abspath(output.getPath())
                 try:
                     # Publish under artifact identifier...
-                    self.repository.publish( groupName, jarPath, jar.getId())
+                    self.repository.publish( groupName, outputPath, output.getId())
                 except Exception, details:
-                    message='Failed to publish [' + jarPath + '] to repository : ' + str(details)
+                    message='Failed to publish [' + outputPath + '] to repository : ' + str(details)
                     project.addError(message)
                     log.error(message)
             

Modified: gump/trunk/python/gump/run/gumpenv.py
==============================================================================
--- gump/trunk/python/gump/run/gumpenv.py	(original)
+++ gump/trunk/python/gump/run/gumpenv.py	Fri Sep  3 10:36:01 2004
@@ -185,7 +185,7 @@
             self.addWarning('"maven" command not found, no Maven builds')
        
         if not self.noNAnt and \
-            not self._checkExecutable('NAnt','--help',False,False,'check_NAnt'): 
+            not self._checkExecutable('NAnt','-help',False,False,'check_NAnt'): 
             self.noNAnt=True
             self.addWarning('"NAnt" command not found, no NAnt builds')
        

Modified: gump/trunk/python/gump/run/gumprun.py
==============================================================================
--- gump/trunk/python/gump/run/gumprun.py	(original)
+++ gump/trunk/python/gump/run/gumprun.py	Fri Sep  3 10:36:01 2004
@@ -90,7 +90,7 @@
         
         # A repository interface...
         from gump.repository.artifact import ArtifactRepository
-        self.outputsRepository=ArtifactRepository(workspace.jardir)
+        self.outputsRepository=ArtifactRepository(workspace.repodir)
                   
         # Generate a GUID (or close)
         import md5

Modified: gump/trunk/python/gump/storage/orphans.py
==============================================================================
--- gump/trunk/python/gump/storage/orphans.py	(original)
+++ gump/trunk/python/gump/storage/orphans.py	Fri Sep  3 10:36:01 2004
@@ -75,7 +75,7 @@
     pkgdir = None
     logdir = None
     basedir = None
-    jardir = ""
+    repodir = ""
     modules=[]
     packages=[]
     def startElement(self, name, attrs):
@@ -84,7 +84,7 @@
             self.pkgdir = attrs['pkgdir']
             self.cvsdir = attrs['cvsdir']
             self.basedir = attrs['basedir']
-            if 'jardir' in attrs: self.jardir = attrs['jardir']
+            if 'repodir' in attrs: self.repodir = attrs['repodir']
             self.logdir = attrs['logdir']
         if name == 'module':
             attrs=dict(attrs)
@@ -113,7 +113,7 @@
     if not dir[len(workspace.basedir)+1:] in workspace.modules:
         dir=dir.replace('/',os.sep)
         if dir==workspace.basedir.replace('/',os.sep)+os.sep+"dist": continue
-        if dir==workspace.jardir.replace('/',os.sep): continue
+        if dir==workspace.repodir.replace('/',os.sep): continue
         if dir==workspace.logdir.replace('/',os.sep): continue
         if dir==workspace.cvsdir.replace('/',os.sep): continue
         if os.path.isdir(dir): print dir

Modified: gump/trunk/python/gump/utils/domutils.py
==============================================================================
--- gump/trunk/python/gump/utils/domutils.py	(original)
+++ gump/trunk/python/gump/utils/domutils.py	Fri Sep  3 10:36:01 2004
@@ -87,7 +87,7 @@
     
     # See what attribute we'd like to set with this
     attrName=name
-    if mapping and mapping.has_key(attrName): attrName=mapping[tag]
+    if mapping and mapping.has_key(name): attrName=mapping[name]
         
     # We have somewhere to put this value... 
     if hasattr(target,attrName):

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Mime
View raw message