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/11 07:59:08 UTC
svn commit: r962990 - in /gump/trunk/python/gump:
actor/document/xdocs/documenter.py core/build/nant.py
core/language/csharp.py core/language/path.py
Author: bodewig
Date: Sun Jul 11 05:59:07 2010
New Revision: 962990
URL: http://svn.apache.org/viewvc?rev=962990&view=rev
Log:
There is no such thing like an AssemblyPath in .NET
Modified:
gump/trunk/python/gump/actor/document/xdocs/documenter.py
gump/trunk/python/gump/core/build/nant.py
gump/trunk/python/gump/core/language/csharp.py
gump/trunk/python/gump/core/language/path.py
Modified: gump/trunk/python/gump/actor/document/xdocs/documenter.py
URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/actor/document/xdocs/documenter.py?rev=962990&r1=962989&r2=962990&view=diff
==============================================================================
--- gump/trunk/python/gump/actor/document/xdocs/documenter.py (original)
+++ gump/trunk/python/gump/actor/document/xdocs/documenter.py Sun Jul 11 05:59:07 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/trunk/python/gump/core/build/nant.py
URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/core/build/nant.py?rev=962990&r1=962989&r2=962990&view=diff
==============================================================================
--- gump/trunk/python/gump/core/build/nant.py (original)
+++ gump/trunk/python/gump/core/build/nant.py Sun Jul 11 05:59:07 2010
@@ -73,7 +73,7 @@ class NAntBuilder(RunSpecific):
# For now, things are going good...
project.changeState(STATE_SUCCESS)
- def getNAntCommand(self, project, languageHelper):
+ def getNAntCommand(self, project, _languageHelper):
"""
Build an NANT command for this project, based on the <nant metadata
select targets and build files as appropriate.
@@ -102,23 +102,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)
# Get system properties
sysproperties = self.getNAntSysProperties(project)
- # Library Path
- libpath = languageHelper.getAssemblyPath(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.
Modified: gump/trunk/python/gump/core/language/csharp.py
URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/core/language/csharp.py?rev=962990&r1=962989&r2=962990&view=diff
==============================================================================
--- gump/trunk/python/gump/core/language/csharp.py (original)
+++ gump/trunk/python/gump/core/language/csharp.py Sun Jul 11 05:59:07 2010
@@ -18,207 +18,17 @@
"""
- 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
-
-from gump.core.language.path import AnnotatedPath, AssemblyPath
+from gump.core.run.gumprun import RunSpecific
###############################################################################
# Classes
###############################################################################
-class CSharpHelper(gump.core.run.gumprun.RunSpecific):
+class CSharpHelper(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 = AssemblyPath('Assembly Path')
-
- # Add this project's work directories
- for work in project.getWorks():
- path = work.getResolvedPath()
- if path:
- libpath.addPathPart(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 = 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 = 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
-
-
+ RunSpecific.__init__(self, run)
Modified: gump/trunk/python/gump/core/language/path.py
URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/core/language/path.py?rev=962990&r1=962989&r2=962990&view=diff
==============================================================================
--- gump/trunk/python/gump/core/language/path.py (original)
+++ gump/trunk/python/gump/core/language/path.py Sun Jul 11 05:59:07 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