gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r111532 - /gump/trunk/python/gump/core/build/configure.py /gump/trunk/python/gump/core/build/make.py /gump/trunk/python/gump/core/build/script.py /gump/trunk/python/gump/core/model/builder.py /gump/trunk/python/gump/core/model/project.py
Date Fri, 10 Dec 2004 17:48:20 GMT
Author: bodewig
Date: Fri Dec 10 09:48:18 2004
New Revision: 111532

URL: http://svn.apache.org/viewcvs?view=rev&rev=111532
Log:
Add support for nested command line args to <make>, <configure> and <script>
Modified:
   gump/trunk/python/gump/core/build/configure.py
   gump/trunk/python/gump/core/build/make.py
   gump/trunk/python/gump/core/build/script.py
   gump/trunk/python/gump/core/model/builder.py
   gump/trunk/python/gump/core/model/project.py

Modified: gump/trunk/python/gump/core/build/configure.py
Url: http://svn.apache.org/viewcvs/gump/trunk/python/gump/core/build/configure.py?view=diff&rev=111532&p1=gump/trunk/python/gump/core/build/configure.py&r1=111531&p2=gump/trunk/python/gump/core/build/configure.py&r2=111532
==============================================================================
--- gump/trunk/python/gump/core/build/configure.py	(original)
+++ gump/trunk/python/gump/core/build/configure.py	Fri Dec 10 09:48:18 2004
@@ -29,6 +29,7 @@
 
 from gump import log
 from gump.core.run.gumprun import *
+from gump.core.build.script import getArgs
 from gump.core.config import dir, default, basicConfig
 
 from gump.util import dump, display, getIndent, logResourceUtilization, \
@@ -104,9 +105,9 @@
         
         cmd=Cmd(scriptfile,'buildscript_'+project.getModule().getName()+'_'+project.getName(),\
             basedir)    
+        cmd.addParameters(getArgs(configure))
         
         return cmd
