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 DefaultCompilerAdapter.java
Date Thu, 27 Sep 2001 12:59:06 GMT
bodewig     01/09/27 05:59:06

  Modified:    .        Tag: ANT_14_BRANCH WHATSNEW
               src/main/org/apache/tools/ant/taskdefs Tag: ANT_14_BRANCH
                        Javac.java
               src/main/org/apache/tools/ant/taskdefs/compilers Tag:
                        ANT_14_BRANCH DefaultCompilerAdapter.java
  Log:
  ignore memory settings in non-forked javac.
  
  PR: 3555
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.144.2.16 +2 -0      jakarta-ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
  retrieving revision 1.144.2.15
  retrieving revision 1.144.2.16
  diff -u -r1.144.2.15 -r1.144.2.16
  --- WHATSNEW	2001/09/27 10:41:49	1.144.2.15
  +++ WHATSNEW	2001/09/27 12:59:06	1.144.2.16
  @@ -24,6 +24,8 @@
   * <mapper>s will now work as expected if the to pattern expands to an
     absolute pathname.
   
  +* <javac> didn't ignore memory settings in non-fork mode
  +
   Other changes:
   --------------
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.67.2.4  +14 -6     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.67.2.3
  retrieving revision 1.67.2.4
  diff -u -r1.67.2.3 -r1.67.2.4
  --- Javac.java	2001/09/14 15:16:34	1.67.2.3
  +++ Javac.java	2001/09/27 12:59:06	1.67.2.4
  @@ -452,10 +452,18 @@
        */
       public void setFork(boolean fork)
       {
  -  this.fork = fork;
  +        this.fork = fork;
       }
   
  +    /**
  +     * Sets whether to fork the javac compiler.
  +     */
  +    public boolean isForkedJavac() {
  +        return fork || 
  +            "extJavac".equals(project.getProperty("build.compiler"));
  +    }
   
  +
       /**
        * Sets whether the -nowarn option should be used.
        */
  @@ -508,8 +516,8 @@
   
           String compiler = project.getProperty("build.compiler");
   
  -  if (fork) {
  -      if (compiler != null) {
  +        if (fork) {
  +            if (compiler != null) {
                   if (isJdkCompiler(compiler)) {
                       log("Since fork is true, ignoring build.compiler setting.",
                           Project.MSG_WARN);
  @@ -518,13 +526,13 @@
                   else {
                       log("Since build.compiler setting isn't classic or modern, ignoring
fork setting.", Project.MSG_WARN);
                   }
  -      }
  +            }
               else {
                   compiler = "extJavac";
               }
  -  }
  +        }
   
  -  if (compiler == null) {
  +        if (compiler == null) {
               if (Project.getJavaVersion() != Project.JAVA_1_1 &&
                   Project.getJavaVersion() != Project.JAVA_1_2) {
                   compiler = "modern";
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.4   +12 -2     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.6.2.3
  retrieving revision 1.6.2.4
  diff -u -r1.6.2.3 -r1.6.2.4
  --- DefaultCompilerAdapter.java	2001/09/14 15:16:35	1.6.2.3
  +++ DefaultCompilerAdapter.java	2001/09/27 12:59:06	1.6.2.4
  @@ -216,11 +216,21 @@
           boolean usingJava1_1 = Project.getJavaVersion().equals(Project.JAVA_1_1);
           String memoryParameterPrefix = usingJava1_1 ? "-J-" : "-J-X";
           if (memoryInitialSize != null) {
  -            cmd.createArgument().setValue(memoryParameterPrefix+"ms"+memoryInitialSize);
  +            if (!attributes.isForkedJavac()) {
  +                attributes.log("Since fork is false, ignoring memoryInitialSize setting.",
  +                               Project.MSG_WARN);
  +            } else {
  +                cmd.createArgument().setValue(memoryParameterPrefix+"ms"+memoryInitialSize);
  +            }
           }
   
           if (memoryMaximumSize != null) {
  -            cmd.createArgument().setValue(memoryParameterPrefix+"mx"+memoryMaximumSize);
  +            if (!attributes.isForkedJavac()) {
  +                attributes.log("Since fork is false, ignoring memoryMaximumSize setting.",
  +                               Project.MSG_WARN);
  +            } else {
  +                cmd.createArgument().setValue(memoryParameterPrefix+"mx"+memoryMaximumSize);
  +            }
           }
   
           if (attributes.getNowarn()) {
  
  
  

Mime
View raw message