joerg 2003/07/14 15:04:10
Modified: src/resources/dev/eclipse make-classpath.xsl
Log:
Is alphabetical sorting helpful?
Revision Changes Path
1.3 +20 -15 cocoon-2.1/src/resources/dev/eclipse/make-classpath.xsl
Index: make-classpath.xsl
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/resources/dev/eclipse/make-classpath.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- make-classpath.xsl 10 Mar 2003 16:38:58 -0000 1.2
+++ make-classpath.xsl 14 Jul 2003 22:04:10 -0000 1.3
@@ -7,9 +7,7 @@
@version CVS $Id$
-->
-<xsl:stylesheet
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="xml"/>
@@ -18,26 +16,33 @@
<xsl:template match="/data">
<classpath>
- <!-- 1. mock classes -->
- <xsl:for-each select="mock-dirs/item">
- <classpathentry kind="src" path="{.}"/>
- </xsl:for-each>
-
- <!-- 2. source dirs -->
- <xsl:for-each select="src-dirs/item">
+ <!-- 1. source dirs + mock classes -->
+ <xsl:for-each select="src-dirs/item | mock-dirs/item">
+ <!-- alphabetical sorting, complete path -->
+ <xsl:sort select="."/>
<classpathentry kind="src" path="{.}"/>
</xsl:for-each>
- <!-- 3. libraries -->
+ <!-- 2. libraries -->
<xsl:for-each select="libs/item">
+ <!-- alphabetical sorting, only file name -->
+ <!-- heavy calculation, but here's the logic:
+ 1. returns the string after 4 slashes (4 is the max (blocks)),
+ returns empty string if string does not contain 4 slashes
+ 2. ... 3 slashes ...
+ 3. ... 2 slashes ... (the minimum) -->
+ <xsl:sort
select="concat(substring-after(substring-after(substring-after(substring-after(.,
'/'), '/'), '/'), '/'),
+
substring-after(substring-after(substring-after(., '/'), '/'), '/'),
+
substring-after(substring-after(., '/'), '/'))"/>
<classpathentry kind="lib" path="{.}"/>
</xsl:for-each>
- <!-- 4. JRE runtime -->
+ <!-- 3. JRE runtime -->
<classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT"
sourcepath="JRE_SRC"/>
- <!-- output directory. Build in a separate dir since Eclipse is confused by
classes
- compiled externally by Sun's Javac -->
+ <!-- 4. output directory
+ Build in a separate dir since Eclipse is confused
+ by classes compiled externally by Sun's Javac -->
<classpathentry kind="output" path="{output}"/>
</classpath>