views:

25

answers:

2

Hi
I am new to Netbeans. I am wondering if someone can help me with project setup in netbeans. I am moving half million lines of Java code from a different IDE to Netbeans. I was able to get the code build and run in Netbeans easily. I have a project with many folders with dependencies among those folders. They have to be built in specific order. This is to enforce layering so that a module in lower layer cannot call into higher layers. I couldn't get that configured in Netbeans. Below is how my project looks like

project/ 
    libA/ 
    libB/ 
    libC/ 
    libD/ 
    libE/ 
    appA/ 
    ... 

I have one project that builds all the libs and appA. The project build xml is stored under project/ folder. But the libs have dependencies among them. libB should be built after libA. libC after libA. libE depends on libD and libB etc.
I tried to change the order of source folders for libs in project properties. That didn't seem to make any difference. Even if I move libA after libB, it was building everything fine. I expected it to fail because libA didn't build yet.
Iam lost. Just wondering what the trick is to enforce this kind of dependencies. I created my project using "Java project using existing sources" wizard.

I appreciate your help
Thanks
Video guy.

A: 

Even though it would be a pain, you could just write your own ant build script and then just have Netbeans use that.

Basically:

  1. write the custom ant build file
  2. install the Ant plugin
  3. create an Ant build file
  4. right click the build file
  5. run the selected target.

This would enable you to enforce whatever you need to do, but, if Netbeans is figuring out the correct order then why not just use it.

Does something break when you just compile and run in Netbeans?

James Black
A: 

Well! Lets say a team member added piece of code in lower level package that calls into higher layer code. It should fail because it breaks the layering. Because Netbeans seem to compile all the files in one javac invocation, the build compiles just fine. I want Netbeans to break the build in this case. Writing my own ant script is another way of enforcing it. The whole point in using an IDE is to save yourself from writing your own make files (or ant scripts). This is something any IDE was able to accomplish 10 years back out of the box. I am wondering if I am missing something here.

Thanks
Video Guy

videoguy

related questions