directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r375023 - /directory/trunks/sh-scripts/modules.sh
Date Sun, 05 Feb 2006 13:22:50 GMT
Author: ersiner
Date: Sun Feb  5 05:22:49 2006
New Revision: 375023

URL: http://svn.apache.org/viewcvs?rev=375023&view=rev
Log:
Made the script construct a complete xdoc.

Modified:
    directory/trunks/sh-scripts/modules.sh

Modified: directory/trunks/sh-scripts/modules.sh
URL: http://svn.apache.org/viewcvs/directory/trunks/sh-scripts/modules.sh?rev=375023&r1=375022&r2=375023&view=diff
==============================================================================
--- directory/trunks/sh-scripts/modules.sh (original)
+++ directory/trunks/sh-scripts/modules.sh Sun Feb  5 05:22:49 2006
@@ -3,10 +3,11 @@
 # One of the ugliest hacks you can find around!
 #
 # This script finds all subprojects by looking at pom.xmls starting from
-# where it's invoked and generates a table of project names and descriptions.
+# where it's invoked and generates an index page with a table of project
+# names and descriptions. The generated document is a complete xdoc doc.
 # If there is no name element in project then it takes the artifactId.
-# If there is no description element in the project then it prints "To be described...".
-# This script ignores './pom.xml'.
+# If there is no description element in the project then it prints
+# "To be described...".
 
 xml_element_content=""
 
@@ -28,7 +29,27 @@
 
 poms=$(for pom in $(find . -name "pom.xml"); do echo "${pom}"; done)
 
-echo -e '<table>\n<tr><td>Project</td><td>Description</td></tr>'
+get_xml_element '/project/name' ./pom.xml name
+project_name=$xml_element_content
+if [ "$project_name" == "" ]
+then
+	get_xml_element '/project/artifactId' ./pom.xml artifactId
+	project_artifactId=$xml_element_content
+	project_name=$project_artifactId
+fi
+
+
+echo '<?xml version="1.0" encoding="UTF-8"?>'
+echo '<document>'
+echo ' <properties>'
+echo '  <title>'${project_name}' - Subprojects</title>'
+echo ' </properties>'
+echo ' <body>'
+echo '  <section name="'${project_name}' Subprojects">'
+echo '   <p>'${project_name}' is composed of several subprojects. Here is the list
of them with brief descriptions:</p>'
+
+echo '   <table>'
+echo '    <tr><td>Project</td><td>Description</td></tr>'
 
 for pom in $poms
 do
@@ -48,7 +69,10 @@
                 project_description="To be described..."
         fi
 
-	echo -e "<tr><td>${project_name}</td><td>$project_description</td></tr>"
+	echo "     <tr><td>${project_name}</td><td>$project_description</td></tr>"
 done
 
-echo '</table>'
+echo '   </table>'
+echo '  </section>'
+echo ' </body>'
+echo '</document>'



Mime
View raw message