Java Reference
In-Depth Information
recompilation. The basic steps it follows in determining which files are dirty are
as follows:
Calculate which files have been modified since the last build, and mark
them dirty.
1
Track down dependencies of any of the modified files, and mark them dirty.
2
Determine which modules are affected, and mark them as dirty.
3
If any dirty modules have dependencies, mark them dirty as well.
4
Locate modified files in dirty modules.
5
Specifying a project's output path
When you set up your project, you specify an output directory to hold your com-
piled Java classes. The output path is required to build your project. If you're
using a version control system, you should generally specify an output path that
doesn't fall under its control. You won't be checking compiled class files into the
repository, so it will confuse things to have them show up as unregistered files in
your tree. Most version control systems let you ignore entire directory hierarchies,
so you may wish to ignore your output folder. Your output directory is automati-
cally added to your project's Classpath.
Keeping test classes separate using your test output path
When setting up your project properties, IDEA gives you the option of isolating
your test classes into their own output path. Keeping them separate ensures that
your test classes don't end up as part of your final release when you JAR up your
output class folder. When you run your application from within IDEA , your test
output path isn't included (unless you're running unit tests, of course). This
ensures that no dependencies between your production code and test classes
sneak in. You'll learn more about creating test classes in chapter 7.
Handling resource files
Resources are files used by your application that aren't Java classes or libraries.
Common examples of resources include property files, icons, bitmaps, DTD s, and
XML files. These files are typically loaded from your application's Classpath
through the ResourceBundle.getBundle() method (for property files and resource
bundles) or the loadResourceAsStream() method of ClassLoader for icons and
other files. These and other resource fetching schemes rely on the resource files
being in your program's Classpath, even though they obviously aren't Java
classes. As part of the build process, IDEA copies all your resource files from your
 
 
 
 
 
Search WWH ::




Custom Search