ajack 2004/03/19 10:19:18
Modified: python/gump/test/resources/full1 module4.xml module3.xml
python/gump/model project.py depend.py ant.py
python/gump/document forrest.py
. gumpy.sh
python/gump/test model.py
python/gump/gui view.py
Log:
1) Make gumpy.sh cat log file to log directory, whenever it exits.
2) Attempt to fix <ant <depend to set classpath.
3) Unit tests for this and <ant <property
Revision Changes Path
1.9 +3 -0 gump/python/gump/test/resources/full1/module4.xml
Index: module4.xml
===================================================================
RCS file: /home/cvs/gump/python/gump/test/resources/full1/module4.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- module4.xml 15 Mar 2004 22:07:07 -0000 1.8
+++ module4.xml 19 Mar 2004 18:19:18 -0000 1.9
@@ -17,7 +17,10 @@
</ant>
<depend project="project1"/>
+ <depend project="project2" runtime="true"/>
<depend project="project3"/>
+
+ <option project="project1" />
<home nested="dist"/>
1.10 +9 -4 gump/python/gump/test/resources/full1/module3.xml
Index: module3.xml
===================================================================
RCS file: /home/cvs/gump/python/gump/test/resources/full1/module3.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- module3.xml 29 Feb 2004 19:16:19 -0000 1.9
+++ module3.xml 19 Mar 2004 18:19:18 -0000 1.10
@@ -11,12 +11,17 @@
<package>org.apache.project3</package>
<ant target="gump" debug="true">
+ <!-- This is used to test depends in ant, which
+ are like properties only with classpath="add".
+ Please do not add any other dependences on project1
+ or this test will be silently invalidated -->
<depend property="project1.jar" project="project1"/>
+
+ <!-- This is used to test property dependencies,
+ do not add any other dependencies on project2
+ or the check that this is 'noclasspath' will fail -->
+ <property property="project2.jar" project="project2"/>
</ant>
-
- <option project="project1" />
-
- <depend project="project2" runtime="true"/>
<home nested="dist"/>
1.67 +10 -7 gump/python/gump/model/project.py
Index: project.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/project.py,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- project.py 18 Mar 2004 23:24:55 -0000 1.66
+++ project.py 19 Mar 2004 18:19:18 -0000 1.67
@@ -913,7 +913,7 @@
# ------------------------------------------------------------------------
""")
- (classpath,bootclasspath)=self.getClasspathLists()
+ (classpath,bootclasspath)=self.getClasspathObjects()
# :TODO: write...
for annotatedPath in classpath.getPathParts():
@@ -970,7 +970,7 @@
#
# Calculate classpath and bootclasspath
#
- (classpath, bootclasspath) = self.getClasspathLists(debug)
+ (classpath, bootclasspath) = self.getClasspathObjects(debug)
#
# Return them simple/flattened
@@ -999,7 +999,7 @@
#
# Return a tuple of (CLASSPATH, BOOTCLASSPATH) for a project
#
- def getClasspathLists(self,debug=0):
+ def getClasspathObjects(self,debug=0):
"""Get a TOTAL classpath for a project (including its dependencies)"""
#
@@ -1065,12 +1065,15 @@
def getDependOutputList(self,dependency,visited,depth=0,debug=0):
"""Get a classpath of outputs for a project (including its dependencies)"""
- # Don't loop, and skip ones that aren't here to
- # affect the classpath
- if (dependency in visited) or dependency.isNoClasspath():
+ # Skip ones that aren't here to affect the classpath
+ if dependency.isNoClasspath():
+ return (None,None)
+
+ # Don't loop
+ if (dependency in visited):
# beneficiary.addInfo("Duplicated dependency [" + str(depend) + "]")
if debug:
- print str(depth) + ") Already Visited : " + str(depend)
+ print str(depth) + ") Already Visited : " + str(dependency)
print str(depth) + ") Previously Visits : "
for v in visited:
print str(depth) + ") - " + str(v)
1.21 +1 -2 gump/python/gump/model/depend.py
Index: depend.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/depend.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- depend.py 18 Mar 2004 23:24:55 -0000 1.20
+++ depend.py 19 Mar 2004 18:19:18 -0000 1.21
@@ -340,8 +340,7 @@
for dependency in self.getDirectDependencies():
if dependency.getProject().getName()==name \
and not dependency.isNoClasspath() :
- return 1
-
+ return 1
return 0
# determine if this project is a prereq of any project on the todo list
1.19 +9 -0 gump/python/gump/model/ant.py
Index: ant.py
===================================================================
RCS file: /home/cvs/gump/python/gump/model/ant.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ant.py 18 Mar 2004 23:24:55 -0000 1.18
+++ ant.py 19 Mar 2004 18:19:18 -0000 1.19
@@ -64,6 +64,10 @@
# Expands
#
def expandProperty(self,property,project,workspace):
+
+ # :TODO: Cleanup this Workaround
+ if not property.name and property.project:
+ property.name=property.project
# Check if the property comes from another project
if not property.project: return
@@ -131,6 +135,11 @@
# :TODO: AJ added this, no idea if it is right/needed.
if depend.id: xmlproperty['ids']= depend.id
+
+ # <depend wants the classpath
+ if not xmlproperty.noclasspath:
+ xmlproperty['classpath']='add'
+
# Store it
self.expandProperty(xmlproperty,project,workspace)
self.importProperty(xmlproperty)
1.111 +4 -4 gump/python/gump/document/forrest.py
Index: forrest.py
===================================================================
RCS file: /home/cvs/gump/python/gump/document/forrest.py,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- forrest.py 18 Mar 2004 23:24:55 -0000 1.110
+++ forrest.py 19 Mar 2004 18:19:18 -0000 1.111
@@ -1346,7 +1346,7 @@
if project.hasAnt():
self.documentProperties(miscSection, project.getAnt(), 'Ant
Properties')
- (classpath,bootclasspath)=project.getClasspathLists()
+ (classpath,bootclasspath)=project.getClasspathObjects()
self.displayClasspath(miscSection, classpath,'Classpath',project)
self.displayClasspath(miscSection, bootclasspath,'Boot
Classpath',project)
1.32 +5 -2 gump/gumpy.sh
Index: gumpy.sh
===================================================================
RCS file: /home/cvs/gump/gumpy.sh,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- gumpy.sh 17 Mar 2004 20:10:06 -0000 1.31
+++ gumpy.sh 19 Mar 2004 18:19:18 -0000 1.32
@@ -113,6 +113,8 @@
mkdir $GUMP_PROFILE_LOG_DIR;
fi
if [ ! -d $GUMP_PROFILE_LOG_DIR ] ; then
+ echo \</XMP\> >> $GUMP_LOG
+ cp $GUMP_LOG $GUMP_FINAL_LOG
exit 1
fi
@@ -189,7 +191,9 @@
echo "Failed to integrate, exited with [${INTEGRATION_EXIT}], exiting..."
>> $GUMP_LOG
echo "Failed to integrate, exited with [${INTEGRATION_EXIT}], exiting..."
# For cron to mail to owner...
- cat $GUMP_LOG
+ cat $GUMP_LOG
+ echo \</XMP\> >> $GUMP_LOG
+ cp $GUMP_LOG $GUMP_FINAL_LOG
exit 1
fi;
@@ -226,7 +230,6 @@
cd $GUMP
echo \</XMP\> >> $GUMP_LOG
-
cp $GUMP_LOG $GUMP_FINAL_LOG
#
@@ -235,6 +238,8 @@
pkill -KILL -P $$
# $Log$
-# Revision 1.31 2004/03/17 20:10:06 ajack
-# Write log to tmp, then move to log directory after run is over.
+# Revision 1.32 2004/03/19 18:19:18 ajack
+# 1) Make gumpy.sh cat log file to log directory, whenever it exits.
+# 2) Attempt to fix <ant <depend to set classpath.
+# 3) Unit tests for this and <ant <property
#
1.17 +28 -3 gump/python/gump/test/model.py
Index: model.py
===================================================================
RCS file: /home/cvs/gump/python/gump/test/model.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- model.py 15 Mar 2004 22:07:07 -0000 1.16
+++ model.py 19 Mar 2004 18:19:18 -0000 1.17
@@ -231,6 +231,31 @@
self.assertFalse('Not NoClaspath', depend.isNoClasspath())
self.assertTrue('Did a NOT NoClasspath test', tested)
+ def testNoClasspathOnProperty(self):
+ self.assertFalse('<ant <property does NOT gives full dependency
(noclasspath)', \
+ self.project3.hasFullDependencyOnNamedProject('project2'))
+
+
+ (classpath,bootclasspath)=self.project3.getClasspathObjects()
+
+ for pathPart in classpath.getSimpleClasspathList():
+ self.assertNotSubstring('Ought not get output2.jar from project2',
\
+ 'output2.jar', \
+ pathPart)
+
+ def testNoClasspathOnDepend(self):
+ self.assertTrue('<ant <depend gives full dependency (classpath)', \
+ self.project3.hasFullDependencyOnNamedProject('project1'))
+
+ (classpath,bootclasspath)=self.project3.getClasspathObjects()
+
+ found=0
+ for pathPart in classpath.getSimpleClasspathList():
+ if not -1 == pathPart.find('output1.jar'):
+ found=1
+
+ self.assertTrue('Ought find output1.jar', found)
+
def testJunitReport(self):
self.assertTrue('This has a <junitreport', self.project3.hasReports())
1.9 +4 -4 gump/python/gump/gui/view.py
Index: view.py
===================================================================
RCS file: /home/cvs/gump/python/gump/gui/view.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- view.py 16 Mar 2004 19:50:15 -0000 1.8
+++ view.py 19 Mar 2004 18:19:18 -0000 1.9
@@ -419,7 +419,7 @@
if not self.classpath.GetColumn(0):
self.classpath.InsertColumn(0, 'Path')
- (classpath, bootclasspath)=project.getClasspathLists()
+ (classpath, bootclasspath)=project.getClasspathObjects()
for i in range(0,len(classpath)):
self.classpath.InsertStringItem(i,classpath[i])
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]