gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: rev 37345 - in gump/trunk/python/gump: build document/xdocs language model run runner test test/resources/full1
Date Wed, 01 Sep 2004 18:59:27 GMT
Author: ajack
Date: Wed Sep  1 11:59:27 2004
New Revision: 37345

Added:
   gump/trunk/python/gump/language/csharp.py
   gump/trunk/python/gump/language/path.py
      - copied unchanged from rev 37254, gump/trunk/python/gump/language/cp.py
   gump/trunk/python/gump/test/nant.py
   gump/trunk/python/gump/test/resources/full1/nant1.xml
Removed:
   gump/trunk/python/gump/language/cp.py
Modified:
   gump/trunk/python/gump/build/ant.py
   gump/trunk/python/gump/build/builder.py
   gump/trunk/python/gump/build/maven.py
   gump/trunk/python/gump/build/nant.py
   gump/trunk/python/gump/build/script.py
   gump/trunk/python/gump/document/xdocs/documenter.py
   gump/trunk/python/gump/language/java.py
   gump/trunk/python/gump/model/builder.py
   gump/trunk/python/gump/model/project.py
   gump/trunk/python/gump/run/gumpenv.py
   gump/trunk/python/gump/run/gumprun.py
   gump/trunk/python/gump/runner/runner.py
   gump/trunk/python/gump/test/model.py
   gump/trunk/python/gump/test/pyunit.py
   gump/trunk/python/gump/test/resources/full1/profile.xml
Log:
Some more NAnt work (but also trying to put TRUNK back into one piece.)

Modified: gump/trunk/python/gump/build/ant.py
==============================================================================
--- gump/trunk/python/gump/build/ant.py	(original)
+++ gump/trunk/python/gump/build/ant.py	Wed Sep  1 11:59:27 2004
@@ -32,8 +32,6 @@
 from gump.run.gumprun import *
 from gump.core.config import dir, default, basicConfig
 
-import gump.build.builder
-
 from gump.utils.note import Annotatable
 from gump.utils.work import *
 
@@ -76,7 +74,7 @@
             # Update context with the fact that this work was done
             work=CommandWorkItem(WORK_TYPE_BUILD,cmd,cmdResult)
             project.performedWork(work)
-            project.setBuilt(1)
+            project.setBuilt(True)
                     
             # Update context state based of the result  
             if not cmdResult.state==CMD_STATE_SUCCESS:

Modified: gump/trunk/python/gump/build/builder.py
==============================================================================
--- gump/trunk/python/gump/build/builder.py	(original)
+++ gump/trunk/python/gump/build/builder.py	Wed Sep  1 11:59:27 2004
@@ -97,8 +97,7 @@
         log.info('Build Project: #[' + `project.getPosition()` + '] : ' + project.getName()
+ ' :  [state:' \
                         + project.getStateDescription() + ']')
                   
-        # Right now everything is Java..
-        languageHelper=self.run.getJavaHelper()
+        languageHelper=self.run.getLanguageHelper(project.getLanguageType())
           
         # Extract stats (in case we want to do conditional processing)            
         stats=None

Modified: gump/trunk/python/gump/build/maven.py
==============================================================================
--- gump/trunk/python/gump/build/maven.py	(original)
+++ gump/trunk/python/gump/build/maven.py	Wed Sep  1 11:59:27 2004
@@ -32,8 +32,6 @@
 from gump.run.gumprun import *
 from gump.core.config import dir, default, basicConfig
 
-import gump.build
-
 from gump.utils import dump, display, getIndent, logResourceUtilization, \
                             invokeGarbageCollection
 from gump.utils.note import Annotatable

Modified: gump/trunk/python/gump/build/nant.py
==============================================================================
--- gump/trunk/python/gump/build/nant.py	(original)
+++ gump/trunk/python/gump/build/nant.py	Wed Sep  1 11:59:27 2004
@@ -32,8 +32,6 @@
 from gump.run.gumprun import *
 from gump.core.config import dir, default, basicConfig
 
