Closed jimporter closed 8 years ago
It actually is possible to track what output files were written:
https://github.com/felix-lang/fbuild/blob/master/lib/fbuild/builders/java.py#L235-L277
Yeah, that's one option I've considered. I'm not sure I like it though, since it would basically involve having the build target for javac
be a random file containing the names of all the .class
files, instead of the target being the .class
files themselves. Basically, compiling foo.java
would output foo.classlist
, which would contain:
foo.class
foo$bar.class
...
Java (and Scala, etc) can produce multiple
.class
files for each source file compiled. This poses problems when packaging them up into a.jar
, since the extra files will get missed. We need to find a way to determine where these files are and get them included into the.jar
files. Maybe they use a common template for their names? That's what Scala seems to do, at least: the extra files look likesource$foo.class
.Ideally, we could also track these files for the purposes of removing them when running
clean
, but that might be more than we can do.Java is bad.