You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gump.apache.org by le...@apache.org on 2005/07/12 00:43:58 UTC
svn commit: r215893 - in /gump/branches/Gump3/pygump/python/gump:
engine/objectifier.py model/__init__.py
Author: leosimons
Date: Mon Jul 11 15:43:55 2005
New Revision: 215893
URL: http://svn.apache.org/viewcvs?rev=215893&view=rev
Log:
Add support for <configure|make|automake|autoconf/>
Modified:
gump/branches/Gump3/pygump/python/gump/engine/objectifier.py
gump/branches/Gump3/pygump/python/gump/model/__init__.py
Modified: gump/branches/Gump3/pygump/python/gump/engine/objectifier.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/engine/objectifier.py?rev=215893&r1=215892&r2=215893&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/engine/objectifier.py (original)
+++ gump/branches/Gump3/pygump/python/gump/engine/objectifier.py Mon Jul 11 15:43:55 2005
@@ -182,6 +182,10 @@
_create_rmdir_commands(project, project_definition)
_create_mkdir_commands(project, project_definition)
_create_script_commands(project, project_definition, log=log)
+ _create_specific_script_commands(project, project_definition, "configure", Configure, log=log)
+ _create_make_commands(project, project_definition, log=log)
+ _create_specific_script_commands(project, project_definition, "autoconf", Autoconf, log=log)
+ _create_specific_script_commands(project, project_definition, "automake", Automake, log=log)
_create_ant_commands(project, project_definition, log=log)
#TODO more commands
@@ -300,7 +304,7 @@
else:
if value:
args.append(value)
- command.args = args
+ command.args = command.args + args
def _enable_debug(command, cmd):
@@ -331,6 +335,36 @@
shell = cmd.getAttribute("shell")
basedir = cmd.getAttribute("basedir")
command = Script(project, name, shell=shell, basedir=basedir)
+ _create_args(command, cmd, log=log)
+ _create_env_vars(command, cmd, log=log)
+
+ project.add_command(command)
+
+
+def _create_specific_script_commands(project, project_definition, element_name, class_name, log=None):
+ scripts = project_definition.getElementsByTagName(element_name)
+ for cmd in scripts:
+ name = cmd.getAttribute("name")
+ shell = cmd.getAttribute("shell")
+ basedir = cmd.getAttribute("basedir")
+ command = class_name(project, name, shell=shell, basedir=basedir)
+ _create_args(command, cmd, log=log)
+ _create_env_vars(command, cmd, log=log)
+
+ project.add_command(command)
+
+
+def _create_make_commands(project, project_definition, log=None):
+ scripts = project_definition.getElementsByTagName("make")
+ for cmd in scripts:
+ name = cmd.getAttribute("name")
+ shell = cmd.getAttribute("shell")
+ basedir = cmd.getAttribute("basedir")
+ makefile = cmd.getAttribute("makefile")
+ targets = cmd.getAttribute("makefile")
+ if targets:
+ targets = targets.split(",")
+ command = Make(project, name, makefile=makefile, targets=targets, shell=shell, basedir=basedir)
_create_args(command, cmd, log=log)
_create_env_vars(command, cmd, log=log)
Modified: gump/branches/Gump3/pygump/python/gump/model/__init__.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/model/__init__.py?rev=215893&r1=215892&r2=215893&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/model/__init__.py (original)
+++ gump/branches/Gump3/pygump/python/gump/model/__init__.py Mon Jul 11 15:43:55 2005
@@ -577,6 +577,55 @@
def __str__(self):
return "<Script:%s,args=%s,shell=%s,basedir=%s>" % (self.name, " ".join(self.args), self.shell, self.basedir)
+
+class SpecificScript(Script):
+ """Command for executing a specific command.
+
+ Has the following properties:
+ - all the properties a Script has
+ """
+ def __init__(self, project, name, executable, args=None, basedir=None, shell=None):
+ assert isinstance(executable, basestring)
+ Script.__init__(self, project, name, args, basedir, shell)
+ self.args = [executable] + args
+
+ def __str__(self):
+ typerep = str(self.__class__).split('.').pop()
+ return "<%s:%s,args=%s,shell=%s,basedir=%s>" % \
+ (typerep, self.name, " ".join(self.args), self.shell, self.basedir)
+
+
+class Configure(SpecificScript):
+ def __init__(self, project, name, args=None, basedir=None, shell=None):
+ SpecificScript.__init__(self, project, name, "./configure", args, basedir, shell)
+
+
+class Make(SpecificScript):
+ def __init__(self, project, name, makefile=None, targets=None, args=None, basedir=None, shell=None):
+ if not makefile:
+ usemakefile = "Makefile"
+ else:
+ assert isinstance(makefile, basestring)
+ usemakefile = makefile
+
+ Script.__init__(self, project, name, "make", args, basedir, shell)
+ self.args = ["make", "-f", usemakefile]
+ self.args.extend(args)
+ if targets:
+ assert isinstance(targets, list)
+ self.args.extend(targets)
+
+
+class Autoconf(SpecificScript):
+ def __init__(self, project, name, args=None, basedir=None, shell=None):
+ SpecificScript.__init__(self, project, name, "autoconf", args, basedir, shell)
+
+
+class Automake(SpecificScript):
+ def __init__(self, project, name, args=None, basedir=None, shell=None):
+ SpecificScript.__init__(self, project, name, "automake", args, basedir, shell)
+
+
class Ant(Command):
"""Command to run an Ant build.