Java Reference
In-Depth Information
your JAR files, and another uses XSLT to create documentation. Each Ant build
file defines a default target, as well, which is used if a target isn't specified when
Ant is invoked.
Using system properties for more flexible build scripts
The behavior of Ant tasks can also be parameterized through the use of system
properties. The build file syntax provides a mechanism for using property values
at runtime and also reacting to their presence (or absence). This makes it possible
to build sophisticated build processes. Properties can be passed in explicitly,
gleaned from the environment, or set in the Ant build file in response to certain
conditions such as the absence or presence of a particular library.
5.2.2
Improving your build process with Ant
As we mentioned earlier, IDEA provides integration with the Ant framework for
extending its build and packaging capabilities beyond compilation. Ant is
included with IDEA , so no special setup is required to use it. Refer to the IDEA web
site for the latest word on bundled versions, because IDEA releases updated ver-
sions from time to time.
By using Ant rather than its own proprietary build system, IDEA ensures that
your project's build steps remain flexible and platform independent. Ant provides
a smorgasbord of functions, and many developers are already familiar with Ant,
making the development of the build files easier. When you're designing an IDEA
build project, you can implement a number of possible Ant integration strategies.
Using IDEA for compiling and Ant for packaging
You can stick with IDEA 's standard project and module builders for compiling your
classes, and create Ant targets for your packaging and deployment tasks, which
IDEA alone has no way of doing. With this approach, you achieve the tightest pos-
sible integration with the IDE , making editing and compiling your classes straight-
forward and efficient. You can choose to compile source files individually when
necessary, and you get fast build times because IDEA is constantly tracking your
file's dependencies and modification times. Ant then sticks to its core strengths,
providing excellent packaging capabilities. In this strategy, Ant is used for all the
steps IDEA can't handle on its own, either before or after compilation occurs.
One potential downside of this approach is that it requires a running instance
of IDEA in order to compile and build the project. If some developers on the
project aren't running IDEA , or if you wish to create automated nightly builds,
then this may not be the best strategy.
 
 
 
 
 
 
 
Search WWH ::




Custom Search