You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gump.apache.org by bo...@apache.org on 2010/07/13 06:10:32 UTC

svn commit: r963596 - in /gump/live: ./ python/gump/actor/document/xdocs/ python/gump/core/build/ python/gump/core/language/ python/gump/core/update/ python/gump/test/

Author: bodewig
Date: Tue Jul 13 04:10:31 2010
New Revision: 963596

URL: http://svn.apache.org/viewvc?rev=963596&view=rev
Log:
merge NAnt changes from trunk - there is no such thing like an AssemblyPath in .NET

Modified:
    gump/live/   (props changed)
    gump/live/python/gump/actor/document/xdocs/documenter.py
    gump/live/python/gump/core/build/nant.py
    gump/live/python/gump/core/language/csharp.py
    gump/live/python/gump/core/language/java.py   (props changed)
    gump/live/python/gump/core/language/path.py
    gump/live/python/gump/core/update/bzr.py   (props changed)
    gump/live/python/gump/core/update/darcs.py   (props changed)
    gump/live/python/gump/core/update/hg.py   (props changed)
    gump/live/python/gump/test/nant.py

Propchange: gump/live/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 13 04:10:31 2010
@@ -1 +1 @@
-/gump/trunk:746160,746727,746892,747270,747272-747273,747656,748010,748018,748028,748661,748967,760784-761159,815848,953630-954169,955387,955837,956771,957107,957408,958453,958915,959344,959847,960260,960295,960297,960300,960303,961244,961577,961843,961859,961870,962401,962981,963021-963048
+/gump/trunk:746160,746727,746892,747270,747272-747273,747656,748010,748018,748028,748661,748967,760784-761159,815848,953630-954169,955387,955837,956771,957107,957408,958453,958915,959344,959847,960260,960295,960297,960300,960303,961244,961577,961843,961859,961870,962395,962401,962981,962990,962993,963021-963048

Modified: gump/live/python/gump/actor/document/xdocs/documenter.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/actor/document/xdocs/documenter.py?rev=963596&r1=963595&r2=963596&view=diff
==============================================================================
--- gump/live/python/gump/actor/document/xdocs/documenter.py (original)
+++ gump/live/python/gump/actor/document/xdocs/documenter.py Tue Jul 13 04:10:31 2010
@@ -2044,11 +2044,6 @@ This page helps Gumpmeisters (and others
                                       project)
                 self.displayClasspath(miscSection, bootclasspath,
                                       'Boot Classpath', project)
-            elif Project.CSHARP_LANGUAGE == language:
-                csharpHelper = helper
-                libpath = csharpHelper.getAssemblyPathObject(project)
-                self.displayClasspath(miscSection, libpath, 'Assemblies',
-                                      project)
         else:
             miscSection.createParagraph('No build command (so classpaths/' + \
                                             'assembly path irrelevant)')

Modified: gump/live/python/gump/core/build/nant.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/build/nant.py?rev=963596&r1=963595&r2=963596&view=diff
==============================================================================
--- gump/live/python/gump/core/build/nant.py (original)
+++ gump/live/python/gump/core/build/nant.py Tue Jul 13 04:10:31 2010
@@ -26,6 +26,23 @@ from gump.util.work import CommandWorkIt
 from gump.core.model.state import REASON_BUILD_FAILED, REASON_BUILD_TIMEDOUT, \
     REASON_PREBUILD_FAILED, STATE_FAILED, STATE_SUCCESS
 
+def getNAntProperties(project):
+    """ Get properties for a project """
+    return collect_properties(project.getWorkspace().getProperties() + \
+                                  project.getNAnt().getProperties())
+
+def getNAntSysProperties(project):
+    """ Get sysproperties for a project """
+    return collect_properties(project.getWorkspace().getSysProperties() + \
+                                  project.getNAnt().getSysProperties())
+
+def collect_properties(props):
+    """ collect named properties for a project """
+    properties = Parameters()
+    for prop in props:
+        properties.addPrefixedNamedParameter('-D:', prop.name, prop.value, '=')
+    return properties
+
 class NAntBuilder(RunSpecific):
     """
         A NAnt builder (uses nant to build projects)
@@ -38,7 +55,7 @@ class NAntBuilder(RunSpecific):
         """ 
         RunSpecific.__init__(self, run)
 