-import gump.build.builder
-
 from gump.utils.note import Annotatable
 from gump.utils.work import *
 
@@ -67,7 +65,7 @@
         log.info('Run NAnt on Project: #[' + `project.getPosition()` + '] : ' + project.getName())
     
         # Get the appropriate build command...
-        cmd=self.getNAntCommand(project, language, self.run.getEnvironment().getJavaCommand())
+        cmd=self.getNAntCommand(project, language)
 
         if cmd:
             # Execute the command ....
@@ -76,7 +74,7 @@
             # Update context with the fact that this work was done
             work=CommandWorkItem(WORK_TYPE_BUILD,cmd,cmdResult)
             project.performedWork(work)
-            project.setBuilt(1)
+            project.setBuilt(True)
                     
             # Update context state based of the result  
             if not cmdResult.state==CMD_STATE_SUCCESS:
@@ -88,7 +86,7 @@
                 # For now, things are going good...
                 project.changeState(STATE_SUCCESS)
     
-    def getNAntCommand(self,project,language):
+    def getNAntCommand(self,project,languageHelper):
         """
         	Build an ANT command for this project, based on the <nant metadata
    			select targets and build files as appropriate.     	
@@ -117,26 +115,22 @@
    
         # Get system properties
         sysproperties=self.getNAntSysProperties(project)
+        
+        # Library Path
+        libpath=languageHelper.getAssemblyPath(project)
    
         # Run java on apache NAnt...
-        cmd=Cmd(javaCommand,'build_'+project.getModule().getName()+'_'+project.getName(),
-            basedir,{'CLASSPATH':classpath})
+        cmd=Cmd('NAnt.exe','build_'+project.getModule().getName()+'_'+project.getName(),
+            basedir,{'LIBPATH':libpath})
             
         # These are workspace + project system properties
         cmd.addNamedParameters(sysproperties)
         
-        # Add BOOTCLASSPATH
-        #if bootclasspath:
-        #    cmd.addPrefixedParameter('-X','bootclasspath/p',bootclasspath,':')
-            
         # Get/set JVM properties
         #jvmargs=language.getJVMArgs(project)
         #if jvmargs:
         #    cmd.addParameters(jvmargs)
-            
-        # The NAnt interface
-        cmd.addParameter('org.apache.tools.ant.Main')  
-    
+       
         # Allow ant-level debugging...
         if project.getWorkspace().isDebug() or project.isDebug() or debug: 
             cmd.addParameter('-debug')  

Modified: gump/trunk/python/gump/build/script.py
==============================================================================
--- gump/trunk/python/gump/build/script.py	(original)
+++ gump/trunk/python/gump/build/script.py	Wed Sep  1 11:59:27 2004
@@ -80,7 +80,7 @@
             # Update Context    
             work=CommandWorkItem(WORK_TYPE_BUILD,cmd,cmdResult)
             project.performedWork(work)
-            project.setBuilt(1)
+            project.setBuilt(True)
                     
             # Update Context w/ Results  
             if not cmdResult.state==CMD_STATE_SUCCESS:

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	Wed Sep  1 11:59:27 2004
@@ -39,7 +39,7 @@
 from gump.utils.timing import *
 from gump.utils.tools import syncDirectories,copyDirectories,wipeDirectoryTree
 
-from gump.java.cp import AnnotatedPath
+from gump.language.path import AnnotatedPath
 
 from gump.model.stats import *
 from gump.model.project import ProjectStatistics
@@ -1814,12 +1814,19 @@
                 self.documentProperties(miscSection, project.getNAnt(), 'NAnt Properties')
             # :TODO: Maven?
             
-            javaHelper=self.run.getJavaHelper()            
-            (classpath,bootclasspath)=javaHelper.getClasspathObjects(project)           

-            self.displayClasspath(miscSection, classpath, 'Classpath', project)        
-            self.displayClasspath(miscSection, bootclasspath, 'Boot Classpath', project)

+            language=project.getLanguageType()            
+            helper=self.run.getLanguageHelper(language)
+            if Project.JAVA_LANGUAGE == language:            
+                javaHelper=helper
+                (classpath,bootclasspath)=javaHelper.getClasspathObjects(project)       
    
+                self.displayClasspath(miscSection, classpath, 'Classpath', project)     
  
+                self.displayClasspath(miscSection, bootclasspath, 'Boot Classpath', project)

+            elif Project.CSHARP_LANGUAGE == language:
+                csharpHelper=helper
+                libpath=csharpHelper.getAssemlyPathObject(project)            
+                self.displayClasspath(miscSection, libpath, 'Assemblies', project)     
         else:
-            miscSection.createParagraph('No build command (so classpaths irrelevant)')
+            miscSection.createParagraph('No build command (so classpaths/assembly path irrelevant)')
        
         if project.isDebug():
             self.documentXML(miscSection,project)

Added: gump/trunk/python/gump/language/csharp.py
==============================================================================
--- (empty file)
+++ gump/trunk/python/gump/language/csharp.py	Wed Sep  1 11:59:27 2004
@@ -0,0 +1,202 @@
+#!/usr/bin/python
+
+
+# Copyright 2003-2004 The Apache Software Foundation
+#
+# Licensed 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.
+
+"""
+
+	Generates paths for projects w/ dependencies
+
+"""
+
+from gump import log
+
+import os.path
+
+import gump.run.gumprun
+import gump.process.command
+
+import gump.model.depend
+
+import gump.language.path
+
+###############################################################################
+# Classes
+###############################################################################
+
+class CSharpHelper(gump.run.gumprun.RunSpecific):
+    
+    def __init__(self,run):
+        gump.run.gumprun.RunSpecific.__init__(self,run)
+        
+        # Caches for paths
+        self.paths={}     
+        
+    def getAssemblyPath(self,project,debug=False):
+        """
+        Get boot and regular classpaths for a project.
+        
+        Return a path for this project
+        """
+        # Calculate path
+        libpath = self.getAssemblyPathObject(project,debug)
+        
+        # Return them simple/flattened
+        return libpath.getFlattened()
+
+    def getAssemblyPathObject(self,project,debug=False):
+        """
+        Get a TOTAL path for a project (including its dependencies)
+        
+        A path object for a project
+        """
+
+        #
+        # Do this once only... storing it on the context. Not as nice as 
+        # doing it OO (each project context stores its own, but a step..)
+        #
+        if self.paths.has_key(project) :
+          if debug: print "Path previously resolved..."
+          return self.paths[project]
+  
+        # Start with the system classpath (later remove this)
+        libpath=gump.language.path.AssemblyPath('Assembly Path')
+
+        # Add this project's work directories
+        workdir=project.getModule().getWorkingDirectory()          
+        for work in project.getWorks():
+            path=work.getResolvedPath()
+            if path:
+                libpath.addPathPart(gump.language.path.AnnotatedPath('',path,project,None,'Work
Entity'))   
+            else:
+                log.error("<work element with neither 'nested' nor 'parent' attribute
on " \
+                        + project.getName() + " in " + project.getModule().getName()) 
+              
+        # Append dependent projects (including optional)
+        visited=[]
+  
+        # Does it have any depends? Process all of them...
+        for dependency in project.getDirectDependencies():
+            subp = self._getDependOutputList(project,dependency,visited,1,debug)
+            if subp:  libpath.importPath(subp)   
+    
+        # Store so we don't do this twice.
+        self.paths[project] = libpath
+        
+        return libpath
+
+    def _getDependOutputList(self,project,dependency,visited,depth=0,debug=0):      
+        """
+        
+               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)
+            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 ***
+            
+           """            
+   
+        # Skip ones that aren't here to affect the classpath
+        if dependency.isNoClasspath():  
+            return None
+            
+        # Don't loop
+        if (dependency in visited):
+            # beneficiary.addInfo("Duplicated dependency [" + str(depend) + "]")        
 
+            if debug:
+                print str(depth) + ") Already Visited : " + str(dependency)
+                print str(depth) + ") Previously Visits  : "
+                for v in visited:
+                    print str(depth) + ")  - " + str(v)
+            return None
+            
+        visited.append(dependency)
+        
+        if debug:
+            print str(depth) + ") Perform : " + `dependency`
+                  
+        # 
+        libpath=gump.language.path.AssemblyPath('Assembly Path for ' + `dependency`)
+
+        # Context for this dependecy project...
+        project=dependency.getProject()
+  
+        # The dependency drivers...
+        #
+        # runtime (i.e. this is a runtime dependency)
+        # inherit (i.e. inherit stuff from a dependency)
+        #
+        runtime=dependency.runtime
+        inherit=dependency.inherit
+        if dependency.ids:
+            ids=dependency.ids.split()
+        else:
+            ids=None
+  
+        # Explain..
+        dependStr=''
+        if inherit: 
+            if dependStr: dependStr += ', '
+            dependStr += 'Inherit:'+dependency.getInheritenceDescription()
+        if runtime: 
+            if dependStr: dependStr += ', '
+            dependStr += 'Runtime'
+  
+        # Append JARS for this project
+        #    (respect ids --- none means 'all)
+        ####################################################
+        # Note, if they don't come from the project outputs
+        # (e.g. 'cos the project failed) attempt to get them
+        # from the repository. [This has been done already,
+        # so is transparent here.]
+        projectIds=[]
+        for jar in project.getJars():
+            # Store for double checking
+            if jar.getId(): projectIds.append(jar.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)

+          
+                # Add to CLASSPATH
+                if debug:   print str(depth) + ') Append JAR : ' + str(path)
+                libpath.addPathPart(path)
+
+        # Double check IDs (to reduce stale ids in metadata)
+        if ids:
+            for id in ids:
+                if not id in projectIds:
+                    dependency.getOwnerProject().addWarning("Invalid ID [" + id \
+                          + "] for dependency on [" + project.getName() + "]")
+
+        # Append sub-projects outputs, if inherited
+        for subdependency in project.getDirectDependencies():        
+            #    If the dependency is set to 'all' (or 'hard') we inherit all dependencies
+            # If the dependency is set to 'runtime' we inherit all runtime dependencies
+            # If the dependent project inherited stuff, we inherit that...
+            if        (inherit==gump.model.depend.INHERIT_ALL or inherit==gump.model.depend.INHERIT_HARD)
\
+                    or (inherit==gump.model.depend.INHERIT_RUNTIME and subdependency.isRuntime())
\
+                    or (subdependency.inherit > gump.model.depend.INHERIT_NONE):     

+                subp = self._getDependOutputList(project,subdependency,visited,depth+1,debug)
               
+                if subp:  libpath.importPath(subp)   
+            elif debug:
+                print str(depth) + ') Skip : ' + str(subdependency) + ' in ' + project.name
+
+        return libpath
+                  
+        
\ No newline at end of file

Modified: gump/trunk/python/gump/language/java.py
==============================================================================
--- gump/trunk/python/gump/language/java.py	(original)
+++ gump/trunk/python/gump/language/java.py	Wed Sep  1 11:59:27 2004
@@ -30,7 +30,7 @@
 
 import gump.model.depend
 
-import gump.java.cp
+import gump.language.path
 
 ###############################################################################
 # Classes
@@ -238,6 +238,6 @@
         Import cp and bcp into classpath and bootclasspath,
         but do not accept duplicates. Report duplicates.
         """
