You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ru...@us.ibm.com on 1999/12/10 16:54:00 UTC

PATCH: build test broken on Windows: moo not in classpath


The root problem is that the code below is executed *AFTER* the call to
translatePath is made in setClasspath.

Index: Javac.java
===================================================================
RCS file:
/home/cvs/jakarta-tools/ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v

retrieving revision 1.13
diff -u -r1.13 Javac.java
--- Javac.java 1999/11/24 23:46:46 1.13
+++ Javac.java 1999/12/10 15:53:40
@@ -306,10 +306,8 @@
     // add our classpath to the mix

     if (compileClasspath != null) {
-        // using ":" here because this comes from the XML file and thus
-        // isn't platform specific
         StringTokenizer tok = new StringTokenizer(compileClasspath,
-            ":", false);
+            System.getProperty("path.separator"), false);
         while (tok.hasMoreTokens()) {
          File f = project.resolveFile(tok.nextToken());
          classpath.append(f.getAbsolutePath());
@@ -423,4 +421,4 @@
     private void doJikesCompile() throws BuildException {
     project.log("Performing a Jikes COmpile");
     }
-}
\ No newline at end of file
+}



Re: PATCH: build test broken on Windows: moo not in classpath

Posted by Luis Arias <lu...@elysia.com>.

> True, a much better solution would be to have elements inside elements
> and use XML syntax to do the job (as it should have since the
> beginning), on the other hand this requires much more changes on both
> code and build files.

I think its better to do the right fix... The attribute based stuff is quick
and easy but what your really want to do is express your build correctly,
right ?  In one of my projects I inspired myself from what had been done in
ant to reflect and set bean properties but I chose a different syntax for
them, explicitely specifing properties with child elements and leaving
attributes for the basic mechanics of my code, something like:

<rule name="Funk" class="com.rule.JamesBrown">
  <param name="bpm" value="140" />
</rule>

Probably attributes should be limited to the case where there's a one to one
relationship between the tag and the attribute value.  The classpath can be
viewed as having different components in which case it would be better to
have child elements.  Same thing with bean properties, a bean may have
several bean properties needing to be set for a particular build.


Re: PATCH: build test broken on Windows: moo not in classpath

Posted by Stefano Mazzocchi <st...@apache.org>.
rubys@us.ibm.com wrote:
> 
> The root problem is that the code below is executed *AFTER* the call to
> translatePath is made in setClasspath.
> 
> Index: Javac.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-tools/ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
> 
> retrieving revision 1.13
> diff -u -r1.13 Javac.java
> --- Javac.java 1999/11/24 23:46:46 1.13
> +++ Javac.java 1999/12/10 15:53:40
> @@ -306,10 +306,8 @@
>      // add our classpath to the mix
> 
>      if (compileClasspath != null) {
> -        // using ":" here because this comes from the XML file and thus
> -        // isn't platform specific
>          StringTokenizer tok = new StringTokenizer(compileClasspath,
> -            ":", false);
> +            System.getProperty("path.separator"), false);
>          while (tok.hasMoreTokens()) {
>           File f = project.resolveFile(tok.nextToken());
>           classpath.append(f.getAbsolutePath());
> @@ -423,4 +421,4 @@
>      private void doJikesCompile() throws BuildException {
>      project.log("Performing a Jikes COmpile");
>      }
> -}
> \ No newline at end of file
> +}

People, we need to fix this seriously and stop going back and forward
with 'path.separator':

1) if you apply this patch you break Ant for windows.
2) if you don't it is still broken

So, I propose to use commas to separate instead of ':' or ';', comma
that is the same for every damn platform and allows me to use the same
build file on every system (which is the first goal, after all).

True, a much better solution would be to have elements inside elements
and use XML syntax to do the job (as it should have since the
beginning), on the other hand this requires much more changes on both
code and build files.

Can we vote on this?


-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche