? src/java/org/apache/maven/checkstyle
? src/java/org/apache/maven/util/PathUtil.java
Index: src/dvsl/xdocs/checkstyle.dvsl
===================================================================
RCS file: /home/cvspublic/jakarta-turbine-maven/src/dvsl/xdocs/checkstyle.dvsl,v
retrieving revision 1.1
diff -u -r1.1 checkstyle.dvsl
--- src/dvsl/xdocs/checkstyle.dvsl	8 Apr 2002 00:09:02 -0000	1.1
+++ src/dvsl/xdocs/checkstyle.dvsl	24 May 2002 23:46:38 -0000
@@ -17,14 +17,14 @@
 #######################################################################
 
 ## Convert a string that represents a number using the specified
-## pattern.  
+## pattern.
 ##
 #macro (formatAsNumber $string $pattern)
     #set ($value = $context.toolbox.numbers.parse($string))
     $context.toolbox.formatter.formatNumber($value, $pattern)
 #end
 
-## Create link to the xref docs for a particular file and line 
+## Create link to the xref docs for a particular file and line
 ## number.
 ##
 #macro (createLineNumberLink $name $line)
@@ -38,17 +38,14 @@
 #end
 
 #######################################################################
-## T E M P L A T E    D E F I N I T I O N S                          ## 
-####################################################################### 
+## T E M P L A T E    D E F I N I T I O N S                          ##
+#######################################################################
 
 ## Matches the root element of the JUnit XML report.
 ##
 #match ("checkstyle")
 <?xml version="1.0"?>
 
-#set ($basedir = $context.toolbox.fileutil.file($context.toolbox.srcDir).getAbsolutePath())
-#set ($basedirlen = $basedir.length() + 1)
-
 <document>
 
   <properties>
@@ -59,7 +56,7 @@
     <section name="Checkstyle Results">
       <p>
         The following document contains the results of <a
-        href="http://checkstyle.sourceforge.net/">Checkstyle</a>.  
+        href="http://checkstyle.sourceforge.net/">Checkstyle</a>.
       </p>
     </section>
 
@@ -78,7 +75,7 @@
       <table>
         <tr><th>Files</th><th>Errors</th></tr>
         #foreach ($file in $node.selectNodes("file"))
-          #set ($name = $file.attribute("name").substring($basedirlen))
+          #set ($name = $context.toolbox.pathUtil.getRelativePath($file.attribute('name'), $context.toolbox.srcSet))
           #set ($errorCount = $file.valueOf("count(error)"))
         <tr>
           <td><a href="#$name">$name</a></td>
@@ -86,10 +83,11 @@
         </tr>
         #end
       </table>
-  
+
       #foreach ($file in $node.selectNodes("file"))
         #if ($file.get("error"))
-          #set ($name = $file.attribute('name').substring($basedirlen))
+          #set ($name = $context.toolbox.pathUtil.getRelativePath($file.attribute('name'), $context.toolbox.srcSet))
+
       <subsection name="$name">
         <table>
           <tr><th>Error</th><th>Line</th></tr>
Index: src/java/org/apache/maven/ProjectProperties.java
===================================================================
RCS file: /home/cvspublic/jakarta-turbine-maven/src/java/org/apache/maven/ProjectProperties.java,v
retrieving revision 1.33
diff -u -r1.33 ProjectProperties.java
--- src/java/org/apache/maven/ProjectProperties.java	23 May 2002 01:17:01 -0000	1.33
+++ src/java/org/apache/maven/ProjectProperties.java	24 May 2002 23:46:38 -0000
@@ -98,9 +98,9 @@
     {
         // Grab the libRepo property.
         libRepo = getProject().getProperty("lib.repo");
-        
+
         Map mavenProjectMap = new BeanMap(getMavenProject());
-        
+
         // We can store these values in a properties file in the JAR
         // eventually so it's highly configurable, less code maintenance.
         String[] properties =
@@ -116,15 +116,15 @@
             "cvsRoot",
             "cvsModule"
         };
-        
+
         for (int i = 0; i < properties.length; i++)
         {
-            setProjectProperty(properties[i], mavenProjectMap);            
-        } 
+            setProjectProperty(properties[i], mavenProjectMap);
+        }
 
         createOrganizationProperties();
         createDistProperties();
-        
+
         // Let the build process know that the POM has
         // been loaded.
         getProject().setProperty("maven.pomLoaded","true");
@@ -149,21 +149,25 @@
             getProject().setProperty("maven.sourcesPresent", "true");
         }
 