-        if cp:  classpath.importClasspath(cp)                
-        if bcp: bootclasspath.importClasspath(bcp)                      
+        if cp:  classpath.importPath(cp)                
+        if bcp: bootclasspath.importPath(bcp)                      
         

Modified: gump/trunk/python/gump/model/builder.py
==============================================================================
--- gump/trunk/python/gump/model/builder.py	(original)
+++ gump/trunk/python/gump/model/builder.py	Wed Sep  1 11:59:27 2004
@@ -251,7 +251,7 @@
     pass
     
 # represents a <nant/> element
-class NAnt(Builder):
+class NAnt(BaseAnt):
     """ A NAnt command (within a project) """
     pass
     

Modified: gump/trunk/python/gump/model/project.py
==============================================================================
--- gump/trunk/python/gump/model/project.py	(original)
+++ gump/trunk/python/gump/model/project.py	Wed Sep  1 11:59:27 2004
@@ -39,7 +39,17 @@
 
 
 class Project(NamedModelObject, Statable, Resultable, Dependable, Positioned):
-    """A single project"""
+    
+    UNSET_LANGUAGE=0
+    JAVA_LANGUAGE=1
+    CSHARP_LANGUAGE=2
+    
+    LANGUAGE_MAP= {
+        'java':JAVA_LANGUAGE,
+        'csharp':CSHARP_LANGUAGE
+    }
+
+    """ A Single project """
     def __init__(self,name,xml,owner):
     	NamedModelObject.__init__(self,name,xml,owner)
     	
