Bummer - this one worked for us, but you're right, the patch 3 version is
better in general...
--
dIon Gillard, Multitask Consulting
Work: http://www.multitask.com.au
Developers: http://adslgateway.multitask.com.au/developers
"Vincent
Massol" To: "'Turbine Maven Developers List'"
<vmassol@octo. <[EMAIL PROTECTED]>
com> cc:
Subject: RE: cvs commit:
05/27/02 04:43
jakarta-turbine-maven/src/java/org/apache/maven DVSLPathTool.java
PM
Please respond
to "Turbine
Maven
Developers
List"
Hi dIon,
Thanks. This is patch 2. I have submitted patch 3 yesterday which
handles default packages and such. I'm going to work now and will
probably not be able to work on it for a few hours.
If you don't commit it, I'll do that later today as I now have CVS
access :-)
-Vincent
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 27 May 2002 06:33
> To: [EMAIL PROTECTED]
> Subject: cvs commit: jakarta-turbine-maven/src/java/org/apache/maven
> DVSLPathTool.java
>
> dion 02/05/26 22:33:16
>
> Modified: src/java/org/apache/maven DVSLPathTool.java
> Log:
> Added Vincent Massol's patch for correctly determining class names
>
> Revision Changes Path
> 1.6 +30 -1 jakarta-turbine-
> maven/src/java/org/apache/maven/DVSLPathTool.java
>
> Index: DVSLPathTool.java
> ===================================================================
> RCS file: /home/cvs/jakarta-turbine-
> maven/src/java/org/apache/maven/DVSLPathTool.java,v
> retrieving revision 1.5
> retrieving revision 1.6
> diff -u -r1.5 -r1.6
> --- DVSLPathTool.java 6 May 2002 02:03:31 -0000 1.5
> +++ DVSLPathTool.java 27 May 2002 05:33:15 -0000 1.6
> @@ -54,7 +54,12 @@
> * <http://www.apache.org/>.
> */
>
> +import java.io.IOException;
> +import java.io.File;
> +
> import org.apache.commons.lang.Strings;
> +import jdepend.framework.JavaSourceFileParser;
> +import jdepend.framework.JavaClass;
>
> /**
> * Path tool for use with the DVSL toolbox. This class contains
static
> @@ -62,7 +67,8 @@
> * relative paths.
> *
> * @author <a href="mailto:[EMAIL PROTECTED]">Pete
> Kazmier</a>
> - * @version $Id: DVSLPathTool.java,v 1.5 2002/05/06 02:03:31 kaz
Exp $
> + * @author <a href="[EMAIL PROTECTED]">Vincent Massol</a>
> + * @version $Id: DVSLPathTool.java,v 1.6 2002/05/27 05:33:15 dion
Exp $
> */
> public class DVSLPathTool
> {
> @@ -256,4 +262,27 @@
>
> return forwardCount >= backwardCount ? "/" : "\\";
> }
> +
> + /**
> + * Extracts the package name from the java source file and
returns
> it as
> + * a directory. For example if the file name is :
> + * "e:\tmp\src\main\org\apache\maven\Code.java", and
> <code>Code.java</code>
> + * is in the <code>org.apache.maven</code> package, this method
> will
> + * return "org\apache\maven\Code.java" (or
> "org/apache/maven/Code.java" on
> + * unix).
> + *
> + * @param absoluteFileName the absolute file name to transform
> + * @return the shortened file name matching the class package
name.
> + * @throws java.io.IOException upon failure to read the java
file
> + */
> + public static final String getPackagePath(String
absoluteFileName)
> throws IOException
> + {
> + JavaSourceFileParser parser = new JavaSourceFileParser();
> + JavaClass clazz = parser.parse(absoluteFileName);
> + String packageName = clazz.getPackageName();
> +
> + return packageName.replace('.', File.separatorChar) +
> + File.separatorChar + clazz.getName() + ".java";
> + }
> +
> }
>
>
>
>
> --
> To unsubscribe, e-mail: <mailto:turbine-maven-dev-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:turbine-maven-dev-
> [EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>