-        log("Creating source set reference ...", Project.MSG_DEBUG);
-                        
-        createPathReference("maven.src.set",
+        log("Creating source set path reference ...", Project.MSG_DEBUG);
+
+        String pathString = createPathReference("maven.src.set",
             getMavenProject().getBuild().getSourceDirectories());
 
+        getProject().setProperty("maven.src.set", pathString);
+        log("Created source set path property, maven.src.set = [" +
+            pathString + "]", Project.MSG_DEBUG);
+
         log("Creating aspect source set reference ...", Project.MSG_DEBUG);
-                        
+
         createPathReference("maven.src.aspect.set",
             getMavenProject().getBuild().getAspectSourceDirectories());
 
-        String mavenPrepareSourceDirectory = 
+        String mavenPrepareSourceDirectory =
             getProject().getProperty("maven.prepareSourceDirectory");
-        
+
         log("mpsd => " + mavenPrepareSourceDirectory, Project.MSG_DEBUG);
-        
+
         if (mavenPrepareSourceDirectory != null)
         {
             AntUtils.createPatternSetReferenceFromPaths(
@@ -181,7 +185,7 @@
             createPathReference("maven.compile.src.set",
                 getMavenProject().getBuild().getSourceDirectories());
         }
-        
+
         if (!Strings.isEmpty(
             getMavenProject().getBuild().getUnitTestSourceDirectory()))
         {
@@ -194,7 +198,7 @@
                 getProject().setProperty("maven.unitTestSourcesPresent",
                     "true");
 
-                log("Creating unit test class entries reference ...", 
+                log("Creating unit test class entries reference ...",
                     Project.MSG_DEBUG);
                 AntUtils.createPatternSetReference(getProject(),
                     "maven.unit.test.set",
@@ -213,7 +217,7 @@
                 getProject().setProperty(
                     "maven.integrationUnitTestSourceDirectory",
                     utdir.getCanonicalPath());
-                
+
                 getProject().setProperty(
                     "maven.integrationUnitTestSourcesPresent",
                     "true");
@@ -228,7 +232,7 @@
 
         createJarResourcesProperty();
     }
-    
+
     /**
      * Set a project property. We check to see that the value
      * exists in the POM by turning the mavenProject bean into
@@ -239,12 +243,12 @@
         if (values.get(key) != null)
         {
             String value = (String) values.get(key);
-            
+
             if (value.length() > 0 && getProject().getProperty(key) == null)
             {
                 getProject().setProperty("maven." + key,
                     (String)values.get(key));
-            }                
+            }
         }
     }
 
@@ -259,7 +263,7 @@
              i.hasNext();)
         {
             Dependency dependency = (Dependency) i.next();
-            
+
             Path p = new Path(getProject());
             p.setPath(new File(libRepo, dependency.getJar()).getAbsolutePath());
             classpath.append(p);
@@ -283,14 +287,15 @@
         AntUtils.createPatternSetReference(getProject(),"maven.dependency.set",
             depNames);
     }
-    
+
     /**
      * Create the source directories reference.
      *
      * @param reference
      * @param directories
+     * @return the string representation of the path
      */
-    private void createPathReference(String reference, List directories)
+    private String createPathReference(String reference, List directories)
     {
         Path srcSet = new Path(getProject());
 
@@ -302,10 +307,12 @@
             srcSet.append(p);
         }
 
-        log("Adding Reference " + reference + " with a value of " + srcSet, 
+        log("Adding Reference " + reference + " with a value of " + srcSet,
             Project.MSG_DEBUG);
 
         getProject().addReference(reference, srcSet);
+
+        return srcSet.toString();
     }
 
     /**
@@ -341,9 +348,9 @@
         String id = getProject().getProperty("distid");
         if (id != null)
         {
-            Distribution d = (Distribution) 
+            Distribution d = (Distribution)
                 getMavenProject().getDistributionsMap().get(id);
-            
+
             getProject().setProperty("maven.tag", d.getTag());
         }
     }
Index: src/templates/build/plugins/core/build.xml
===================================================================
RCS file: /home/cvspublic/jakarta-turbine-maven/src/templates/build/plugins/core/build.xml,v
retrieving revision 1.2
diff -u -r1.2 build.xml
--- src/templates/build/plugins/core/build.xml	24 May 2002 15:41:28 -0000	1.2
+++ src/templates/build/plugins/core/build.xml	24 May 2002 23:46:39 -0000
@@ -25,7 +25,7 @@
   <!-- E N V I R O N M E N T                                              -->
   <!-- ================================================================== -->
 
-  <target 
+  <target
     name="env"
     depends="local-init,#callback("pre-env"),do-env,#callback("post-env")"/>
 
@@ -37,10 +37,10 @@
       java.home = ${java.home}
       user.home = ${user.home}
       lib.repo = ${lib.repo}
-      
+
       Classpath:
       ${maven.dependency.classpath}
-    </echo>      
+    </echo>
   </target>
 
   <!-- ================================================================== -->
@@ -104,17 +104,17 @@
     -->
     <property file="${maven.home}/plugins/core/default.properties" />
 
-    <taskdef 
+    <taskdef
       name="maven-update-check"
       className="org.apache.maven.UpdateMavenCheck">
       <classpath refid="maven-classpath"/>
     </taskdef>
 
     <maven-update-check/>
-    
+
     <echo>
       maven.mavenUpdateRequired = ${maven.mavenUpdateRequired}
-    </echo>      
+    </echo>
 
   </target>
 
@@ -125,22 +125,22 @@
   <target
     name="do-maven-update"
     if="maven.mavenUpdateRequired">
-        
+
     <!-- We need to update the Maven installation so we need to
-    
+
          1. Pull down the new distribution JAR (hopefully we can
             make this more efficient than having to replace the
             whole JAR but it will do for now).
-            
+
          2. Move the old directory out of the way.
-         
+
          3. Unpack the new distribution.
     -->
-    
+
     <property name="mavenUpdateZip" value="maven-${maven.mavenVersion}.zip"/>
 
     <!-- Grab the update zip file -->
-    <get 
+    <get
       src="${maven.updateSite}/${mavenUpdateZip}"
       dest="${lib.repo}/${mavenUpdateZip}"
       verbose="true"
@@ -157,7 +157,7 @@
 
     <!-- Make a the new one -->
     <mkdir dir="${maven.home}"/>
-    
+
     <!-- Unpack the new installation -->
     <unzip
       src="${lib.repo}/${mavenUpdateZip}"
@@ -178,50 +178,50 @@
 
   <target
     name="do-validate-pom">
-    
-    <taskdef 
+
+    <taskdef
       name="validate-pom" classname="org.apache.maven.XmlPomValidator">
       <classpath>
         <path refid="maven-classpath"/>
       </classpath>
     </taskdef>
-    
+
     <validate-pom
       projectDescriptor="project.xml"
       xmlSchema="${maven.home}/project.xsd"
     />
-    
+
   </target>
-    
+
 
   <!-- ================================================================== -->
   <!-- U S A G E                                                          -->
   <!-- ================================================================== -->
 
-  <target 
+  <target
     name="usage">
-    
+
     <echo message="use -projecthelp to see the available targets"/>
   </target>
 
   <!-- ================================================================== -->
   <!-- P R E P A R E  S O U R C E S                                       -->
   <!-- ================================================================== -->
-  
+
   <target
     name="prepare-sources"
     if="maven.prepareSourceDirectory">
-    
+
     <echo>
       maven.prepareSourceDirectory = ${maven.prepareSourceDirectory}
     </echo>
-    
+
     <mkdir dir="${maven.prepareSourceDirectory}"/>
-    
+
     <!-- We need to do this here but we need to make a
          fileset reference to make this easier.
     -->
-    
+
     <!--
     <copy todir="${build.dir}">
       <fileset dir=".">
@@ -229,8 +229,8 @@
       </fileset>
     </copy>
     -->
-    
-    <ant 
+
+    <ant
       antfile="${maven.delegatorBuildFile}"
       target="${maven.prepareSourceTarget}"
     />
@@ -297,13 +297,13 @@
       name="ajc"
       classname="org.aspectj.tools.ant.taskdefs.Ajc"/>
 
-    <ajc 
+    <ajc
       destdir="${maven.build.dest}"
       excludes="**/package.html"
       debug="${maven.compile.debug}"
       deprecation="${maven.compile.deprecation}"
       optimize="${maven.compile.optimize}">
-      
+
       <src>
         <path refid="maven.compile.src.set"/>
         <path refid="maven.src.aspect.set"/>
@@ -320,7 +320,7 @@
            does include Ant's runtime libraries when compiling, so to
            mimic this behavior, we need to manually include the jars
            from the ant.home/lib directory.
-         --> 
+         -->
         <fileset dir="${ant.home}/lib">
           <include name="**/*.jar"/>
         </fileset>
@@ -328,7 +328,7 @@
     </ajc>
 
   </target>
-  
+
   <!-- ================================================================== -->
   <!-- C H E C K S O U R C E                                              -->
   <!-- ================================================================== -->
@@ -336,10 +336,10 @@
     name="check-source"
     depends="local-init, env, #callback("pre-check-source"), do-check-source, #callback("post-check-source")"
     description="o Check the source code for style violations"/>
-    
+
   <target name="do-check-source" if="maven.sourcesPresent">
 
-    <taskdef 
+    <taskdef
       name="checkstyle"
       classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
       <classpath refid="maven-classpath"/>
@@ -389,12 +389,12 @@
       ignorePublicInInterface="${maven.checkstyle.ignore.public.in.interface}"
       failOnViolation="${maven.checkstyle.fail.on.violation}"
       cacheFile="${maven.checkstyle.cache.file}" >
-      <fileset 
-        dir="${maven.src.dir}" 
+      <fileset
+        dir="${maven.src.dir}"
         includes="${maven.checkstyle.includes}"
         excludes="${maven.checkstyle.excludes}"/>
-      <formatter type="xml" toFile="${maven.build.dir}/checkstyle-raw-report.xml"/> 
-      <formatter type="plain" toFile="${maven.build.dir}/checkstyle-raw-report.txt"/> 
+      <formatter type="xml" toFile="${maven.build.dir}/checkstyle-raw-report.xml"/>
+      <formatter type="plain" toFile="${maven.build.dir}/checkstyle-raw-report.txt"/>
     </checkstyle>
 
     <dvsl
@@ -407,15 +407,16 @@
       <classpath>
         <path refid="maven-classpath"/>
       </classpath>
-      <tool name="toolbox.string.srcDir" value="${maven.src.dir}"/>
+      <tool name="toolbox.string.srcSet" value="${maven.src.set}"/>
+      <tool name="toolbox.tool.pathUtil" value="org.apache.maven.util.PathUtil"/>
     </dvsl>
 
   </target>
-    
+
   <!-- ================================================================== -->
   <!-- J A R  R E S O U R C E S                                           -->
   <!-- ================================================================== -->
-  
+
   <target
     name="jar-resources"
     depends="local-init,env"
@@ -424,18 +425,18 @@
     <!-- Copy any resources that must be present in the deployed
          JAR file.
     -->
-    
+
     <echo>
       Copy resources into destination directory for deployment
       in the JAR.
     </echo>
-    
+
     <copy todir="${maven.build.dest}">
       <fileset dir="${maven.jarResources.basedir}">
         <patternset refid="maven.jar.resources.set"/>
       </fileset>
     </copy>
-  </target>    
+  </target>
 
   <!-- ================================================================== -->
   <!-- J A R                                                              -->
@@ -449,7 +450,7 @@
   <target name="do-jar" depends="jar-resources">
 
     <ant antfile="${maven.home}/plugins/test/build.xml" target="test"/>
-    
+
     <jar
       jarfile="${maven.build.dir}/${maven.final.name}.jar"
       basedir="${maven.build.dest}"
@@ -488,35 +489,35 @@
   <!--                                                                    -->
   <!-- You would use a command like the following to build a distribution -->
   <!-- for your project:                                                  -->
-  <!--                                                                    -->   
-  <!-- ant maven:dist -Dmaven.tag=MAVEN_B4                                -->      
+  <!--                                                                    -->
+  <!-- ant maven:dist -Dmaven.tag=MAVEN_B4                                -->
   <!-- ================================================================== -->
 
   <target name="dist" depends="dist-check-tag,#callback("pre-dist"),do-dist,#callback("post-dist")"/>
 
   <target name="do-dist" if="maven.tag">
-    
+
     <antcall target="dist-checkout-sources"/>
-    
+
   </target>
 
   <target
     name="dist-checkout-sources"
     depends="local-init">
-    
-    <!-- 
-    
+
+    <!--
+
     Make sure the dist directory is remove so that we know
     we are starting with a clean slate. We will also place a
     file in ${maven.distBuildDirectory} which indicates that
     it is ok to build a distribution within that directory.
-    
+
     -->
-    
+
     <delete dir="${maven.distBuildDirectory}"/>
     <mkdir dir="${maven.distBuildDirectory}/${maven.cvsModule}"/>
     <touch file="${maven.distBuildDirectory}/${maven.cvsModule}/${maven.distBuildIndicator}"/>
-    
+
     <cvs
       cvsRoot="${maven.cvsRoot}"
       package="${maven.cvsModule}"
@@ -525,29 +526,29 @@
     />
 
     <!--
-    
+
     Now that we have our freshly checked out sources we can use
     those sources to create our distribution.
-    
+
     -->
-    
-    <ant 
+
+    <ant
       dir="${maven.distBuildDirectory}/${maven.cvsModule}"
       target="maven:dist-build"
       inheritAll="false"
     />
-    
+
     <!--
-    
+
     The distributions have been created with fresh sources so
     lets move the distributions into a visible location and
     remove everything used to create the distributions so that
     no mistakes can be made unintentionally.
-    
+
     -->
-    
+
     <mkdir dir="${maven.distDirectory}"/>
-    
+
     <copy todir="${maven.distDirectory}">
       <fileset dir="${maven.distBuildDirectory}/${maven.cvsModule}/target">
         <include name="**/*.tar.gz"/>
@@ -612,11 +613,11 @@
       </tarfileset>
     </tar>
 
-    <gzip 
-      zipfile="${maven.build.dir}/${maven.final.name}.tar.gz" 
+    <gzip
+      zipfile="${maven.build.dir}/${maven.final.name}.tar.gz"
       src="${maven.build.dir}/${maven.final.name}.tar"
     />
-    
+
     <delete file="${maven.build.dir}/${maven.final.name}.tar"/>
 
     <!-- Create a zip file -->
@@ -658,11 +659,11 @@
       </tarfileset>
     </tar>
 
-    <gzip 
-      zipfile="${maven.build.dir}/${maven.final.name}-src.tar.gz" 
+    <gzip
+      zipfile="${maven.build.dir}/${maven.final.name}-src.tar.gz"
       src="${maven.build.dir}/${maven.final.name}-src.tar"
     />
-    
+
     <delete file="${maven.build.dir}/${maven.final.name}-src.tar"/>
 
     <!-- Create a zip file -->
@@ -687,8 +688,8 @@
   <!-- I N S T A L L  J A R                                               -->
   <!-- ================================================================== -->
 
-  <target 
-    name="install-jar" 
+  <target
+    name="install-jar"
     depends="jar,#callback("pre-install-jar"),do-install-jar,#callback("post-install-jar")"
     description="o Installs JAR file in local ${lib.repo}"/>
 
@@ -715,7 +716,7 @@
 
   <target name="do-gump-descriptor">
 
-    <taskdef 
+    <taskdef
       name="dvsl" classname="org.apache.tools.dvsl.DVSLTask">
       <classpath>
         <path refid="maven-classpath"/>
@@ -730,13 +731,13 @@
       in="project.xml"
       out="gump.xml"
     />
-  
+
     <taskdef
       name="gump-build"
       classname="org.apache.maven.BaseProjectTask">
       <classpath refid="maven-classpath"/>
     </taskdef>
-                              
+
     <gump-build
       controlTemplate="build-gump.xml"
       outputDirectory="${basedir}"
@@ -744,14 +745,14 @@
       outputFile="build-gump.xml"
       projectDescriptor="project.xml"
     />
-  
+
   </target>
 
   <!-- ================================================================== -->
   <!-- C L E A N                                                          -->
   <!-- ================================================================== -->
 
-  <target 
+  <target
     name="clean"
     depends="local-init,#callback("pre-clean"),do-clean,#callback("post-clean")"
     description="o Cleans up the build directory"/>
@@ -801,30 +802,30 @@
 
   <target
     name="do-announce">
-    
+
     <!-- Need to make sure all these values are set before trying
          to send an announcement so that we're not spamming
          people needlessly.
     -->
-    
+
     <property file="${maven.src.dir}/announcements/${maven.announcement}.properties"/>
-    
+
     <echo>
-      from="${maven.announcementFrom}" 
-      tolist="${maven.announcementRecipients}" 
+      from="${maven.announcementFrom}"
+      tolist="${maven.announcementRecipients}"
       subject="${maven.announcementSubject}"
       files="${maven.announcementFile}"
       mailHost="${maven.mailHost}"
-    </echo>    
-    
-    <mail 
-      from="${maven.announcementFrom}" 
-      tolist="${maven.announcementRecipients}" 
+    </echo>
+
+    <mail
+      from="${maven.announcementFrom}"
+      tolist="${maven.announcementRecipients}"
       subject="${maven.announcementSubject}"
       files="${maven.announcementFile}"
       mailHost="${maven.mailHost}"
     />
-  
+
   </target>
 
 </project>

