Re: Q: Java source and directory structure - 'standard way' ?

From: FISH (joeking_at_merseymail.com)
Date: 01/26/04


Date: 26 Jan 2004 03:13:54 -0800

Raymond DeCampo <rdecampo@spam-I-am-not.twcny.rr.com> wrote in message news:<qjGQb.76871$Su5.30054@twister.nyroc.rr.com>...
> Let me address your concerns:
>
> 1) The compiler does create the output; the source code and the
> directories it is contained in are input.

Ah yes, but in Java the package 'hierarchy' is part of the output, so
surely it is more correct that the directories should be constructed
by the compiler - by referencing the source - than created by the
programmer by hand...?

> 2) One can still use the -d flag to separate source and class files.

Which begs the question, why not use -d all the time? (Then you never
get source and binary intermixed in the same directories!)

Hmmmm... :-)

> 3) I was going to dismiss this concern as silly, but the JLS does
> explicitly mention using a database to store classes, so that would have
> been wrong of me. However, I doubt this is a serious concern for the
> near future.

I think this pretty much answers the question for me. The fact that
it 'works for now' would suggest to me that this union (in the C
sense of the word) of source and output directories it is not a
desirable way to structure code - and obviously not a 'standard way'.

It works because the compiler will output to the same directory as
the source, if not directed. I'm not sure if this default behaviour
can be guaranteed in future, or on all compilers - so I'd rather
avoid it.

> Finally, let me suggest that you try out ANT. ANT provides a way of
> easily specifying how to build your code. It can run the compiler and
> jar the files. As an added bonus you can distribute the build script
> and everyone working on the code will be able to build it in the same way.

I already use Ant, thanks :-) In fact the package I mentioned is
actually used in one of the many extensions to Ant, called ImTask.

Thanks for your input, but I think I'll stick to packaging the source
in a way that makes sense to the project, and leave the compiler to
figure out how it wants to implementent the package 'hierarchy' - it
probably has a better idea than I do :-)

Thanks,

-FISH- ><>



Relevant Pages

  • Re: Freeware download corrupt (?)
    ... > a list of all functions in a package that fall in that category. ... > conflict with a function of that name in a future version of the CRTL. ... > But the compiler doesn't do that, so for now we're on our own. ... I create a package with a routine in it called "highwater". ...
    (comp.os.vms)
  • Re: PL/I, COBOL, Advantages, Equivalence, et al
    ... SPARK will allow a variable to have a value that conforms ... might be that a package somewhere will look like this ... An Ada compiler may issue a warning; ... LC> Ada/SPARK support a boolean type? ...
    (comp.lang.pl1)
  • Re: How to use packages?
    ... libraries in assembly could be created and imported for use. ... package so that some very cool libraries could be created in ways that I ... This would be very wrong -- basically giving away a Lisp compiler ... For example (given the name as.exe for the assembler): ...
    (comp.lang.lisp)
  • RE: Visual studio 2003 .NET versus its own Command Prompt
    ... > package in the lab. ... > command line compiler which cames with it. ... library, which is a .lib file, for it to know where in the DLL the functions ...
    (microsoft.public.vc.language)
  • Re: Frage zu Packages und our
    ... Der Compiler selbst schaut jedoch bei einem unqualifizierten ... Laufzeit tatsächlich auf die globale (Package) Variable zugegriffen. ... von "my" ident sind - denn ein innerhalb eines Scopes deklariertes ...
    (de.comp.lang.perl.misc)