[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ant-dev
Subject:    DO NOT REPLY [Bug 39936]  New:  - when javac fails, no .class files are created (even for .java file
From:       bugzilla () apache ! org
Date:       2006-06-29 22:51:22
Message-ID: bug-39936-472 () http ! issues ! apache ! org/bugzilla/
[Download RAW message or body]

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39936>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39936

           Summary: when javac fails, no .class files are created (even for
                    .java files which had no errors)
           Product: Ant
           Version: 1.6.5
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: jthornsen@gmail.com


When a <javac> fails, no .class files at all are generated, even for .java files
in the source tree which did not generate any errors.

Is this behavior intentional, or is there a way to make <javac> behave such that
it creates as many .class files as it can without errors (as opposed to creating
nothing at all from any source of error)?  I could not find any information on
this in any of the documentation or help references.

This is a problem for us when we have 2 (or more) projects which each need to be
partially built in order for the other(s) to build as well.  Currently because
no .class files are generated (even for .java files which have no imports and
compile fine alone) other projects which import these classes cannot compile
either since the .class files they are looking for were not generated.

Suggestions on a workaround would also be appreciated.  Below is the build.xml
that I am using with an example directory structure (nothing fancy here...)

<project>
   <property name="src.dir"      value="src"/>
   <property name="classes.dir"  value="classes"/>

   <!--Set the classpath-->
   <path id="classpath">      
      <!--Classpaths here but not necessary to post-->
   </path>

   <target name="compile">
         <mkdir dir="${classes.dir}"/>
         <javac sourcepath="" srcdir="${src.dir}"
                destdir="${classes.dir}"
                fork="true"
                target="1.4"
                source="1.4">
            <classpath refid="classpath"/>
         </javac>
   </target>
</project>

An example directory structure would be:

Project1/
   build.xml (as above)
   src/
      package1/
         Class1.java (no imports, should compile fine alone)
         Class2.java (imports package2.Class1)
   classes/
      {No files ever get put here}
Project2/
   build.xml (as above)
   src/
      package2/
         Class1.java (no imports, should compile fine alone)
         Class2.java (imports package1.Class1)
   classes/
      {No files ever get put here}


I apologize if this is not considered a bug, but I couldn't find any other place
to ask this kind of question.

-Jeff T

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic