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/10/14 18:12:38 UTC
cvs commit: jakarta-gump/python/gump model.py build.py logic.py conf.py
ajack 2003/10/14 09:12:38
Modified: python/gump model.py build.py logic.py conf.py
Log:
1) Next stab at CLASSPATH (w/ inherit=none fix)
2) Changes to command line processing (for 3)
3) build.py ... nosync option (for faster testing)
Revision Changes Path
1.26 +7 -3 jakarta-gump/python/gump/model.py
Index: model.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/model.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- model.py 14 Oct 2003 14:46:32 -0000 1.25
+++ model.py 14 Oct 2003 16:12:38 -0000 1.26
@@ -485,6 +485,10 @@
""" Return the jars reference by this dependency """
result=[]
+ #
+ # IDs is a space separated list of jar ids. If specified
+ # then return those that are listed, else all.
+ #
ids=(self.ids or '').split(' ')
try:
for jar in Project.list[self.project].jar:
1.23 +23 -14 jakarta-gump/python/gump/build.py
Index: build.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/build.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- build.py 13 Oct 2003 18:51:20 -0000 1.22
+++ build.py 14 Oct 2003 16:12:38 -0000 1.23
@@ -92,7 +92,7 @@
# Functions
###############################################################################
-def build(workspace, expr='*', context=GumpContext()):
+def build(workspace, expr='*', context=GumpContext(), nosync=None):
""" Build a expression of projects """
projects=getProjectsForProjectExpression(expr)
@@ -106,9 +106,9 @@
print " - " + p
return 1
- return buildProjectList(workspace,projects,context)
+ return buildProjectList(workspace,projects,context,nosync)
-def buildProjectList(workspace, projects, context=GumpContext()):
+def buildProjectList(workspace, projects, context, nosync):
""" Build a expression of projects """
log.debug('Requests Projects')
@@ -117,16 +117,16 @@
sequence=getBuildSequenceForProjects(projects)
- return buildProjectSequence(workspace,sequence,context)
+ return buildProjectSequence(workspace,sequence,context,nosync)
-def buildProjectSequence(workspace,sequence,context=GumpContext()):
+def buildProjectSequence(workspace,sequence,context,nosync):
log.debug('Total Project Sequence (i.e. build order):');
for p in sequence:
log.debug(' Sequence : ' + p.name)
# synchronize @ module level
- syncWorkDir( workspace, sequence, context )
+ if not nosync: syncWorkDir( workspace, sequence, context )
# build
buildProjects( workspace, sequence, context )
@@ -134,7 +134,7 @@
return context.status
-def syncWorkDir( workspace, sequence, context=GumpContext() ):
+def syncWorkDir( workspace, sequence, context ):
"""copy the raw module (project) materials from source to work dir (hopefully using rsync, cp is fallback)"""
log.debug('--- Synchronizing work directories with sources')
@@ -167,7 +167,7 @@
else:
mctxt.status=STATUS_SUCCESS
-def buildProjects( workspace, sequence, context=GumpContext() ):
+def buildProjects( workspace, sequence, context ):
"""actually perform the build of the specified project and its deps"""
log.debug('--- Building work directories with sources')
@@ -244,11 +244,20 @@
ws=args[0]
ps=args[1]
+ # Allow a nosync option
+ nosync=None
+ if len(args) > 2: nosync=args[2]
+
+ # A context to work into...
+ context=GumpContext()
+
# get parsed workspace definition
- workspace=load(ws)
+ workspace=load(ws,context)
- # run gump
- result = build(workspace, ps);
+ #
+ # Perform build tasks
+ #
+ result = build(workspace, ps, context, nosync)
# bye!
sys.exit(result)
1.24 +11 -25 jakarta-gump/python/gump/logic.py
Index: logic.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/logic.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- logic.py 14 Oct 2003 14:46:32 -0000 1.23
+++ logic.py 14 Oct 2003 16:12:38 -0000 1.24
@@ -403,38 +403,28 @@
# Does it have any depends?
if project.depend:
- # For each
- for depend in project.depend:
- # Default inherit is NONE, which means:
- # run after that projects, but do NOT use
- # any part of the project's CLASSPATH
- if depend.inherit:
- # Recurse w/ ALL or HARD, to get
- # it's depends. Otherwise jsut get
- # it's JARs
- deepCopy=determineDeepCopy(depend)
- classpath += getDependOutputList(depend,context,visited,deepCopy)
+ # For each
+ for depend in project.depend:
+ classpath += getDependOutputList(depend,context,visited)
# Same as above, but for optional...
if project.option:
- for option in project.option:
- if option.inherit:
- deepCopy=determineDeepCopy(option)
- classpath += getDependOutputList(option,context,visited,deepCopy)
+ for option in project.option:
+ classpath += getDependOutputList(option,context,visited)
return classpath
#
# :TODO: Runtime Dependncy?
#
-def getDependOutputList(depend,context,visited,deepCopy=None):
+def getDependOutputList(depend,context,visited):
"""Get a classpath of outputs for a project (including it's dependencies)"""
# Don't loop...
if depend in visited:
return []
visited.append(depend)
-
+
#
# Check we can get the project...
#
@@ -462,22 +452,18 @@
#
# inherit='ALL' or 'HARD'
#
+ deepCopy=determineDeepCopy(depend)
+
if deepCopy:
# Append sub-projects outputs
if project.depend:
for depend in project.depend:
- # If inherit != NONE (just a run order dependency)
- if depend.inherit:
- deepCopy=determineDeepCopy(depend)
- classpath += getDependOutputList(depend,context,visited,deepCopy)
+ classpath += getDependOutputList(depend,context,visited)
# Append optional sub-project's output (that may not exist)
if project.option:
for option in project.option:
- # If inherit != NONE (just a run order dependency)
- if option.inherit:
- deepCopy=determineDeepCopy(option)
- classpath += getDependOutputList(option,context,visited,deepCopy)
+ classpath += getDependOutputList(option,context,visited)
return classpath
1.21 +19 -12 jakarta-gump/python/gump/conf.py
Index: conf.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/conf.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- conf.py 13 Oct 2003 22:37:12 -0000 1.20
+++ conf.py 14 Oct 2003 16:12:38 -0000 1.21
@@ -91,7 +91,6 @@
gumphost = socket.gethostname().split('.')[0]
workspace = os.path.normpath('%s/%s.xml' % (dir.base, gumphost))
globalws = os.path.normpath('%s/%s' % (dir.base, 'global-workspace.xml'))
- project = "jakarta-gump"
merge = os.path.normpath('%s/%s' % (dir.work, 'merge.xml'))
date = time.strftime('%Y%m%d')
logLevel = logging.INFO
@@ -144,6 +143,13 @@
print "http://www.apache.org/"
print
+#
+# Process the command line, returning:
+#
+# args[0] = workspace filename
+# args[1] = project specifier (expression)
+#
+#
def handleArgv(argv, requireProject=1):
args = []
# the workspace
@@ -177,19 +183,20 @@
log.info("Using default workspace: " + default.workspace)
# determine which modules the user desires (wildcards are permitted)
- if len(argv)>1:
- args.append(argv[1] or '*')
- if args[1]=='all': args[1]='*'
- else:
- if requireProject:
+ if requireProject:
+ if len(argv)>1:
+ args.append(argv[1] or '*')
+ if args[1]=='all': args[1]='*'
+ del argv[1:1]
+ else:
banner()
print
print " No project specified, please supply a project expressions or 'all'."
print " Project wildcards are accepted, e.g. \"jakarta-*\"."
- print " " , default.workspace
sys.exit(1)
- else:
- args.append(default.project)
+
+ # Allow extras...
+ args += argv
return args