@@ -56,7 +66,9 @@
     	self.basedir=None
     	
     	self.license=None
-    	
+        
+        self.languageType=Project.JAVA_LANGUAGE    	
+        
     	self.affectedProjects=[]
         
     	#############################################################
@@ -64,6 +76,7 @@
     	# Sub-Components
     	#
     	self.ant=None
+        self.nant=None
     	self.maven=None
     	self.script=None
 
@@ -237,7 +250,7 @@
         """ Was a build attempt made? """
         return self.built
         
-    def setBuilt(self,built):
+    def setBuilt(self,built=True):
         self.built=built
         
     def hasReports(self):
@@ -402,6 +415,12 @@
         #    message='Unable to complete project.home for: ' + self.name 
         #    self.addError(message)
         #    self.home=None
+        
+        
+        # The language type java or CSharp or ...
+        if self.hasDomAttribute('language'):
+            self.setLanguageTypeFromString(self.getDomAttributeValue('language'))
+        
 
         # Extract license 
         if self.hasDomChild('license'):
@@ -689,7 +708,20 @@
         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]
+        except:
+            message='Language %s not in supported %s.' % (lang, Project.LANGUAGE_MAP.keys())
+            self.addWarning(message)
+            log.warning(message)
+            
+    def getLanguageType(self):
+        return self.languageType
+        
+    def setLanguageType(self,langType):
+        self.languageType=langType
 
 class ProjectStatistics(Statistics):
     """Statistics Holder"""

