gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1679390 - in /gump/live/python/gump/core/model: builder.py project.py
Date Thu, 14 May 2015 15:26:36 GMT
Author: bodewig
Date: Thu May 14 15:26:35 2015
New Revision: 1679390

URL: http://svn.apache.org/r1679390
Log:
model for nuget builder

Modified:
    gump/live/python/gump/core/model/builder.py
    gump/live/python/gump/core/model/project.py

Modified: gump/live/python/gump/core/model/builder.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/model/builder.py?rev=1679390&r1=1679389&r2=1679390&view=diff
==============================================================================
--- gump/live/python/gump/core/model/builder.py (original)
+++ gump/live/python/gump/core/model/builder.py Thu May 14 15:26:35 2015
@@ -544,3 +544,44 @@ class Gradle(Builder):
                 or self.local_repo in ['True', 'true']:
             return None
         return self.local_repo
+
+# represents an <nuget/> element
+class NuGet(Builder):
+    """ A NuGet command (within a project)"""
+    def __init__(self, dom, project):
+        Builder.__init__(self, dom, project)
+
+        # Import the command
+        self.command = self.getDomAttributeValue('command', 'restore')
+        self.solution = self.getDomAttributeValue('solution')
+
+    def hasCommand(self):
+        if self.command:
+            return True
+        return False
+
+    def getCommand(self):
+        return self.command
+
+    def hasSolution(self):
+        if self.solution:
+            return True
+        return False
+
+    def getSolution(self):
+        return self.solution
+
+    def expandDomProperties(self, project, workspace):
+        for pdom in self.getDomChildIterator('arg'):
+            self.expandDomProperty(pdom, project, workspace)
+            self.importProperty(pdom)
+
+    def dump(self, indent=0, output=sys.stdout):
+        """ Display the contents of this object """
+        Builder.dump(self, indent, output)
+        i = getIndent(indent+1)
+        if self.hasCommand():
+            output.write(i+'Command: ' + self.getCommand() + '\n')
+        if self.hasSolution():
+            output.write(i+'Solution: ' + self.getSolution() + '\n')
+

Modified: gump/live/python/gump/core/model/project.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/model/project.py?rev=1679390&r1=1679389&r2=1679390&view=diff
==============================================================================
--- gump/live/python/gump/core/model/project.py (original)
+++ gump/live/python/gump/core/model/project.py Thu May 14 15:26:35 2015
@@ -29,7 +29,8 @@ import gump.util.process.command
 from gump import log
 from gump.core.config import default
 from gump.core.model.builder import Ant, NAnt, Maven1, Maven, MvnInstall, \
-    MVN_VERSION2, MVN_VERSION3, Script, Configure, Make, Gradle, MSBuild
+    MVN_VERSION2, MVN_VERSION3, Script, Configure, Make, Gradle, MSBuild, \
+    NuGet
 from gump.core.model.depend import Dependable, importDomDependency
 from gump.core.model.misc import AddressPair, \
     Resultable, Positioned, Mkdir, Delete, Report, Work
@@ -83,6 +84,7 @@ class Project(NamedModelObject, Statable
         self.ant = None
         self.nant = None
         self.msbuild = None
+        self.nuget = None
         self.maven = None
         self.mvn = None
         self.script = None
@@ -178,6 +180,11 @@ class Project(NamedModelObject, Statable
             return True
         return False
 
+    def hasNuGet(self):
+        if self.nuget:
+            return True
+        return False
+
     def hasMaven(self):
         if self.maven:
             return True
@@ -217,6 +224,9 @@ class Project(NamedModelObject, Statable
     def getMSBuild(self):
         return self.msbuild
 
+    def getNuGet(self):
+        return self.nuget
+
     def getMaven(self):
         return self.maven
 
@@ -471,6 +481,11 @@ class Project(NamedModelObject, Statable
             self.msbuild = MSBuild(self.getDomChild('msbuild'), self)
             self.builder.append(self.msbuild)
 
+        # Import any <nuget part [if not packaged]
+        if self.hasDomChild('nuget') and not packaged:
+            self.msbuild = NuGet(self.getDomChild('nuget'), self)
+            self.builder.append(self.nuget)
+
         # Import any <maven part [if not packaged]
         for tag in ['maven', 'mvn1']:
             if self.hasDomChild(tag) and not packaged:



Mime
View raw message