You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2008/09/02 15:44:48 UTC

DO NOT REPLY [Bug 43114] package-info.java repeatedly compiled

https://issues.apache.org/bugzilla/show_bug.cgi?id=43114


Jerry Andrews <je...@jrandrews.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jerry@jrandrews.org




--- Comment #10 from Jerry Andrews <je...@jrandrews.org>  2008-09-02 06:44:47 PST ---
(In reply to comment #9)
> As a workaround, can you at least do
> 
> <touch>
>   <fileset dir="tmp-src" include="**/package-info.java"/>
> </>
> 
> before <javac>?

That doesn't work if the target package directory doesn't already exist and the
package contains other classes or packages which fall alphabetically above
package-info.java.  In our case, if I do a clean and build, the
package-info.java file is never compiled, because the target package is created
by other .java files compiled in the package before the compiler gets to
package-info.java, then the rules above prevent its being built, because the
directory is newer than the file.  The only workaround I have is to build
package-info.java specifically and first, then the rest of the .java files in a
second call to javac.

It would be very nice if we could simply configure javac so that it follows the
rules above (which seem pretty good, overall), but override them explicitly if
we know that package-info.java is going to have annotations. Alternately,
ensure package-info sorts to the top of the javac compile list for a given
package and associated sub-packages.  Such a sort would make sure the package
directory was created by the package-info compile (thereby alleviating the
problem with "clean" builds).


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