You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@gump.apache.org by aj...@apache.org on 2003/11/24 19:32:20 UTC
cvs commit: jakarta-gump/project svn-test.xml
ajack 2003/11/24 10:32:20
Modified: python/gump/model module.py
python/gump engine.py update.py gumprun.py integrate.py
build.py
python/gump/utils __init__.py
profile gump.xml
. .cvsignore
Added: repository apache-svn-sandbox.xml
project svn-test.xml
Log:
Work on SVN.
Revision Changes Path
1.14 +40 -19 jakarta-gump/python/gump/model/module.py
Index: module.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/model/module.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- module.py 24 Nov 2003 16:14:06 -0000 1.13
+++ module.py 24 Nov 2003 18:32:19 -0000 1.14
@@ -138,19 +138,23 @@
ModelObject.__init__(self,xml)
# Reference to the shared repository
- self.repository=repository
-
+ self.repository=repository
+
# Extract settings
- if xml.url:
- self.url = str(xml.url)
- elif self.repository.hasUrl():
- self.url = self.repository.getUrl()
-
- def hasUrl(self):
- return (hasattr(self,'url') and self.url)
+ if xml.dir:
+ self.dir = str(xml.dir)
+
+ def getRootUrl(self):
+ url=self.repository.getUrl()
+ if self.hasDir():
+ url+=self.getDir()
+ return url
- def getUrl(self):
- return self.url
+ def hasDir(self):
+ return (hasattr(self,'dir') and self.dir)
+
+ def getDir(self):
+ return self.dir
class ModuleJars(ModelObject):
def __init__(self,xml,repository):
@@ -485,13 +489,16 @@
return self.workspace
def hasCvs(self):
- return hasattr(self,'cvs') and self.cvs
+ if hasattr(self,'cvs') and self.cvs: return 1
+ return 0
def hasSvn(self):
- return hasattr(self,'svn') and self.svn
+ if hasattr(self,'svn') and self.svn: return 1
+ return 0
def hasJars(self):
- return hasattr(self,'jars') and self.jars
+ if hasattr(self,'jars') and self.jars: return 1
+ return 0
# Where the contents (at the repository) updated?
def isUpdated(self):
@@ -588,7 +595,7 @@
log.debug("SubVersion Update Module " + self.getName() + \
", Repository Name: " + str(self.repository.getName()))
- url=self.svn.getUrl()
+ url=self.svn.getRootUrl()
log.debug("SVN URL: [" + url + "] on Repository: " + self.repository.getName())
@@ -606,22 +613,36 @@
# do a cvs checkout
cmd.addParameter('checkout')
- if self.svn.hasUrl():
- cmd.addParameter(self.svn.getUrl())
+ cmd.addParameter(url)
#
# Be 'quiet' (but not silent) unless requested otherwise.
#
- if not self.isDebug() \
+ if and not self.isDebug() \
and not self.isVerbose() \
and not self.svn.isDebug() \
and not self.svn.isVerbose():
- cmd.addParameter('-q')
+ cmd.addParameter('--quiet')
+
#
+ # Allow trace for debug
+ #
+ if self.isDebug() or self.svn.isDebug():
+ cmd.addParameter('--verbose')
+
+ #
# Request non-interactive
#
cmd.addParameter('--non-interactive')
+
+ #
+ # If module name != SVN directory, tell SVN to put it into
+ # a directory named after our module
+ #
+ if not self.svn.getDir() == self.getName():
+ cmd.addParameter(self.getName())
+
return (self.repository, url, cmd)
1.17 +14 -15 jakarta-gump/python/gump/engine.py
Index: engine.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/engine.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- engine.py 24 Nov 2003 01:45:15 -0000 1.16
+++ engine.py 24 Nov 2003 18:32:19 -0000 1.17
@@ -84,13 +84,6 @@
log.warn(message)
def integrate(self,run):
-
- workspace=run.getWorkspace()
- gumpSet = run.getGumpSet()
-
- projects=gumpSet.getProjects()
- sequence=gumpSet.getSequence()
- modules=gumpSet.getModules()
#
# Prepare the context
@@ -100,17 +93,12 @@
#
# Checkout from source code repositories
#
- self.updateModules(run)
-
- #
- # Checkout from source code repositories
- #
- self.syncWorkDirs(run)
+ self.update(run)
#
# Run the build commands
#
- self.buildProjectSequence(run,sequence)
+ self.build(run)
#
# Only an 'all' is an official build, for them:
@@ -156,7 +144,18 @@
******************************************************************
"""
-
+ def update(self, run):
+
+ #
+ # Checkout from source code repositories
+ #
+ self.updateModules(run)
+
+ #
+ # Checkout from source code repositories
+ #
+ self.syncWorkDirs(run)
+
def updateModules(self, run):
workspace = run.getWorkspace()
1.22 +66 -88 jakarta-gump/python/gump/update.py
Index: update.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/update.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- update.py 18 Nov 2003 00:29:49 -0000 1.21
+++ update.py 24 Nov 2003 18:32:19 -0000 1.22
@@ -1,97 +1,75 @@
-#!/usr/bin/env python
-
-# $Header$
-# $Revision$
-# $Date$
-#
-# ====================================================================
-#
-# The Apache Software License, Version 1.1
-#
-# Copyright (c) 2003 The Apache Software Foundation. All rights
-# reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-#
-# 3. The end-user documentation included with the redistribution, if
-# any, must include the following acknowlegement:
-# "This product includes software developed by the
-# Apache Software Foundation (http://www.apache.org/)."
-# Alternately, this acknowlegement may appear in the software itself,
-# if and wherever such third-party acknowlegements normally appear.
-#
-# 4. The names "The Jakarta Project", "Alexandria", and "Apache Software
-# Foundation" must not be used to endorse or promote products derived
-# from this software without prior written permission. For written
-# permission, please contact apache@apache.org.
-#
-# 5. Products derived from this software may not be called "Apache"
-# nor may "Apache" appear in their names without prior written
-# permission of the Apache Group.
-#
-# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
-# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-# ====================================================================
-#
-# This software consists of voluntary contributions made by many
-# individuals on behalf of the Apache Software Foundation. For more
-# information on the Apache Software Foundation, please see
-# <http://www.apache.org/>.
-
+#!/usr/bin/python
"""
-Execute the appropriate cvs checkout or update commands
+ This is the commandline entrypoint into gump.
+
+ It at the moment basically
+ calls gump.load() to get the workspace, then dumps
+ information about what it should be doing to stdout.
+
+ The main thing to do here is to clone dumpDeps to create a
+ build() method which executes the appropriate script
+ (probably only ant at the moment; would be nice to have
+ support for maven) for each of the dependencies.
"""
+
+import os.path
import os
+import sys
+import logging
-from gump import log, load
-from gump.conf import *
-from gump.model import Module,Repository
-from gump.context import *
-from gump.launcher import Cmd,CmdResult,execute
-from gump.logic import *
-from gump.utils import dump
-from gump.net.cvs import *
+from gump import log
+from gump.engine import GumpEngine
+from gump.gumprun import GumpRun, GumpRunOptions, GumpSet
+from gump.utils.commandLine import handleArgv
+from gump.model.loader import WorkspaceLoader
-if __name__=='__main__':
- # init logging
- logging.basicConfig()
+###############################################################################
+# Initialize
+###############################################################################
+
+
+###############################################################################
+# Functions
+###############################################################################
+
+# static void main()
+if __name__=='__main__':
- #set verbosity to show all messages of severity >= default.logLevel
- log.setLevel(default.logLevel)
+ # Process command line
+ args = handleArgv(sys.argv)
+ ws=args[0]
+ ps=args[1]
+
+ # get parsed workspace definition
+ workspace=WorkspaceLoader().load(ws)
+
+ #
+ # Check Environment (eventually not do this each time)
+ # Exit if problems...
+ #
+ #checkEnvironment(workspace,context,1)
+
+ #
+ # Check projects (and such) in workspace...
+ # Store results in context, do not display
+ # to screen.
+ #
+ #check(workspace, ps, context, 0)
+
+ # TODO populate...
+ options=GumpRunOptions()
+
+ # The Run Details...
+ run=GumpRun(workspace,ps,options)
+
+ #
+ # Perform this integration run...
+ #
+ result = GumpEngine().update(run)
- args = handleArgv(sys.argv)
- ws=args[0]
- ps=args[1]
-
- # load the workspace
- workspace=load(ws)
-
- context=GumpContext()
-
- # logins=readLogins()
- # dump(logins)
+ #
+ log.info('Gump Update complete. Exit code:' + str(result))
- update(workspace, ps, context)
-
- # dump(context)
+ # bye!
+ sys.exit(result)
\ No newline at end of file
1.4 +7 -0 jakarta-gump/python/gump/gumprun.py
Index: gumprun.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/gumprun.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- gumprun.py 23 Nov 2003 06:16:39 -0000 1.3
+++ gumprun.py 24 Nov 2003 18:32:19 -0000 1.4
@@ -96,6 +96,13 @@
self.repositories=self.getRepositoriesForModuleList(self.modules)
else:
self.repositories=repositories
+
+ self.validate()
+
+ # Validate a decent run
+ def validate(self):
+ if self.isEmpty():
+ raise RuntimeError, 'No projects match [' + self.projectexpression + ']'
# No Projects
def isEmpty(self):
1.16 +0 -1 jakarta-gump/python/gump/integrate.py
Index: integrate.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/integrate.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- integrate.py 17 Nov 2003 22:10:50 -0000 1.15
+++ integrate.py 24 Nov 2003 18:32:19 -0000 1.16
@@ -23,7 +23,6 @@
from gump.utils.commandLine import handleArgv
from gump.model.loader import WorkspaceLoader
-#from gump.check import checkEnvironment, check
###############################################################################
# Initialize
1.38 +56 -73 jakarta-gump/python/gump/build.py
Index: build.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/build.py,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- build.py 18 Nov 2003 00:29:49 -0000 1.37
+++ build.py 24 Nov 2003 18:32:19 -0000 1.38
@@ -1,69 +1,15 @@
#!/usr/bin/python
-
-# $Header$
-# $Revision$
-# $Date$
-#
-# ====================================================================
-#
-# The Apache Software License, Version 1.1
-#
-# Copyright (c) 2003 The Apache Software Foundation. All rights
-# reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-#
-# 3. The end-user documentation included with the redistribution, if
-# any, must include the following acknowlegement:
-# "This product includes software developed by the
-# Apache Software Foundation (http://www.apache.org/)."
-# Alternately, this acknowlegement may appear in the software itself,
-# if and wherever such third-party acknowlegements normally appear.
-#
-# 4. The names "The Jakarta Project", "Alexandria", and "Apache Software
-# Foundation" must not be used to endorse or promote products derived
-# from this software without prior written permission. For written
-# permission, please contact apache@apache.org.
-#
-# 5. Products derived from this software may not be called "Apache"
-# nor may "Apache" appear in their names without prior written
-# permission of the Apache Group.
-#
-# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
-# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-# ====================================================================
-#
-# This software consists of voluntary contributions made by many
-# individuals on behalf of the Apache Software Foundation. For more
-# information on the Apache Software Foundation, please see
-# <http://www.apache.org/>.
-
"""
+ This is the commandline entrypoint into gump.
- This is the commandline entrypoint into gump for 'building'.
-
- Note: CVS 'updating' is a pre-requisite.
-
+ It at the moment basically
+ calls gump.load() to get the workspace, then dumps
+ information about what it should be doing to stdout.
+
+ The main thing to do here is to clone dumpDeps to create a
+ build() method which executes the appropriate script
+ (probably only ant at the moment; would be nice to have
+ support for maven) for each of the dependencies.
"""
import os.path
@@ -71,16 +17,12 @@
import sys
import logging
-from gump import log, load
-from gump.context import *
-from gump.logic import getBuildSequenceForProjects, getBuildCommand, \
- getMkDirCommand, getDeleteCommand, \
- getProjectsForProjectExpression, getModulesForProjectList, \
- hasOutputs
-from gump.conf import dir, default, handleArgv
-from gump.model import Workspace, Module, Project
-from gump.launcher import Cmd, CmdResult, execute
-from gump.utils import dump
+from gump import log
+from gump.engine import GumpEngine
+from gump.gumprun import GumpRun, GumpRunOptions, GumpSet
+from gump.utils.commandLine import handleArgv
+from gump.model.loader import WorkspaceLoader
+
###############################################################################
# Initialize
@@ -90,3 +32,44 @@
###############################################################################
# Functions
###############################################################################
+
+# static void main()
+if __name__=='__main__':
+
+ # Process command line
+ args = handleArgv(sys.argv)
+ ws=args[0]
+ ps=args[1]
+
+ # get parsed workspace definition
+ workspace=WorkspaceLoader().load(ws)
+
+ #
+ # Check Environment (eventually not do this each time)
+ # Exit if problems...
+ #
+ #checkEnvironment(workspace,context,1)
+
+ #
+ # Check projects (and such) in workspace...
+ # Store results in context, do not display
+ # to screen.
+ #
+ #check(workspace, ps, context, 0)
+
+ # TODO populate...
+ options=GumpRunOptions()
+
+ # The Run Details...
+ run=GumpRun(workspace,ps,options)
+
+ #
+ # Perform this integration run...
+ #
+ result = GumpEngine().build(run)
+
+ #
+ log.info('Gump Build complete. Exit code:' + str(result))
+
+ # bye!
+ sys.exit(result)
\ No newline at end of file
1.6 +2 -0 jakarta-gump/python/gump/utils/__init__.py
Index: __init__.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/utils/__init__.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- __init__.py 21 Nov 2003 19:04:10 -0000 1.5
+++ __init__.py 24 Nov 2003 18:32:20 -0000 1.6
@@ -271,6 +271,8 @@
if diffHours > 1: diffString += 's'
else:
diffString = ''
+ elif olderSecs == newerSecs:
+ diffString = 'This run'
else:
diffString = ''
1.279 +10 -1 jakarta-gump/profile/gump.xml
Index: gump.xml
===================================================================
RCS file: /home/cvs/jakarta-gump/profile/gump.xml,v
retrieving revision 1.278
retrieving revision 1.279
diff -u -r1.278 -r1.279
--- gump.xml 23 Nov 2003 19:31:13 -0000 1.278
+++ gump.xml 24 Nov 2003 18:32:20 -0000 1.279
@@ -1,5 +1,9 @@
<profile name="gump">
+<!-- Gump Self Testing -->
+
+ <module href="project/svn-test.xml"/>
+
<!-- Apache.Ant -->
<module href="project/ant.xml"/>
@@ -142,7 +146,7 @@
<module href="project/jgen.xml"/>
<module href="project/jrefactory.xml"/>
<module href="project/jtidy.xml"/>
- <module href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/juddi/juddi/gump.xml?content-type=text/xml&rev=HEAD" />
+ <module href="http://cvs.apache.org/viewcvs.cgi/*checkout*/ws-juddi/gump.xml?rev=HEAD&content-type=text/xml" />
<module href="project/junit.xml"/>
<module href="project/jython.xml"/>
<module href="project/mockobjects.xml"/>
@@ -279,6 +283,11 @@
<project name="packaged-jaxen" package="jaxen-1.0-FCS"/>
<project name="saxpath" package="jaxen-1.0-FCS"/>
<project name="packaged-dom4j" package="dom4j-1.4"/>
+
+
+<!-- SVN Repository definitions -->
+
+ <repository href="repository/apache-svn-sandbox.xml"/>
<!-- CVS Repository definitions -->
1.17 +2 -0 jakarta-gump/.cvsignore
Index: .cvsignore
===================================================================
RCS file: /home/cvs/jakarta-gump/.cvsignore,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- .cvsignore 23 Oct 2003 19:38:16 -0000 1.16
+++ .cvsignore 24 Nov 2003 18:32:20 -0000 1.17
@@ -15,3 +15,5 @@
*~
LOCAL-ENV.bat
local-env.sh
+local-eny-py.sh
+tsws1.xml
\ No newline at end of file
1.1 jakarta-gump/repository/apache-svn-sandbox.xml
Index: apache-svn-sandbox.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<repository name="apache-svn-sandbox" type="svn">
<title>Apache SubVersion Sandbox</title>
<home-page>http://nagoya.apache.org/wiki/apachewiki.cgi?Subversion</home-page>
<cvsweb>http://cvs.apache.org/repos/test/</cvsweb>
<url>http://cvs.apache.org/repos/test/</url>
<redistributable/>
</repository>
1.1 jakarta-gump/project/svn-test.xml
Index: svn-test.xml
===================================================================
<module name="svn-test">
<url href="http://jakarta.apache.org/gump/index.html"/>
<description>
Test Module/Project for Gump SubVersion Capabilities
</description>
<svn repository="apache-svn-sandbox" dir="testdir"/>
<project name="svn-test">
<package>org.apache.gump.test</package>
<nag from="Adam R. B. Jack <ajack@apache.org>"
to="gump@jakarta.apache.org"/>
</project>
</module>