ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers CompilerAdapter.java DefaultCompilerAdapter.java Gcj.java Javac12.java Javac13.java JavacExternal.java Jikes.java Jvc.java Kjc.java Sj.java
Date Thu, 11 Apr 2002 15:20:33 GMT
bodewig     02/04/11 08:20:33

  Modified:    src/main/org/apache/tools/ant/taskdefs Javac.java
               src/main/org/apache/tools/ant/taskdefs/compilers
                        CompilerAdapter.java DefaultCompilerAdapter.java
                        Gcj.java Javac12.java Javac13.java
                        JavacExternal.java Jikes.java Jvc.java Kjc.java
                        Sj.java
  Log:
  cosmetics on the <javac> family - I didn't really read the code for
  the various adapters as reworking part of them is on my TODO list anyway.
  
  Revision  Changes    Path
  1.94      +15 -12    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
  retrieving revision 1.93
  retrieving revision 1.94
  diff -u -r1.93 -r1.94
  --- Javac.java	28 Mar 2002 12:15:27 -0000	1.93
  +++ Javac.java	11 Apr 2002 15:20:33 -0000	1.94
  @@ -103,7 +103,9 @@
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
    * @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
    *
  - * @version $Revision: 1.93 $
  + * @version $Revision: 1.94 $
  + *
  + * @since Ant 1.1
    *
    * @ant.task category="java"
    */
  @@ -147,7 +149,7 @@
        *
        * <p>default is null</p>
        *
  -     * @since 1.84, Ant 1.5
  +     * @since Ant 1.5
        */
       private String compiler = null;
   
  @@ -615,8 +617,9 @@
           for (Enumeration enum = implementationSpecificArgs.elements();
                enum.hasMoreElements();
                ) {
  -            String[] curr =
  -                ((ImplementationSpecificArgument) enum.nextElement()).getParts();
  +            ImplementationSpecificArgument arg = 
  +                ((ImplementationSpecificArgument) enum.nextElement());
  +            String[] curr = arg.getParts();
               for (int i=0; i<curr.length; i++) {
                   args.addElement(curr[i]);
               }
  @@ -631,11 +634,11 @@
        */
       public void execute() throws BuildException {
           checkParameters();
  -        String[] list = src.list();
  +        resetFileLists();
   
           // scan source directories and dest directory to build up
           // compile lists
  -        resetFileLists();
  +        String[] list = src.list();
           for (int i=0; i<list.length; i++) {
               File srcDir = project.resolveFile(list[i]);
               if (!srcDir.exists()) {
  @@ -703,7 +706,7 @@
       /**
        * Choose the implementation for this particular task.
        *
  -     * @since 1.84, Ant 1.5
  +     * @since Ant 1.5
        */
       public void setCompiler(String compiler) {
           this.compiler = compiler;
  @@ -715,7 +718,7 @@
        * <p>Defaults to the build.compiler property but can be overriden
        * via the compiler and fork attributes.</p>
        *
  -     * @since 1.84, Ant 1.5
  +     * @since Ant 1.5
        */
       public String getCompiler() {
           String compilerImpl = 
  @@ -740,8 +743,8 @@
           }
   
           if (compilerImpl == null) {
  -            if (JavaEnvUtils.getJavaVersion() != Project.JAVA_1_1 &&
  -                JavaEnvUtils.getJavaVersion() != Project.JAVA_1_2) {
  +            if (JavaEnvUtils.getJavaVersion() != JavaEnvUtils.JAVA_1_1 &&
  +                JavaEnvUtils.getJavaVersion() != JavaEnvUtils.JAVA_1_2) {
                   compilerImpl = "modern";
               } else {
                   compilerImpl = "classic";
  @@ -754,7 +757,7 @@
        * Check that all required attributes have been set and nothing
        * silly has been entered.
        *
  -     * @since 1.82, Ant 1.5
  +     * @since Ant 1.5
        */
       protected void checkParameters() throws BuildException {
           if (src == null) {
  @@ -777,7 +780,7 @@
       /**
        * Perform the compilation.
        *
  -     * @since 1.82, Ant 1.5
  +     * @since Ant 1.5
        */
       protected void compile() {
           String compilerImpl = getCompiler();
  
  
  
  1.3       +2 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapter.java
  
  Index: CompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CompilerAdapter.java	13 Sep 2001 08:40:37 -0000	1.2
  +++ CompilerAdapter.java	11 Apr 2002 15:20:33 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -68,6 +68,7 @@
    * reflection).</p>
    *
    * @author Jay Dickon Glanville <a href="mailto:jayglanville@home.com">jayglanville@home.com</a>
  + * @since Ant 1.3
    */
   
   public interface CompilerAdapter {
  
  
  
  1.22      +24 -13    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  
  Index: DefaultCompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- DefaultCompilerAdapter.java	8 Apr 2002 06:46:43 -0000	1.21
  +++ DefaultCompilerAdapter.java	11 Apr 2002 15:20:33 -0000	1.22
  @@ -78,6 +78,8 @@
    * @author Robin Green <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
    * @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
  + *
  + * @since Ant 1.3
    */
   public abstract class DefaultCompilerAdapter implements CompilerAdapter {
   
  @@ -162,9 +164,11 @@
               }
           } else {
               if ( includeAntRuntime ) {
  -                classpath.addExisting(compileClasspath.concatSystemClasspath("last"));
  +                classpath.addExisting(compileClasspath
  +                                      .concatSystemClasspath("last"));
               } else {
  -                classpath.addExisting(compileClasspath.concatSystemClasspath("ignore"));
  +                classpath.addExisting(compileClasspath
  +                                      .concatSystemClasspath("ignore"));
               }
           }
   
  @@ -202,19 +206,23 @@
           String memoryParameterPrefix = usingJava1_1 ? "-J-" : "-J-X";
           if (memoryInitialSize != null) {
               if (!attributes.isForkedJavac()) {
  -                attributes.log("Since fork is false, ignoring memoryInitialSize setting.",
  +                attributes.log("Since fork is false, ignoring "
  +                               + "memoryInitialSize setting.", 
                                  Project.MSG_WARN);
               } else {
  -                cmd.createArgument().setValue(memoryParameterPrefix+"ms"+memoryInitialSize);
  +                cmd.createArgument().setValue(memoryParameterPrefix
  +                                              + "ms" + memoryInitialSize);
               }
           }
   
           if (memoryMaximumSize != null) {
               if (!attributes.isForkedJavac()) {
  -                attributes.log("Since fork is false, ignoring memoryMaximumSize setting.",
  +                attributes.log("Since fork is false, ignoring "
  +                               + "memoryMaximumSize setting.",
                                  Project.MSG_WARN);
               } else {
  -                cmd.createArgument().setValue(memoryParameterPrefix+"mx"+memoryMaximumSize);
  +                cmd.createArgument().setValue(memoryParameterPrefix
  +                                              + "mx" + memoryMaximumSize);
               }
           }
   
  @@ -251,7 +259,8 @@
               cmd.createArgument().setPath(cp);
           } else {
               cmd.createArgument().setPath(classpath);
  -            // If the buildfile specifies sourcepath="", then don't output any sourcepath.
  +            // If the buildfile specifies sourcepath="", then don't
  +            // output any sourcepath.
               if (sourcepath.size() > 0) {
                   cmd.createArgument().setValue("-sourcepath");
                   cmd.createArgument().setPath(sourcepath);
  @@ -302,8 +311,8 @@
               } else if (Project.getJavaVersion().startsWith("1.2")) {
                   cmd.createArgument().setValue("-Xdepend");
               } else {
  -                attributes.log("depend attribute is not supported by the modern compiler",
  -                    Project.MSG_WARN);
  +                attributes.log("depend attribute is not supported by the "
  +                               + "modern compiler", Project.MSG_WARN);
               }
           }
   
  @@ -413,7 +422,8 @@
                       System.arraycopy(args, 0, commandArray, 0, firstFileName);
                       commandArray[firstFileName] = "@" + tmpFile;
                   } catch (IOException e) {
  -                    throw new BuildException("Error creating temporary file", e, location);
  +                    throw new BuildException("Error creating temporary file", 
  +                                             e, location);
                   } finally {
                       if (out != null) {
                           try {out.close();} catch (Throwable t) {}
  @@ -424,9 +434,10 @@
               }
   
               try {
  -                Execute exe = new Execute(new LogStreamHandler(attributes,
  -                                                               Project.MSG_INFO,
  -                                                               Project.MSG_WARN));
  +                Execute exe = new Execute(
  +                                  new LogStreamHandler(attributes,
  +                                                       Project.MSG_INFO,
  +                                                       Project.MSG_WARN));
                   exe.setAntRun(project);
                   exe.setWorkingDirectory(project.getBaseDir());
                   exe.setCommandline(commandArray);
  
  
  
  1.9       +5 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java
  
  Index: Gcj.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Gcj.java	25 Feb 2002 17:38:15 -0000	1.8
  +++ Gcj.java	11 Apr 2002 15:20:33 -0000	1.9
  @@ -65,6 +65,7 @@
    * This is primarily a cut-and-paste from the jikes.
    *
    * @author <a href="mailto:tora@debian.org">Takashi Okamoto</a>
  + * @since Ant 1.4
    */
   public class Gcj extends DefaultCompilerAdapter {
   
  @@ -79,7 +80,8 @@
           int firstFileName = cmd.size();
           logAndAddFilesToCompile(cmd);
   
  -        return executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
  +        return 
  +            executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
       }
   
       protected Commandline setupGCJCommand() {
  @@ -113,7 +115,8 @@
               cmd.createArgument().setFile(destDir);
               
               if(destDir.mkdirs()){
  -                throw new BuildException("Can't make output directories. Maybe permission
is wrong. ");
  +                throw new BuildException("Can't make output directories. "
  +                                         + "Maybe permission is wrong. ");
               };
           }
           
  
  
  
  1.5       +20 -9     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
  
  Index: Javac12.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Javac12.java	21 Nov 2001 23:09:39 -0000	1.4
  +++ Javac12.java	11 Apr 2002 15:20:33 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -73,6 +73,8 @@
    * @author Robin Green <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
    * @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
  + *
  + * @since Ant 1.3
    */
   public class Javac12 extends DefaultCompilerAdapter {
   
  @@ -85,24 +87,33 @@
               // Create an instance of the compiler, redirecting output to
               // the project log
               Class c = Class.forName("sun.tools.javac.Main");
  -            Constructor cons = c.getConstructor(new Class[] { OutputStream.class, String.class
});
  -            Object compiler = cons.newInstance(new Object[] { logstr, "javac" });
  +            Constructor cons = 
  +                c.getConstructor(new Class[] { OutputStream.class, 
  +                                               String.class });
  +            Object compiler = cons.newInstance(new Object[] { logstr, 
  +                                                              "javac" });
   
               // Call the compile() method
  -            Method compile = c.getMethod("compile", new Class [] { String[].class });
  -            Boolean ok = (Boolean)compile.invoke(compiler, new Object[] {cmd.getArguments()});
  +            Method compile = c.getMethod("compile", 
  +                                         new Class [] { String[].class });
  +            Boolean ok = 
  +                (Boolean)compile.invoke(compiler, 
  +                                        new Object[] {cmd.getArguments()});
               return ok.booleanValue();
           }
           catch (ClassNotFoundException ex) {
  -            throw new BuildException("Cannot use classic compiler, as it is not available"+
  -                                                         " A common solution is to set
the environment variable"+
  -                                     " JAVA_HOME to your jdk directory.", location);
  +            throw new BuildException("Cannot use classic compiler, as it is "
  +                                     + "not available.  A common solution is "
  +                                     + "to set the environment variable"
  +                                     + " JAVA_HOME to your jdk directory.", 
  +                                     location);
           }
           catch (Exception ex) {
               if (ex instanceof BuildException) {
                   throw (BuildException) ex;
               } else {
  -                throw new BuildException("Error starting classic compiler: ", ex, location);
  +                throw new BuildException("Error starting classic compiler: ", 
  +                                         ex, location);
               }
           } finally {
               try {
  
  
  
  1.6       +7 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java
  
  Index: Javac13.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Javac13.java	28 Oct 2001 21:27:51 -0000	1.5
  +++ Javac13.java	11 Apr 2002 15:20:33 -0000	1.6
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -71,6 +71,8 @@
    * @author Robin Green <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> 
    * @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
  + *
  + * @since Ant 1.3
    */
   public class Javac13 extends DefaultCompilerAdapter {
   
  @@ -90,13 +92,15 @@
               Method compile = c.getMethod ("compile",
                   new Class [] {(new String [] {}).getClass ()});
               int result = ((Integer) compile.invoke
  -                          (compiler, new Object[] {cmd.getArguments()})) .intValue ();
  +                          (compiler, new Object[] {cmd.getArguments()}))
  +                .intValue ();
               return (result == MODERN_COMPILER_SUCCESS);
           } catch (Exception ex) {
               if (ex instanceof BuildException) {
                   throw (BuildException) ex;
               } else {
  -                throw new BuildException("Error starting modern compiler", ex, location);
  +                throw new BuildException("Error starting modern compiler", 
  +                                         ex, location);
               }
           }
       }
  
  
  
  1.6       +4 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java
  
  Index: JavacExternal.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JavacExternal.java	5 Nov 2001 13:13:39 -0000	1.5
  +++ JavacExternal.java	11 Apr 2002 15:20:33 -0000	1.6
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -62,6 +62,7 @@
    * Performs a compile using javac externally.
    *
    * @author Brian Deitte
  + * @since Ant 1.4
    */
   public class JavacExternal extends DefaultCompilerAdapter {
   
  @@ -77,7 +78,8 @@
           int firstFileName = cmd.size();
           logAndAddFilesToCompile(cmd);
   
  -        return executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
  +        return 
  +            executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
       }
   
   }
  
  
  
  1.10      +13 -7     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java
  
  Index: Jikes.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Jikes.java	21 Mar 2002 09:17:01 -0000	1.9
  +++ Jikes.java	11 Apr 2002 15:20:33 -0000	1.10
  @@ -68,6 +68,7 @@
    * @author Robin Green <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> 
    * @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
  + * @since Ant 1.3
    */
   public class Jikes extends DefaultCompilerAdapter {
   
  @@ -172,10 +173,11 @@
            * that don't exist. As this is often the case, these
            * warning can be pretty annoying.
            */
  -        String warningsProperty = project.getProperty("build.compiler.warnings");
  +        String warningsProperty = 
  +            project.getProperty("build.compiler.warnings");
           if (warningsProperty != null) {
  -            attributes.log("!! the build.compiler.warnings property is deprecated. !!",
  -                           Project.MSG_WARN);
  +            attributes.log("!! the build.compiler.warnings property is "
  +                           + "deprecated. !!", Project.MSG_WARN);
               attributes.log("!! Use the nowarn attribute instead. !!",
                              Project.MSG_WARN);
               if (!Project.toBoolean(warningsProperty)) {
  @@ -194,7 +196,8 @@
           /**
            * Jikes can issue pedantic warnings. 
            */
  -        String pedanticProperty = project.getProperty("build.compiler.pedantic");
  +        String pedanticProperty = 
  +            project.getProperty("build.compiler.pedantic");
           if (pedanticProperty != null && Project.toBoolean(pedanticProperty)) {
               cmd.createArgument().setValue("+P");
           }
  @@ -204,8 +207,10 @@
            * checking", see the jikes documentation for differences
            * between -depend and +F.
            */
  -        String fullDependProperty = project.getProperty("build.compiler.fulldepend");
  -        if (fullDependProperty != null && Project.toBoolean(fullDependProperty))
{
  +        String fullDependProperty = 
  +            project.getProperty("build.compiler.fulldepend");
  +        if (fullDependProperty != null 
  +            && Project.toBoolean(fullDependProperty)) {
               cmd.createArgument().setValue("+F");
           }
   
  @@ -219,7 +224,8 @@
           int firstFileName = cmd.size();
           logAndAddFilesToCompile(cmd);
   
  -        return executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
  +        return 
  +            executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
       }
   
   
  
  
  
  1.6       +4 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Jvc.java
  
  Index: Jvc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Jvc.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Jvc.java	6 Nov 2001 10:47:33 -0000	1.5
  +++ Jvc.java	11 Apr 2002 15:20:33 -0000	1.6
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -68,6 +68,7 @@
    * @author Robin Green <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> 
    * @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
  + * @since Ant 1.3
    */
   public class Jvc extends DefaultCompilerAdapter {
   
  @@ -135,6 +136,7 @@
           int firstFileName = cmd.size();
           logAndAddFilesToCompile(cmd);
   
  -        return executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
  +        return 
  +            executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
       }
   }
  
  
  
  1.6       +30 -24    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java
  
  Index: Kjc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Kjc.java	27 Nov 2001 18:04:52 -0000	1.5
  +++ Kjc.java	11 Apr 2002 15:20:33 -0000	1.6
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -69,7 +69,9 @@
    * This is primarily a cut-and-paste from Jikes.java and
    * DefaultCompilerAdapter.
    *
  - * @author <a href="mailto:tora@debian.org">Takashi Okamoto</a> + */
  + * @author <a href="mailto:tora@debian.org">Takashi Okamoto</a> 
  + * @since Ant 1.4
  + */
   public class Kjc extends DefaultCompilerAdapter {
   
       public boolean execute() throws BuildException {
  @@ -82,20 +84,24 @@
               // Call the compile() method
               Method compile = c.getMethod("compile",
                                            new Class [] { String [].class });
  -            Boolean ok = (Boolean)compile.invoke(null,
  -                                                 new Object[] {cmd.getArguments()});
  +            Boolean ok = 
  +                (Boolean)compile.invoke(null, 
  +                                        new Object[] {cmd.getArguments()});
               return ok.booleanValue();
           }
           catch (ClassNotFoundException ex) {
  -            throw new BuildException("Cannot use kjc compiler, as it is not available"+
  -                                     " A common solution is to set the environment variable"+
  -                                     " CLASSPATH to your kjc archive (kjc.jar).", location);
  +            throw new BuildException("Cannot use kjc compiler, as it is not "
  +                                     + "available. A common solution is to "
  +                                     + "set the environment variable CLASSPATH "
  +                                     + "to your kjc archive (kjc.jar).", 
  +                                     location);
           }
           catch (Exception ex) {
               if (ex instanceof BuildException) {
                   throw (BuildException) ex;
               } else {
  -                throw new BuildException("Error starting kjc compiler: ", ex, location);
  +                throw new BuildException("Error starting kjc compiler: ", 
  +                                         ex, location);
               }
           }
       }
  @@ -121,33 +127,33 @@
           // generate the clsspath
           cmd.createArgument().setValue("-classpath");
   
  -    Path cp = new Path(project);
  +        Path cp = new Path(project);
   
  -    // kjc don't have bootclasspath option.
  -    if (bootclasspath != null) {
  +        // kjc don't have bootclasspath option.
  +        if (bootclasspath != null) {
               cp.append(bootclasspath);
  -    }
  -
  -    if (extdirs != null) {
  +        }
  +        
  +        if (extdirs != null) {
               cp.addExtdirs(extdirs);
  -    }
  -
  -    cp.append(classpath);
  -    cp.append(src);
  -
  -    cmd.createArgument().setPath(cp);
  -
  -    // kjc-1.5A doesn't support -encoding option now.
  +        }
  +        
  +        cp.append(classpath);
  +        cp.append(src);
  +        
  +        cmd.createArgument().setPath(cp);
  +        
  +        // kjc-1.5A doesn't support -encoding option now.
           // but it will be supported near the feature.
           if (encoding != null) {
               cmd.createArgument().setValue("-encoding");
               cmd.createArgument().setValue(encoding);
           }
  -
  +        
           if (debug) {
               cmd.createArgument().setValue("-g");
           }
  -
  +        
           if (optimize) {
               cmd.createArgument().setValue("-O2");
           }
  
  
  
  1.5       +3 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Sj.java
  
  Index: Sj.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Sj.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Sj.java	25 Feb 2002 17:38:15 -0000	1.4
  +++ Sj.java	11 Apr 2002 15:20:33 -0000	1.5
  @@ -63,6 +63,7 @@
    * Uses the defaults for DefaultCompilerAdapter
    * 
    * @author <a href="mailto:don@bea.com">Don Ferguson</a>
  + * @since Ant 1.4
    */
   public class Sj extends DefaultCompilerAdapter {
   
  @@ -77,7 +78,8 @@
   
           int firstFileName = cmd.size() - compileList.length;
   
  -        return executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
  +        return 
  +            executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
       }
   
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message