cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giac...@apache.org
Subject svn commit: r406592 - in /cocoon/trunk/tools/depmngt: ./ checkpoms.sh extractDeps.xsl
Date Mon, 15 May 2006 09:21:19 GMT
Author: giacomo
Date: Mon May 15 02:21:04 2006
New Revision: 406592

URL: http://svn.apache.org/viewcvs?rev=406592&view=rev
Log:
added script to check dependencies

Added:
    cocoon/trunk/tools/depmngt/   (with props)
    cocoon/trunk/tools/depmngt/checkpoms.sh   (with props)
    cocoon/trunk/tools/depmngt/extractDeps.xsl

Propchange: cocoon/trunk/tools/depmngt/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon May 15 02:21:04 2006
@@ -0,0 +1 @@
+target

Added: cocoon/trunk/tools/depmngt/checkpoms.sh
URL: http://svn.apache.org/viewcvs/cocoon/trunk/tools/depmngt/checkpoms.sh?rev=406592&view=auto
==============================================================================
--- cocoon/trunk/tools/depmngt/checkpoms.sh (added)
+++ cocoon/trunk/tools/depmngt/checkpoms.sh Mon May 15 02:21:04 2006
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+HERE=`dirname $0`
+cd "$HERE"
+HERE=$PWD
+mkdir target >/dev/null 2>&1
+cd ../..
+echo "Start searching from $PWD"
+echo '<root>' >"$HERE/target/allPom.xml"
+for i in `find . -maxdepth 5 -name pom.xml`; do 
+  echo "<pom file=\"$i\">" >>"$HERE/target/allPom.xml"
+  cat $i | sed -r 's/^ *<[?]xml[^>]*>(.*)/\1/' >>"$HERE/target/allPom.xml"
+  echo "</pom>" >>"$HERE/target/allPom.xml"
+done
+echo "</root>" >>"$HERE/target/allPom.xml"
+
+lastgroup=""
+lastid=""
+lastver=""
+lastpom=""
+lastmatched=0
+
+#XALAN=`find $HOME/.m2/repository -name "xalan*.jar"|tail -n 1`
+#XERCES=`find $HOME/.m2/repository -name "xercesImpl*.jar"|tail -n 1`
+#XMLAPIS=`find $HOME/.m2/repository -name "xml-apis*.jar"|tail -n 1`
+#$JAVA_HOME/bin/java -classpath $XALAN:$XERCES:$XMLAPIS.jar org.apache.xalan.xslt.Process
$* \
+$JAVA_HOME/bin/java org.apache.xalan.xslt.Process $* \
+  -xsl "$HERE/extractDeps.xsl" -in "$HERE/target/allPom.xml" \
+| grep -vE '^[<]' \
+| while read group id ver pom; do
+  if [ "$lastid" = "$id" ]; then
+    if [ "$lastver" != "$ver" -o "$lastgroup" != "$group" -o "$lastmatched" = "1" ]; then
+      if [ $lastmatched = "0" ]; then
+        lastmatched=1
+        echo "POM: $lastpom"
+        echo -e "\tgroup=$lastgroup\tartifact=$lastid\tversion=$lastver"
+      fi
+      echo "POM: $pom"
+      echo -e "\tgroup=$group\tartifact=$id\tversion=$ver"
+    fi
+  else
+    lastmatched=0
+  fi
+  lastgroup=$group
+  lastid=$id
+  lastver=$ver
+  lastpom=$pom
+done

Propchange: cocoon/trunk/tools/depmngt/checkpoms.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: cocoon/trunk/tools/depmngt/extractDeps.xsl
URL: http://svn.apache.org/viewcvs/cocoon/trunk/tools/depmngt/extractDeps.xsl?rev=406592&view=auto
==============================================================================
--- cocoon/trunk/tools/depmngt/extractDeps.xsl (added)
+++ cocoon/trunk/tools/depmngt/extractDeps.xsl Mon May 15 02:21:04 2006
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- CVS $Id: directory2html.xslt,v 1.4 2004/03/06 02:25:41 antonio Exp $ -->
+
+<xsl:stylesheet version="1.0"
+                xmlns:pom="http://maven.apache.org/POM/4.0.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:template match="/">
+    <root>
+      <xsl:apply-templates/>
+    </root>
+  </xsl:template>
+
+  <xsl:template match="root">
+    <xsl:for-each select="pom/pom:project/pom:dependencies/pom:dependency">
+      <!--xsl:sort select="pom:groupId"/-->
+      <xsl:sort select="pom:artifactId"/>
+      <xsl:sort select="pom:version"/>
+      <xsl:value-of select="pom:groupId"/><xsl:text>	</xsl:text>
+      <xsl:value-of select="pom:artifactId"/><xsl:text>	</xsl:text>
+      <xsl:value-of select="pom:version"/><xsl:text>	</xsl:text>
+      <xsl:value-of select="../../../@file"/><xsl:text>
+</xsl:text>
+    </xsl:for-each>
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="node()|@*" priority="-1">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+</xsl:stylesheet>



Mime
View raw message