The Source for Java Technology Collaboration
User: Password:



Vincent Brabant's Blog

April 2004 Archives


Why do we need more that one source directory for one project ?

Posted by vbrabant on April 22, 2004 at 01:40 PM | Permalink | Comments (36)

Dear all,

Did you remember one of my blog concerning the usage of Ant to manage project ?

It seems that Netbeans people read my blog and will use Ant-Driven Project in next release of NetBeans. I really think it will be a plus.

But the really good new is that they success to hide the fact that their new notion of project is managed by Ant script. You really can ignore the fact.

But, comparing to old way of work, they introduced somes limitations.

For example, Imagine the following structure

Project
|-- src
| |-- org
| | |-- netbeans
| | | |-- MyClass.java
|-- build
| |-- classes
| | |-- org
| | | |-- netbeans
| | | | |-- MyClass.class
|--doc
| |-- api
|-- test
| |-- org
| |-- netbeans
| | |-- MyClassTest.java
|-- database
| |-- org
| |-- netbeans
| | |-- database
| | | |-- CreateMyTable.sqlj
|-- resources
| |-- dev
| | |-- org
| | | |-- netbeans
| | | | |-- config.properties
| |-- itt
| | |-- org
| | | |-- netbeans
| | | | |-- config.properties
| |-- uat
| | |-- org
| | | |-- netbeans
| | | | |-- config.properties
| |-- prd
| | |-- org
| | | |-- netbeans
| | | | |-- config.properties

When I am running on my PC the MyClass.java, I am using the src and resources/dev as source directories. Everything that are in the sources directories will be in the jar file.

Also, I like to keep somes classes in a totally separate directory, because they are special classes,

  • like classes that use JNI.
  • like classes that need to be "precompiled" by xdoclet, for example
  • like sqlj classes that need the sqlj precompiler

Also, when I have to write somes tests for my web project, I like to have a directory containing HTTPUnit tests and another directory for JUNIT tests.

Both are tests for the same project, but having not the same purpose

But now, they decided to add the following constraints one source directory for one project. (if we ignore the fact that your tests are in a separate directory).

But, personally, I liked to have more than one source directory in the same project.

I really don't want to create a project, only for somes classes.

The problem is that I have no solid arguments to really have more than one source directory in the same project.

That's the reason I need your help.

If you are using more than one source directory in your project, could you post here the reason why.

If you are never using more than one source directory in your project, could you also teach me how to change my way of building a project ? Brabant Vincent



Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds