Menu

#470 build target compile-test has two defects

Fixed_0.6.1
closed-fixed
nobody
None
5
2013-01-16
2007-04-17
Michael
No

Possibly three if you think it should be in the build stream or one if it's obsolete.

<target name="compile-test" depends="init">
<mkdir dir="${freecol.build.dir}"/>
<javac srcdir="test/src"
destdir="${freecol.build.dir}"
classpath="test/lib/junit.jar"
debug="on"
optimize="on"
deprecation="off"
source="1.5"
/>
</target>
change source from 1.4 to 1.5. 1.4 does not allow generics.

add the following to classpath, just before the final quote:${basedir}/jars/higlayout.jar:${basedir}/jars/jsr173_1.0_api.jar:${basedir}/jars/wstx-lgpl-4.0pr1.jar

The second fix fixes the xml streamreader not found problem.

Discussion

  • Michael Vehrs

    Michael Vehrs - 2007-04-18

    Logged In: YES
    user_id=73455
    Originator: NO

    I do not have a problem with the compile-test and wstx is already in my classpath. What version of build.xml are we talking about?

     
  • Michael

    Michael - 2007-04-18

    Logged In: YES
    user_id=1758816
    Originator: YES

    Commenting on each issue separately, source issue first.

    CVS version 1.36 (same in this section as 1.34)

    compile-test:
    [javac] Compiling 18 source files to /Users/michael/Projects/FreeCol/freecol/build
    [javac] /Users/michael/Projects/FreeCol/freecol/test/src/net/sf/freecol/common/model/ColonyProductionTest.java:13: generics are not supported in -source 1.4
    [javac] (try -source 1.5 to enable generics)
    [javac] Vector<Player> players = new Vector<Player>();
    ...
    [javac] ^
    [javac] 8 errors

    error repeats 8 times. switching source="1.4" to source="1.5" resolves this. the compile target already has source="1.5"

     
  • Michael

    Michael - 2007-04-18

    Logged In: YES
    user_id=1758816
    Originator: YES

    Commenting on each issue separately, classpath issue next.

    "wstx is already in my classpath."
    It would make the build more robust to not have that as an undocumented requirement when it isn't necessary if we mirror the classpath line from the compile target. The error that people who don't have wstx in their system classpath will see is below, a simple copy of line 55 of the build xml to after line 67 eliminates this, so why not?

    CVS version 1.36 (same in this section as 1.34)
    compile-test:
    [javac] Compiling 18 source files to /Users/michael/Projects/FreeCol/freecol/build
    [javac] /Users/michael/Projects/FreeCol/freecol/test/src/net/sf/freecol/common/model/ColonyProductionTest.java:16: cannot access javax.xml.stream.XMLStreamReader
    [javac] file javax/xml/stream/XMLStreamReader.class not found
    [javac] Player p = new Player(game, String.valueOf(i), false, i);
    [javac] ^
    [javac] 1 error

     
  • Michael Vehrs

    Michael Vehrs - 2007-04-19
    • milestone: --> Fixed_(FreeCol_0.6.1)
    • status: open --> closed-fixed
     
  • Michael Vehrs

    Michael Vehrs - 2007-04-19

    Logged In: YES
    user_id=73455
    Originator: NO

    Fixed by the reporter himself.

     

Log in to post a comment.

MongoDB Logo MongoDB