-    def buildProject(self, project, language, _stats):
+    def buildProject(self, project, _language, _stats):
         """
                 Build a project using NAnt, based off the <nant metadata.
 
@@ -52,7 +69,7 @@ class NAntBuilder(RunSpecific):
                      '] : ' + project.getName())
 
         # Get the appropriate build command...
-        cmd = self.getNAntCommand(project, language)
+        cmd = self.getNAntCommand(project)
 
         if cmd:
             # Execute the command ....
@@ -73,7 +90,7 @@ class NAntBuilder(RunSpecific):
                 # For now, things are going good...
                 project.changeState(STATE_SUCCESS)
 
-    def getNAntCommand(self, project, languageHelper):
+    def getNAntCommand(self, project):
         """
         Build an NANT command for this project, based on the <nant metadata
         select targets and build files as appropriate.
@@ -102,23 +119,17 @@ class NAntBuilder(RunSpecific):
         # Where to run this:
         basedir = nant.getBaseDirectory() or project.getBaseDirectory()
 
-        # Build a classpath (based upon dependencies)
-        #(classpath, bootclasspath) = language.getClasspaths(project)
-
         # Get properties
-        properties = self.getNAntProperties(project)
+        properties = getNAntProperties(project)
 
         # Get system properties
-        sysproperties = self.getNAntSysProperties(project)
-
-        # Library Path
-        libpath = languageHelper.getAssemblyPath(project)
+        sysproperties = getNAntSysProperties(project)
 
         # Run NAnt...
         cmd = Cmd(self.run.env.get_nant_command(),
                   'build_' + project.getModule().getName() + '_' + \
                     project.getName(), 
-                  basedir, {'DEVPATH' : libpath})
+                  basedir)
 
         # Launch with specified framework (e.g. mono-1.0.1) if
         # required.
@@ -159,28 +170,10 @@ class NAntBuilder(RunSpecific):
 
         return cmd
 
-    def getNAntProperties(self, project):
-        """ Get properties for a project """
-        properties = Parameters()
-        for prop in project.getWorkspace().getProperties() + \
-                project.getNAnt().getProperties():
-            properties.addPrefixedNamedParameter('-D:', prop.name, 
-                                                 prop.value, '=')
-        return properties
-
-    def getNAntSysProperties(self, project):
-        """ Get sysproperties for a project """
-        properties = Parameters()
-        for prop in project.getWorkspace().getSysProperties() + \
-                project.getNAnt().getSysProperties():
-            properties.addPrefixedNamedParameter('-D:', prop.name, 
-                                                 prop.value, '=')
-        return properties
-
-    def preview(self, project, language, _stats):
+    def preview(self, project, _language, _stats):
         """
                 Preview what an NAnt build would look like.
         """
-        cmd = self.getNAntCommand(project, language) 
+        cmd = self.getNAntCommand(project) 
         cmd.dump()
  

Modified: gump/live/python/gump/core/language/csharp.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/language/csharp.py?rev=963596&r1=963595&r2=963596&view=diff
==============================================================================
--- gump/live/python/gump/core/language/csharp.py (original)
+++ gump/live/python/gump/core/language/csharp.py Tue Jul 13 04:10:31 2010
@@ -11,193 +11,24 @@
 #     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,
