J
Joshua Maurice
I'm sorry if this is answered in a FAQ somewhere, but the first
comp.lang.java.programmer FAQ I found referenced Java version 1.1, so
I stopped reading there.
I'm working on a project now with over 20,000 java source files, in
addition to more than 4,000 C++ source files, some forms of custom
code generation, an eclipse build, and probably other things I don't
know offhand.
Due to various requirements, we cannot put all of the source files
into a single jar. Many jars are requirements. (Different jars for
plugins, for client API, server impl. Then multiply by several
different products, and we arrive at over required 200 jars.)
How do you build your java code?
I'm looking for a fast, correct build. Let me be very specific with
the term "correct". A build is correct iff a build is equivalent to if
you completely cleaned the source file system beforehand of previously
build files.
To be fast with such a large number of files, you basically need to
have an incremental parallel build, possibly distributed (though this
is harder with Java than say C++, for example).
Let's ignore parallel (and distributed) for the moment. If I can find
a way to incrementally build java, then I could probably write the
parallel part myself with make. However, from my limited googling,
there is no such thing as a correct incremental java compile, except
maybe Jikes.
javac doesn't cut it on its own. If it had the "-M" option of gcc or
any other sane compiler, I could pretty easily hack it together
myself. I need the compiler's help to do it; the class file does not
contain sufficient information. Anything based on reading class files
for dependency information is fatally flawed as it might miss critical
dependencies. My QA department does not want to take an incremental
build if there's a 5-10% chance of it being incorrect. They'd rather
wait for a clean build, and rightfully so. They don't want to waste
days of work just to learn it's a build issue.
javamake aka JMake appears to be barely supported, and it seems from
what little I can gather that it uses information from classfiles, so
it is also incorrect and insufficient. It's GNU copyleft license might
also make my company's lawyers wince.
Ant doesn't cut it either. Its depend task does even less than
javamake. It doesn't check any dependencies except the classfile
timestamp on its java source file. I doubt it even checks classfile
and java timestamps for non-public top level classes.
As a Hail Mary, I could look up the Java grammar, or some open source
Java parser, and parse the Java files and get the information myself.
I just need to be able to get the list of package qualified classes
used by a Java source file.
However, perhaps Jikes could do what I need. Does anyone have any
notable experience with it? Will it give me a list of package
qualified classes used by each Java source file? Unfortunately, its
documentation appears non-existent. Could potentially anyone point me
to it perhaps?
I was thinking that perhaps there's some way to invoke Eclipse from
the command line. Is there a way? And is Eclipse just "smart enough"
to correctly incrementally compile Java code when invoked from the
command line?
How do you compile your Java? 20,000 source files is not something to
laugh at and just "clean each time" nor "cross your fingers and hope
that Ant depends or javamake catches all of the dependencies" as each
missed dependency could result in lost developer man weeks. Moreover,
the problem is exacerbated with the other non-Java components of our
build. For example, some java source is generated by in-house custom
tools (in order to get serialization between C++ and Java), and
incremental becomes even more important as it's not just 20,000 java
source files anymore. It's even more taking even more time, greatly
increasing the need for a correct fast (and thus incremental and
parallel) build.
Frankly, the current state of affairs in the Java community is not
acceptable, and even laughable, given that solutions to these problems
(fast build, correct build) are known and have been known for many,
many years in the context of C and C++. (That javac cannot or will not
output dependency information ala gcc -M is amazing.) Having said
that, I would love to be proven quite wrong. I thank you in advance
for any advice or insight you are willing to give.
comp.lang.java.programmer FAQ I found referenced Java version 1.1, so
I stopped reading there.
I'm working on a project now with over 20,000 java source files, in
addition to more than 4,000 C++ source files, some forms of custom
code generation, an eclipse build, and probably other things I don't
know offhand.
Due to various requirements, we cannot put all of the source files
into a single jar. Many jars are requirements. (Different jars for
plugins, for client API, server impl. Then multiply by several
different products, and we arrive at over required 200 jars.)
How do you build your java code?
I'm looking for a fast, correct build. Let me be very specific with
the term "correct". A build is correct iff a build is equivalent to if
you completely cleaned the source file system beforehand of previously
build files.
To be fast with such a large number of files, you basically need to
have an incremental parallel build, possibly distributed (though this
is harder with Java than say C++, for example).
Let's ignore parallel (and distributed) for the moment. If I can find
a way to incrementally build java, then I could probably write the
parallel part myself with make. However, from my limited googling,
there is no such thing as a correct incremental java compile, except
maybe Jikes.
javac doesn't cut it on its own. If it had the "-M" option of gcc or
any other sane compiler, I could pretty easily hack it together
myself. I need the compiler's help to do it; the class file does not
contain sufficient information. Anything based on reading class files
for dependency information is fatally flawed as it might miss critical
dependencies. My QA department does not want to take an incremental
build if there's a 5-10% chance of it being incorrect. They'd rather
wait for a clean build, and rightfully so. They don't want to waste
days of work just to learn it's a build issue.
javamake aka JMake appears to be barely supported, and it seems from
what little I can gather that it uses information from classfiles, so
it is also incorrect and insufficient. It's GNU copyleft license might
also make my company's lawyers wince.
Ant doesn't cut it either. Its depend task does even less than
javamake. It doesn't check any dependencies except the classfile
timestamp on its java source file. I doubt it even checks classfile
and java timestamps for non-public top level classes.
As a Hail Mary, I could look up the Java grammar, or some open source
Java parser, and parse the Java files and get the information myself.
I just need to be able to get the list of package qualified classes
used by a Java source file.
However, perhaps Jikes could do what I need. Does anyone have any
notable experience with it? Will it give me a list of package
qualified classes used by each Java source file? Unfortunately, its
documentation appears non-existent. Could potentially anyone point me
to it perhaps?
I was thinking that perhaps there's some way to invoke Eclipse from
the command line. Is there a way? And is Eclipse just "smart enough"
to correctly incrementally compile Java code when invoked from the
command line?
How do you compile your Java? 20,000 source files is not something to
laugh at and just "clean each time" nor "cross your fingers and hope
that Ant depends or javamake catches all of the dependencies" as each
missed dependency could result in lost developer man weeks. Moreover,
the problem is exacerbated with the other non-Java components of our
build. For example, some java source is generated by in-house custom
tools (in order to get serialization between C++ and Java), and
incremental becomes even more important as it's not just 20,000 java
source files anymore. It's even more taking even more time, greatly
increasing the need for a correct fast (and thus incremental and
parallel) build.
Frankly, the current state of affairs in the Java community is not
acceptable, and even laughable, given that solutions to these problems
(fast build, correct build) are known and have been known for many,
many years in the context of C and C++. (That javac cannot or will not
output dependency information ala gcc -M is amazing.) Having said
that, I would love to be proven quite wrong. I thank you in advance
for any advice or insight you are willing to give.