Modified: gump/trunk/python/gump/run/gumpenv.py
==============================================================================
--- gump/trunk/python/gump/run/gumpenv.py	(original)
+++ gump/trunk/python/gump/run/gumpenv.py	Wed Sep  1 11:59:27 2004
@@ -69,7 +69,8 @@
         self.checked=False
         self.set=False
     	
-    	self.noMaven=False    	 
+        self.noNAnt=False    
+        self.noMaven=False    	 
     	self.noDepot=False    	
     	self.noUpdate=False    
     	self.noSvn=False    	
@@ -177,6 +178,11 @@
             not self._checkExecutable('maven','--version',False,False,'check_maven'): 
             self.noMaven=True
             self.addWarning('"maven" command not found, no Maven builds')
+       
+        if not self.noNAnt and \
+            not self._checkExecutable('NAnt','--help',False,False,'check_NAnt'): 
+            self.noNAnt=True
+            self.addWarning('"NAnt" command not found, no NAnt builds')
        
         self.checked=True
         

Modified: gump/trunk/python/gump/run/gumprun.py
==============================================================================
--- gump/trunk/python/gump/run/gumprun.py	(original)
+++ gump/trunk/python/gump/run/gumprun.py	Wed Sep  1 11:59:27 2004
@@ -108,6 +108,9 @@
         self.builder=None
         self.updater=None
         
+        # Language Helpers
+        self.languages={}
+        
     def setBuilder(self,builder):
         self.builder=builder
         
@@ -120,17 +123,11 @@
     def getUpdater(self):
         return self.updater
 
