bodewig     2005/03/17 02:19:19

  Modified:    .        Tag: ANT_16_BRANCH WHATSNEW
               docs/manual/CoreTasks Tag: ANT_16_BRANCH javac.html
               src/main/org/apache/tools/ant/taskdefs/compilers Tag:
                        ANT_16_BRANCH Jikes.java
  Log:
  merge
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.503.2.203 +5 -3      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.202
  retrieving revision 1.503.2.203
  diff -u -r1.503.2.202 -r1.503.2.203
  --- WHATSNEW  17 Mar 2005 09:38:59 -0000      1.503.2.202
  +++ WHATSNEW  17 Mar 2005 10:18:43 -0000      1.503.2.203
  @@ -20,6 +20,11 @@
     you must set filtertrace to false.
     Bugzilla Report 22758
   
  +* The jikes compiler adapter now supports -bootclasspath, -extdirs and
  +  -sourcepath and also uses the same logic for debug flags as javac.
  +  This means, the jikes compiler adapter now requires Jikes 1.15 or later.
  +  Bugzilla Reports 25868, 26404 and 32609.
  +
   Other changes:
   --------------
   
  @@ -58,9 +63,6 @@
   
   * added a new mapper <filtermapper>
   
  -* The jikes compiler adapter now supports -bootclasspath.  Bugzilla
  -  Report 32609.
  -
   * When a BuildListener tried to access System.err or System.out, Ant
     would have thrown an exception - this has been changed.  Ant now
     silently ignores the message.  BuildListeners still should avoid
  
  
  
  No                   revision
  No                   revision
  1.42.2.10 +4 -2      ant/docs/manual/CoreTasks/javac.html
  
  Index: javac.html
  ===================================================================
  RCS file: /home/cvs/ant/docs/manual/CoreTasks/javac.html,v
  retrieving revision 1.42.2.9
  retrieving revision 1.42.2.10
  diff -u -r1.42.2.9 -r1.42.2.10
  --- javac.html        28 Jan 2005 16:39:20 -0000      1.42.2.9
  +++ javac.html        17 Mar 2005 10:19:18 -0000      1.42.2.10
  @@ -58,7 +58,7 @@
         <code>javac1.4</code> and
         <code>javac1.5</code> can be used as aliases.</li>
     <li><code>jikes</code> (the <a
  -    href="http://oss.software.ibm.com/developerworks/opensource/jikes/"; 
target="_top">Jikes</a>
  +    href="http://jikes.sourceforge.net/"; target="_top">Jikes</a>
       compiler).</li>
     <li><code>jvc</code> (the Command-Line Compiler from Microsoft's SDK
         for Java / Visual J++) &ndash; <code>microsoft</code> can be used
  @@ -209,7 +209,7 @@
       <td valign="top">debuglevel</td>
       <td valign="top">Keyword list to be appended to the <code>-g</code>
         command-line switch.  This will be ignored by all implementations 
except
  -      <code>modern</code> and <code>classic(ver &gt;= 1.2)</code>.
  +      <code>modern</code>, <code>classic(ver &gt;= 1.2)</code> and 
<code>jikes</code>.
         Legal values are <code>none</code> or a comma-separated list of the
         following keywords:
         <code>lines</code>, <code>vars</code>, and <code>source</code>.
  @@ -536,6 +536,8 @@
   
   <h3>Jikes Notes</h3>
   
  +<p>You need Jikes 1.15 or later.</p>
  +
   <p>Jikes supports some extra options, which can be set be defining
   the properties shown below prior to invoking the task. The setting
   for each property will be in affect for all <code>&lt;javac&gt;</code>
  
  
  
  No                   revision
  No                   revision
  1.22.2.9  +30 -20    
ant/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java
  
  Index: Jikes.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java,v
  retrieving revision 1.22.2.8
  retrieving revision 1.22.2.9
  diff -u -r1.22.2.8 -r1.22.2.9
  --- Jikes.java        4 Feb 2005 15:42:03 -0000       1.22.2.8
  +++ Jikes.java        17 Mar 2005 10:19:18 -0000      1.22.2.9
  @@ -44,11 +44,24 @@
       public boolean execute() throws BuildException {
           attributes.log("Using jikes compiler", Project.MSG_VERBOSE);
   
  -        Path classpath = new Path(project);
  +        Commandline cmd = new Commandline();
   
  -        // Jikes doesn't support an extension dir (-extdir)
  -        // so we'll emulate it for compatibility and convenience.
  -        classpath.addExtdirs(extdirs);
  +        // For -sourcepath, use the "sourcepath" value if present.
  +        // Otherwise default to the "srcdir" value.
  +        Path sourcepath = null;
  +        if (compileSourcepath != null) {
  +            sourcepath = compileSourcepath;
  +        } else {
  +            sourcepath = src;
  +        }
  +        // If the buildfile specifies sourcepath="", then don't
  +        // output any sourcepath.
  +        if (sourcepath.size() > 0) {
  +            cmd.createArgument().setValue("-sourcepath");
  +            cmd.createArgument().setPath(sourcepath);
  +        }
  +
  +        Path classpath = new Path(project);
   
           if (bootclasspath == null || bootclasspath.size() == 0) {
               // no bootclasspath, therefore, get one from the java runtime
  @@ -61,21 +74,17 @@
           }
           classpath.append(getCompileClasspath());
   
  -        // Jikes has no option for source-path so we
  -        // will add it to classpath.
  -        if (compileSourcepath != null) {
  -            classpath.append(compileSourcepath);
  -        } else {
  -            classpath.append(src);
  -        }
  -
           // if the user has set JIKESPATH we should add the contents as well
           String jikesPath = System.getProperty("jikes.class.path");
           if (jikesPath != null) {
               classpath.append(new Path(project, jikesPath));
           }
   
  -        Commandline cmd = new Commandline();
  +        if (extdirs != null && extdirs.size() > 0) {
  +            cmd.createArgument().setValue("-extdirs");
  +            cmd.createArgument().setPath(extdirs);
  +        }
  +
           String exec = getJavac().getExecutable();
           cmd.setExecutable(exec == null ? "jikes" : exec);
   
  @@ -96,7 +105,14 @@
               cmd.createArgument().setValue(encoding);
           }
           if (debug) {
  -            cmd.createArgument().setValue("-g");
  +            String debugLevel = attributes.getDebugLevel();
  +            if (debugLevel != null) {
  +                cmd.createArgument().setValue("-g:" + debugLevel);
  +            } else {
  +                cmd.createArgument().setValue("-g");
  +            }
  +        } else {
  +            cmd.createArgument().setValue("-g:none");
           }
           if (optimize) {
               cmd.createArgument().setValue("-O");
  @@ -148,12 +164,6 @@
                   cmd.createArgument().setValue("-nowarn");
               }
           } if (attributes.getNowarn()) {
  -            /*
  -             * FIXME later
  -             *
  -             * let the magic property win over the attribute for backwards
  -             * compatibility
  -             */
               cmd.createArgument().setValue("-nowarn");
           }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to