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/12/02 01:45:41 UTC
cvs commit: jakarta-gump/python/gump/document forrest.py
ajack 2003/12/01 16:45:41
Modified: template/forrest/src/documentation/content/xdocs site.xml
python/gump/test pyunit.py maven.py
python/gump/output xref.py
project directory-naming.xml
python/gump/model project.py
python/gump/document forrest.py
Added: python/gump/test xref.py
Log:
1) xref by package plus unit test
2) fixed URL to directory-naming (for now)
3) tweaks on Maven
Revision Changes Path
1.12 +1 -0 jakarta-gump/template/forrest/src/documentation/content/xdocs/site.xml
Index: site.xml
===================================================================
RCS file: /home/cvs/jakarta-gump/template/forrest/src/documentation/content/xdocs/site.xml,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- site.xml 26 Nov 2003 21:20:17 -0000 1.11
+++ site.xml 2 Dec 2003 00:45:40 -0000 1.12
@@ -39,6 +39,7 @@
<stats label="XRef" tab="xref">
<index label="Index" href="gump_xref/index.html"/>
<index label="by Repository" href="gump_xref/repo_module.html"/>
+ <index label="by Package" href="gump_xref/package_module.html"/>
</stats>
<external-refs>
1.11 +3 -0 jakarta-gump/python/gump/test/pyunit.py
Index: pyunit.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/test/pyunit.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- pyunit.py 1 Dec 2003 17:34:08 -0000 1.10
+++ pyunit.py 2 Dec 2003 00:45:40 -0000 1.11
@@ -326,6 +326,9 @@
from gump.test.maven import MavenTestSuite
runner.addSuite(MavenTestSuite())
+ from gump.test.xref import XRefTestSuite
+ runner.addSuite(XRefTestSuite())
+
#from gump.test.integrator import IntegratorTestSuite
#runner.addSuite(IntegratorTestSuite())
1.3 +1 -1 jakarta-gump/python/gump/test/maven.py
Index: maven.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/test/maven.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- maven.py 1 Dec 2003 20:48:12 -0000 1.2
+++ maven.py 2 Dec 2003 00:45:40 -0000 1.3
@@ -95,5 +95,5 @@
cmd=self.maven1.getMavenCommand()
- cmd.dump()
+ # cmd.dump()
1.1 jakarta-gump/python/gump/test/xref.py
Index: xref.py
===================================================================
#!/usr/bin/env python
# $Header: 1.7 2003/05/10 18:20:36 nicolaken Exp $
# $Revision: 1.7 $
# $Date: 2003/05/10 18:20:36 $
#
# ====================================================================
#
# 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/>.
"""
Model Testing
"""
import os
import logging
import types, StringIO
from gump import log
import gump.config
from gump.model.state import *
from gump.model.loader import WorkspaceLoader
from gump.output.xref import XRefGuru
from gump.utils import *
from gump.test import getWorkedTestWorkspace
from gump.test.pyunit import UnitTestSuite
class XRefTestSuite(UnitTestSuite):
def __init__(self):
UnitTestSuite.__init__(self)
def suiteSetUp(self):
#
# Load a decent Workspace
#
self.workspace=getWorkedTestWorkspace()
self.assertNotNone('Needed a workspace', self.workspace)
def testXRefGuru(self):
gug=XRefGuru(self.workspace)
1.2 +19 -0 jakarta-gump/python/gump/output/xref.py
Index: xref.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/output/xref.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xref.py 17 Nov 2003 22:10:54 -0000 1.1
+++ xref.py 2 Dec 2003 00:45:40 -0000 1.2
@@ -79,9 +79,11 @@
self.workspace=workspace
self.repositoryToModule={}
+ self.packageToModule={}
# Build Information Maps
self.mapRepositories()
+ self.mapPackages()
def mapRepositories(self):
for module in self.workspace.getModules():
@@ -93,7 +95,24 @@
# Store
self.repositoryToModule[repository].append(module)
+ def mapPackages(self):
+ for module in self.workspace.getModules():
+ for project in module.getProjects():
+ for package in project.xml.package:
+ if package:
+ packageName=str(package)
+
+ if not self.packageToModule.has_key(packageName):
+ self.packageToModule[packageName]=[]
+
+ # Store
+ self.packageToModule[packageName].append(module)
+
def getRepositoryToModuleMap(self):
return self.repositoryToModule
+
+
+ def getPackageToModuleMap(self):
+ return self.packageToModule
1.3 +1 -1 jakarta-gump/project/directory-naming.xml
Index: directory-naming.xml
===================================================================
RCS file: /home/cvs/jakarta-gump/project/directory-naming.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- directory-naming.xml 1 Dec 2003 18:42:04 -0000 1.2
+++ directory-naming.xml 2 Dec 2003 00:45:41 -0000 1.3
@@ -4,7 +4,7 @@
<description>Apache Directory Naming Component</description>
<url href="http://incubator.apache.org/directory/naming/"/>
- <svn repository="apache-incubator-svn" dir="directory/naming"/>
+ <svn repository="apache-incubator-svn" dir="naming"/>
<project name="directory-naming">
<ant buildfile="build.xml" target="dist">
1.20 +1 -1 jakarta-gump/python/gump/model/project.py
Index: project.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/model/project.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- project.py 1 Dec 2003 20:48:12 -0000 1.19
+++ project.py 2 Dec 2003 00:45:41 -0000 1.20
@@ -843,7 +843,7 @@
if isinstance(annotatedPath,AnnotatedPath):
id=annotatedPath.getId()
path=annotatedPath.getPath()
- props.write(('maven.jar.%s=%s') % (id,path))
+ props.write(('maven.jar.%s=%s\n') % (id,path))
def getScriptCommand(self):
1.21 +20 -2 jakarta-gump/python/gump/document/forrest.py
Index: forrest.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/document/forrest.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- forrest.py 1 Dec 2003 17:34:07 -0000 1.20
+++ forrest.py 2 Dec 2003 00:45:41 -0000 1.21
@@ -1429,14 +1429,13 @@
# Individual Pages...
self.documentModulesByRepository(xref, run, workspace, gumpSet)
+ self.documentModulesByPackage(xref, run, workspace, gumpSet)
def documentModulesByRepository(self,xref,run,workspace,gumpSet):
document=XDocDocument('Modules By Repository', \
self.resolver.getFile(xref,'repo_module.xml'))
- elapsedTable=document.createTable(['Modules By Repository'])
-
repoMap=xref.getRepositoryToModuleMap()
for repo in repoMap.keys():
moduleList=createOrderedList(repoMap.get(repo))
@@ -1448,6 +1447,25 @@
if not gumpSet.inModules(module): continue
moduleRepoRow=moduleRepoTable.createRow()
self.insertLink( module, xref, moduleRepoRow.createData())
+
+ document.serialize()
+
+ def documentModulesByPackage(self,xref,run,workspace,gumpSet):
+ document=XDocDocument('Modules By Package', \
+ self.resolver.getFile(xref,'package_module.xml'))
+
+ packageTable=document.createTable(['Modules By Package'])
+
+ packageMap=xref.getPackageToModuleMap()
+ for package in packageMap.keys():
+
+ packageTable.createRow().createHeader('Package: ' + package)
+
+ moduleList=createOrderedList(packageMap.get(package))
+
+ for module in moduleList:
+ if not gumpSet.inModules(module): continue
+ self.insertLink( module, xref,packageTable.createRow().createData())
document.serialize()