-    def setJavaHelper(self,javaHelper):
-        self.javaHelper=javaHelper
-        
-    def getJavaHelper(self):
-        return self.javaHelper
-        
-    def setCSharpHelper(self,csharpHelper):
-        self.csharpHelper=csharpHelper
+    def addLanguageHelper(self,language,helper):
+        self.languages[language]=helper
         
-    def getCSharpHelper(self):
-        return self.csharpHelper
+    def getLanguageHelper(self,language):
+        return self.languages[language]
         
     def getRunGuid(self):
         return self.guid

Modified: gump/trunk/python/gump/runner/runner.py
==============================================================================
--- gump/trunk/python/gump/runner/runner.py	(original)
+++ gump/trunk/python/gump/runner/runner.py	Wed Sep  1 11:59:27 2004
@@ -27,6 +27,9 @@
 from gump.update.updater import *
 from gump.build.builder import *
 
+import gump.language.java
+import gump.language.csharp
+
 from gump.document.text.documenter import TextDocumenter
 from gump.document.xdocs.documenter import XDocDocumenter
 from gump.document.xdocs.synchronizer import Synchronizer
@@ -59,13 +62,14 @@
         
         # A helper per language/type
         self.java=gump.language.java.JavaHelper(run)
-        self.java=gump.language.csharp.CSharpHelper(run)
+        self.csharp=gump.language.csharp.CSharpHelper(run)
         
         # Stash them for reference...
         run.setUpdater(self.updater)
-        run.setBuilder(self.builder)        
-        run.setJavaHelper(self.java)  
-        run.setJavaHelper(self.csharp)
+        run.setBuilder(self.builder)    
+            
+        run.addLanguageHelper(Project.JAVA_LANGUAGE,self.java)  
+        run.addLanguageHelper(Project.CSHARP_LANGUAGE,self.csharp)
         
     def initialize(self,exitOnError=True):
         
@@ -192,15 +196,7 @@
         
     def getBuilder(self):
         return self.builder
-        
-    def getJavaHelper(self):
-        """
-        
-        Return the language specific helper
-         
-        """
-        return self.java
-        
+   
     #
     # Call a method called 'documentRun(run)'
     #

Modified: gump/trunk/python/gump/test/model.py
==============================================================================
--- gump/trunk/python/gump/test/model.py	(original)
+++ gump/trunk/python/gump/test/model.py	Wed Sep  1 11:59:27 2004
@@ -31,6 +31,8 @@
 from gump.test import getWorkedTestRun
 from gump.test.pyunit import UnitTestSuite
 
+import gump.model.project
+
 class ModelTestSuite(UnitTestSuite):
     def __init__(self):
         UnitTestSuite.__init__(self)
@@ -55,6 +57,7 @@
         self.project5=self.workspace.getProject('project5')
         self.alias1=self.workspace.getProject('alias1')
         self.maven1=self.workspace.getProject('maven1')
+        self.nant1=self.workspace.getProject('nant1')
         
         self.packagedModule1=self.workspace.getModule('package1')        
         self.module1=self.workspace.getModule('module1')
@@ -87,6 +90,17 @@
         self.assertTrue('Project2 has notifications', self.project2.hasNotifys())
         self.assertFalse('Module2 has NO notifications', self.module2.hasNotifys())
         
+        
+    def testProject(self):
+        
+        self.assertEqual('Project1 is type JAVA', 
+                            self.project1.getLanguageType(),
+                            gump.model.project.Project.JAVA_LANGUAGE)
+        
+        self.assertEqual('NAnt1 is type CSHARP', 
+                            self.nant1.getLanguageType(),
+                            gump.model.project.Project.CSHARP_LANGUAGE)
+        
     def testProperties(self):
         properties=project2.getProperties()
         self.assertNotNone('Project2 has properties', project2.hasProperties())
@@ -196,6 +210,9 @@
     
     def testMaven(self):                
         self.assertTrue('Maven project has a Maven object', self.maven1.hasMaven())
+     
+    def testNAnt(self):                
+        self.assertTrue('NAnt project has a NAnt object', self.nant1.hasNAnt())
  
         
     def testJunitReport(self):

