At 02:22 PM 3/19/2001 +0100, Richard den Adel wrote:
>Paul Kinnucan wrote:
>
>> Hi All,
>> 
>> The JDE has a Java build feature that relies on javac dependency checking
>> to rebuild a project. This feature has been broken by the reduced level of
>> dependency checking in recent versions of javac. 
>> 
>> Lately I have begun using a new approach to using javac for building my
>> Java projects that appears fast and perfectly reliable. I'm considering
>> replacing the current Java build scheme with this new version and would
>> like your feedback. 
>> 
>> The new approach relies on automatic creation of special classes, called
>> compile masters, that reference every Java class in a project. The compile
>> masters correspond to a makefile. The Java build algorithm creates a
>> compile master in the root package and in each descendent package, thereby
>> creating a hierarchy of compile masters that mirrors the package hierarchy.
>> It then uses javac to compile the toplevel compile master. Compiling the
>> root compile master causes javac to check every class in the project to
>> ensure that it is current and recompile any classes that are not current.
>> 
>> The benefits of this approach are:
>> 
>> 1. No need for makefile.
>> 
>> 2. Fast -- only one invocation of javac is needed to rebuild a project,
>>    no matter how big the project is.
>> 
>> 3. Reliable -- every out-of-date class in the project is recompiled.
>> 
>> The Java build feature would include a build-and-run command and would also
>> allow you to specify multiple projects in a single build command to handle
>> the cases where one project is dependent on classes in another project.
>> 
>> Note that this new build would not replace the JDE's support for using make
>> to build projects. You could continue to use make as an alternative to the
>> Java build feature.
>> 
>> What do you think of this proposal?
>> 
>> - Paul
>
>I am used to `build' and convert other files besides the java files in 
>my makefiles. I like your idea, but will it be possible to convert 
>(compile) other files with this method? Or am I misinterpretting your 
>suggestion?
>

There is no reason why you cannot combine this method with makefiles. Your
makefile would have one Java compile target, which would be to compile the
compile master (or masters) for your project. In fact, this is what the
makefile for the JDE distribution does. If you want, you could generate the
compile masters on the fly by invoking an emacs subprocess to generate the
compile masters.

This approach is a lot faster than invoking javac (or jikes) for every
class in your project and a lot easier than trying to build reliable and
efficient dependency files for make.

- Paul

Reply via email to