-        
         
     def preview(self,project,languageHelper,stats):        
         """

Modified: gump/trunk/python/gump/core/build/make.py
Url: http://svn.apache.org/viewcvs/gump/trunk/python/gump/core/build/make.py?view=diff&rev=111532&p1=gump/trunk/python/gump/core/build/make.py&r1=111531&p2=gump/trunk/python/gump/core/build/make.py&r2=111532
==============================================================================
--- gump/trunk/python/gump/core/build/make.py	(original)
+++ gump/trunk/python/gump/core/build/make.py	Fri Dec 10 09:48:18 2004
@@ -29,6 +29,7 @@
 
 from gump import log
 from gump.core.run.gumprun import *
+from gump.core.build.script import getArgs
 from gump.core.config import dir, default, basicConfig
 
 from gump.util import dump, display, getIndent, logResourceUtilization, \
@@ -103,14 +104,16 @@
         target= make.getTarget()
 
         # The make file (or none == Makefile)
-        buildfile = make.getBuildFile()
+        makefile = make.getMakeFile()
 
         cmd=Cmd('make','build_'+project.getModule().getName()+'_'+project.getName(),
             basedir)
         
-        # Pass the buildfile
-        if buildfile: cmd.addParameter('-f', buildfile)
+        # Pass the makefile
+        if makefile: cmd.addParameter('-f', makefile)
     
+        cmd.addParameters(getArgs(make))
+
         # End with the target (or targets)...
         if target: 
             for targetParam in target.split():

Modified: gump/trunk/python/gump/core/build/script.py
Url: http://svn.apache.org/viewcvs/gump/trunk/python/gump/core/build/script.py?view=diff&rev=111532&p1=gump/trunk/python/gump/core/build/script.py&r1=111531&p2=gump/trunk/python/gump/core/build/script.py&r2=111532
==============================================================================
--- gump/trunk/python/gump/core/build/script.py	(original)
+++ gump/trunk/python/gump/core/build/script.py	Fri Dec 10 09:48:18 2004
@@ -48,6 +48,23 @@
 
 
 ###############################################################################
+# Functions
+###############################################################################
+def getArgs(script):
+    """ Get command line args for a script builder (or other arg supporters) """
+    args = Parameters()
+    for arg in script.getProperties():
+        if arg.name.startswith('--') or not arg.name.startswith('-'):
+            if arg.value:
+                args.addNamedParameter(arg.name,arg.value,'=')
+            else:
+                args.addParameter(arg.name)
+        else:
+            args.addParameter(arg.name)
+            args.addParameter(arg.value)
+    return args
+        
+###############################################################################
 # Classes
 ###############################################################################
 
@@ -126,6 +143,8 @@
                  basedir,
                  {'CLASSPATH':classpath})    
         
+        cmd.addParameters(getArgs(script))
+
         return cmd
         
     def preview(self,project,languageHelper,stats):        

Modified: gump/trunk/python/gump/core/model/builder.py
Url: http://svn.apache.org/viewcvs/gump/trunk/python/gump/core/model/builder.py?view=diff&rev=111532&p1=gump/trunk/python/gump/core/model/builder.py&r1=111531&p2=gump/trunk/python/gump/core/model/builder.py&r2=111532
==============================================================================
--- gump/trunk/python/gump/core/model/builder.py	(original)
+++ gump/trunk/python/gump/core/model/builder.py	Fri Dec 10 09:48:18 2004
@@ -255,12 +255,6 @@
     """ A NAnt command (within a project) """
     pass
     
-# represents a <make/> element
-# will probably need to extend Builder directly later
-class Make(BaseAnt):
-    """ A make command (within a project) """
-    pass
-
 # represents an <maven/> element
 class Maven(Builder):
     """ A Maven command (within a project)"""
@@ -279,11 +273,53 @@
         i=getIndent(indent+1)
         output.write(i+'Goal: ' + self.getGoal() + '\n')
 
+# represents an <configure/> element
+class Configure(Builder):
+    """ A configure command (within a project)"""
+
+    def __init__(self,dom,project):
+        Builder.__init__(self,dom,project)
+
+    def expandDomProperties(self,project,workspace):
+        #
+        # convert Ant property elements which reference a project 
+        # into dependencies
+        #
+        for pdom in self.getDomChildIterator('arg'):
+            self.expandDomProperty(pdom,project,workspace)       
+            self.importProperty(pdom)
+
+# represents a <make/> element
+# will probably need to extend Builder directly later
+class Make(Configure):
+    """ A make command (within a project) """
+
+    def __init__(self,dom,project):
+    	Configure.__init__(self,dom,project)
+        # Import the target
+        self.target=self.getDomAttributeValue('target')
+        # Import the makefile
+        self.makefile=self.getDomAttributeValue('makefile')
+            
+    def hasTarget(self):
+        if self.target: return True
+        return False
+        
+    def getTarget(self):
+        return self.target
+        
+    def hasMakeFile(self):
+        if selfmakefile: return True
+        return False
+        
+    def getMakeFile(self):
+        return self.makefile
+
 # represents an <script/> element
-class Script(Builder):
+class Script(Configure):
     """ A script command (within a project)"""
     def __init__(self,dom,project):
-    	Builder.__init__(self,dom,project)
+    	Configure.__init__(self,dom,project)
     	
     	# Get the name
     	self.name=self.getDomAttributeValue('name','unset')
@@ -291,9 +327,3 @@
     def getName(self):
         return self.name
 
-# represents an <configure/> element
-class Configure(Builder):
-    """ A configure command (within a project)"""
-    pass
-
-    	

Modified: gump/trunk/python/gump/core/model/project.py
Url: http://svn.apache.org/viewcvs/gump/trunk/python/gump/core/model/project.py?view=diff&rev=111532&p1=gump/trunk/python/gump/core/model/project.py&r1=111531&p2=gump/trunk/python/gump/core/model/project.py&r2=111532
==============================================================================
--- gump/trunk/python/gump/core/model/project.py	(original)
+++ gump/trunk/python/gump/core/model/project.py	Fri Dec 10 09:48:18 2004
@@ -555,6 +555,9 @@
         if self.ant: self.ant.expand(self,workspace)
         if self.maven: self.maven.expand(self,workspace)
         if self.script: self.script.expand(self,workspace)
+        if self.nant: self.nant.expand(self,workspace)
+        if self.make: self.make.expand(self,workspace)
+        if self.configure: self.configure.expand(self,workspace)
 
         if not packaged:
             # Complete dependencies so properties can reference the,
@@ -593,6 +596,18 @@
         if self.script: 
             self.script.complete(self,workspace)
             transferAnnotations(self.script, self)              
+            
+        if self.nant: 
+            self.nant.complete(self,workspace)
+            transferAnnotations(self.nant, self)  
+            
+        if self.make: 
+            self.make.complete(self,workspace)
+            transferAnnotations(self.make, self)  
+            
+        if self.configure: 
+            self.configure.complete(self,workspace)
+            transferAnnotations(self.configure, self)  
             
         if not packaged:    
             #

Mime
View raw message