Added: gump/trunk/python/gump/test/nant.py
==============================================================================
--- (empty file)
+++ gump/trunk/python/gump/test/nant.py	Wed Sep  1 11:59:27 2004
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+
+# Copyright 2003-2004 The Apache Software Foundation
+#
+# Licensed 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.
+
+
+"""
+    NAnt Testing
+"""
+
+import os
+import logging
+import types, StringIO
+
+from gump import log
+import gump.core.config
+from gump.model.state import *
+from gump.build.nant import NAntBuilder
+
+import gump.language.csharp
+
+from gump.utils import *
+from gump.test import getWorkedTestRun
+from gump.test.pyunit import UnitTestSuite
+
+class NAntTestSuite(UnitTestSuite):
+    """
+    
+        NAnt Test suite
+        
+    """
+    def __init__(self):
+        UnitTestSuite.__init__(self)
+        
+      
+    def suiteSetUp(self):
+        #
+        # Load a decent Run/Workspace
+        #
+        self.run=getWorkedTestRun()  
+        self.assertNotNone('Needed a run', self.run)
+        self.workspace=self.run.getWorkspace()          
+        self.assertNotNone('Needed a workspace', self.workspace)
+        
+        self.nant1=self.workspace.getProject('nant1')            
+        self.assertNotNone('Needed a nant project', self.nant1)
+        
+        self.nantBuilder=NAntBuilder(self.run)
+        self.csharpHelper=gump.language.csharp.CSharpHelper(self.run)
+   
+    def testNAntCommand(self):                
+        self.assertTrue('NAnt project has a NAnt object', self.nant1.hasNAnt())        
+  
+        cmd=self.nantBuilder.getNAntCommand(self.nant1,self.csharpHelper)
+        
+        cmd.dump()
+        
\ No newline at end of file

Modified: gump/trunk/python/gump/test/pyunit.py
==============================================================================
--- gump/trunk/python/gump/test/pyunit.py	(original)
+++ gump/trunk/python/gump/test/pyunit.py	Wed Sep  1 11:59:27 2004
@@ -329,6 +329,9 @@
     from gump.test.maven import MavenTestSuite  
     runner.addSuite(MavenTestSuite())
     
+    from gump.test.nant import NAntTestSuite  
+    runner.addSuite(NAntTestSuite())
+    
     from gump.test.xref import XRefTestSuite  
     runner.addSuite(XRefTestSuite())
     

Added: gump/trunk/python/gump/test/resources/full1/nant1.xml
==============================================================================
--- (empty file)
+++ gump/trunk/python/gump/test/resources/full1/nant1.xml	Wed Sep  1 11:59:27 2004
@@ -0,0 +1,27 @@
+<module name="nant1">
+
+  <url  href="http://jakarta.apache.org/gump/index.html"/>
+  <description>
+    Test of Gump using NAnt...
+  </description>
+
+  <cvs repository="repository1"/>
+
+  <project name="nant1" language="csharp">
+    <package>org.apache.nant</package>
+
+    <nant target="gump"/>
+
+    <depend project="alias1"/>
+
+    <home nested="dist"/>
+
+    <jar name="lib/nant1.jar" id="nant1"/>
+
+    <license name="LICENSE"/>
+
+    <nag from="Gump Integration Build &lt;general@gump.apache.org&gt;"
+         to="general@gump.apache.org"/>
+  </project>
+</module>
+

Modified: gump/trunk/python/gump/test/resources/full1/profile.xml
==============================================================================
--- gump/trunk/python/gump/test/resources/full1/profile.xml	(original)
+++ gump/trunk/python/gump/test/resources/full1/profile.xml	Wed Sep  1 11:59:27 2004
@@ -15,6 +15,7 @@
   
   <module href="svn_module1.xml"/>
   <module href="maven1.xml"/>
+  <module href="nant1.xml"/>
 
   <server href="server1.xml"/>  
   <server href="server2.xml"/>

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


Mime
View raw message