+# 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
+C# specific support
 
 """
 
-from gump import log
-
-import os.path
-
-import gump.core.run.gumprun
-import gump.util.process.command
-
-import gump.core.model.depend
-
-import gump.core.language.path
+from gump.core.run.gumprun import RunSpecific
 
 ###############################################################################
 # Classes
 ###############################################################################
 
-class CSharpHelper(gump.core.run.gumprun.RunSpecific):
-    
-    def __init__(self,run):
-        gump.core.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.core.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.core.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/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 ***
-            
-           """            
-   
-        # 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.core.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 output in project.getOutputs():
-            # Store for double checking
-            if output.getId(): projectIds.append(output.getId())
-            
-            # If 'all' or in ids list:
-            if (not ids) or (output.getId() in ids):   
-                if ids: dependStr += ' Id = ' + output.getId()
-                path=gump.core.language.path.AnnotatedPath(output.getId(),output.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.core.model.depend.INHERIT_ALL or inherit==gump.core.model.depend.INHERIT_HARD) \
-                    or (inherit==gump.core.model.depend.INHERIT_RUNTIME and subdependency.isRuntime()) \
-                    or (subdependency.inherit > gump.core.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
-                  
-        
+class CSharpHelper(RunSpecific):
+
+    def __init__(self, run):
+        RunSpecific.__init__(self, run)

Propchange: gump/live/python/gump/core/language/java.py
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 13 04:10:31 2010
@@ -1 +1 @@
-/gump/trunk/python/gump/core/language/java.py:746160,746727,746892,747270,747272-747273,747656,748010,748018,748028,748661,748967,760784-761159,815848,953630-954169,955387,955837,956771,957107,957408,958453,958915,959344,959847,960260,960295,960297,960300,960303,961244,962395,962401,962981,963021-963048
+/gump/trunk/python/gump/core/language/java.py:746160,746727,746892,747270,747272-747273,747656,748010,748018,748028,748661,748967,760784-761159,815848,953630-954169,955387,955837,956771,957107,957408,958453,958915,959344,959847,960260,960295,960297,960300,960303,961244,962395,962401,962981,962990,962993,963021-963048

Modified: gump/live/python/gump/core/language/path.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/language/path.py?rev=963596&r1=963595&r2=963596&view=diff
==============================================================================
--- gump/live/python/gump/core/language/path.py (original)
+++ gump/live/python/gump/core/language/path.py Tue Jul 13 04:10:31 2010
@@ -17,7 +17,7 @@
 
 """
 
-    Paths (e.g. Java Classpaths, CSharp Assembly Paths, etc.)
+    Paths (e.g. Java Classpaths etc.)
     
 """
 
@@ -136,4 +136,3 @@ class ArtifactPath(Annotatable):
         return os.pathsep.join(self.getSimplePathList())
             
 class Classpath(ArtifactPath): pass
-class AssemblyPath(ArtifactPath): pass

Propchange: gump/live/python/gump/core/update/bzr.py
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 13 04:10:31 2010
@@ -1 +1 @@
-/gump/trunk/python/gump/core/update/bzr.py:815848,953630-954169,955387,955837,956771,957107,957408,958453,958915,959344,959847,960260,960295,960297,960300,960303,961244,961577,961843,961859,961870,962401,962981,963021-963048
+/gump/trunk/python/gump/core/update/bzr.py:815848,953630-954169,955387,955837,956771,957107,957408,958453,958915,959344,959847,960260,960295,960297,960300,960303,961244,961577,961843,961859,961870,962395,962401,962981,962990,962993,963021-963048

Propchange: gump/live/python/gump/core/update/darcs.py
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 13 04:10:31 2010
@@ -1 +1 @@
-/gump/trunk/python/gump/core/update/darcs.py:815848,953630-954169,955387,955837,956771,957107,957408,958453,958915,959344,959847,960260,960295,960297,960300,960303,961244,961577,961843,961859,961870,962401,962981,963021-963048
+/gump/trunk/python/gump/core/update/darcs.py:815848,953630-954169,955387,955837,956771,957107,957408,958453,958915,959344,959847,960260,960295,960297,960300,960303,961244,961577,961843,961859,961870,962395,962401,962981,962990,962993,963021-963048

Propchange: gump/live/python/gump/core/update/hg.py
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 13 04:10:31 2010
@@ -1 +1 @@
-/gump/trunk/python/gump/core/update/hg.py:815848,953630-954169,955387,955837,956771,957107,957408,958453,958915,959344,959847,960260,960295,960297,960300,960303,961244,961577,961843,961859,961870,962401,962981,963021-963048
+/gump/trunk/python/gump/core/update/hg.py:815848,953630-954169,955387,955837,956771,957107,957408,958453,958915,959344,959847,960260,960295,960297,960300,960303,961244,961577,961843,961859,961870,962395,962401,962981,962990,962993,963021-963048

Modified: gump/live/python/gump/test/nant.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/test/nant.py?rev=963596&r1=963595&r2=963596&view=diff
==============================================================================
--- gump/live/python/gump/test/nant.py (original)
+++ gump/live/python/gump/test/nant.py Tue Jul 13 04:10:31 2010
@@ -29,8 +29,6 @@ import gump.core.config
 from gump.core.model.state import *
 from gump.core.build.nant import NAntBuilder
 
-import gump.core.language.csharp
-
 from gump.util import *
 from gump.test import getWorkedTestRun
 from gump.test.pyunit import UnitTestSuite
@@ -58,12 +56,11 @@ class NAntTestSuite(UnitTestSuite):
         self.assertNotNone('Needed a nant project', self.nant1)
         
         self.nantBuilder=NAntBuilder(self.run)
-        self.csharpHelper=gump.core.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=self.nantBuilder.getNAntCommand(self.nant1)
         
         #cmd.dump()