[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.technology] Re: Eclipse just seems wrong
|
In article <bk53qr$j7n$1@xxxxxxxxxxx>, gergg@xxxxxxx says...
>
> "Scott Stanchfield" <scott@xxxxxxxxxxxx> wrote in message
> > Eclipse does compile files *correctly* as follows:
> > [...]
>
> I get the fact that you (and others) think that this is the way that
> everyone lays out their source trees. That's not the point. The point is
> that the compiler is flatout ignoring my package statement in my source
> file. That is counter to the java specification, period!
Again, Eclipse structures it the "common way" for several reasons.
One of the main reasons I like the package-dir mapping structure is that
it's easy to see related classes that reside in the same package,
regardless of the tools being used. You can look at them in an IDE,
browse through using a command shell, do simple dir lists, etc.
Eclipse uses this to its advantage to make it easy to find all packages
(source dirs containing java source), allow you to add easily add
classes to a package (even if it's empty -- it had a dir structure),
browse etc. The main java package explorer view represents the structure
exactly as laid out on disk, but it collapses package names to a single
tree-entry (like com.javadude.foo.fee instead of
com
|- javadude
|- foo
|- fee
which is a display option)
I think everyone here understands what the spec says. Keep in mind that
the Eclipse compiler is *not* a standalone compiler. There are plenty of
those available. (There are some efforts underway to make it a
standalone, in which case I totally agree that the standalone version
should behave per the spec).
The eclipse compiler was written to incrementally compile code that fits
Eclipse structure, and add several new features that other compilers
don't provide (primarily additional warnings/errors to find common java
problems and style issues).
If you want/need something else, there are many other choices.
> One of the primary reasons I don't want to
> restructure them, just for eclipse, is related to source code management.
> It's just not an option to rearrange the tree.
Which SCM are you using? Many have a way to move/rename files. Worst
case, you'd have "older" history in a different structure. In practice,
this isn't really that big of a deal, as most folks don't tend to spend
much time actually looking at old code. The only trick is to make sure
it's done at a good time...
I did this with several projects at workto create parallel source & test
directory structures for junit.
Again, I'd suggest trying out Eclipse with simpler projects (you
mentioned you have some that follow the common structure) to see if you
think the functionality is worth the change. If not, it's all moot
anyway :)
> We already build the project outside of the IDE with ANT, and ANTdoes not
> complain about the structure of the class files. It just compiles them and
> moves on.
You can build *inside* Eclipse with ant as well, with your sae build
script and project structure.
1) Turn off auto build (Window->Prefs->Workbench->Perform build
automatically on resource modification)
2) Right-click on the ant build script and pick "run ant". This will
allow you to choose targets and run the build.
3) Click on the little drop-down arrow next to "running man with
toolbox" icon on the toolbar (external tools), you can choose "External
tools..." and configure it in detail.
4) You can also set a key binding for "run last launched external tool"
to re-run the last ant build.
Later,
-- Scott
==============================================================
Scott Stanchfield scott@xxxxxxxxxxxx http://javadude.com
I haven't gotten *any* spam since joining http://knowspam.net!
Lead author of "Effective VisualAge for Java, Version 3"
http://javadude.com/evaj
Visit for Java Enlightenment! http://www.jguru.com
==============================================================