| By Steve Taylor | Article Rating: |
|
| September 1, 2006 11:00 AM EDT | Reads: |
14,663 |
Post-Processing Steps
As with the pre-processing
tasks, the post-processing tasks should avoid items such as copying and
renaming files. If an archive has to be given a specific name then that
name should be handled on the archive task instead of doing a copy or
rename. The use of multiple task dependencies should also be minimized
to ensure easy traceability and IT compliance.
Testing
One of the common items to do in
the post-processing phase is to test. These tests are usually unit
tests such as Junit. But these tests can also include some basic tests
about the archive itself, such as checking to see if the correct
deployment descriptor and properties files have been used or checking
the number of files in the archive to verify at a basic level if all of
the source was compiled. Another useful test is to check to see if the
archive contains the correct manifest and directory structure.
Validating these items before deployment can save you the embarrassment
of a production failure. It's best if these items are extracted and
e-mailed to a tester to verify their accuracy before deployment.
Deployment
The deployment task should be
one of the last steps in the build process. It should be dependent on
the Testing task and the Testing task dependent on the Build task. But
it shouldn't be the default task that gets executed. You want to give
the user the option of just building and testing or building, testing
and deploying. This lets someone just deploy.
Variable
Beyond the pre-processing, compiling, and
post-processing steps in your Ant/XML scripts, managing variables is
also critical in creating a more standardized manual process.
Using variables lets an Ant/XML script be written to execute on multiple machines. This is a cautionary tale, however, because using too many variables makes an Ant/XML script hard to read and debug. It's best to use variables for the directory path on the Jar files in the CLASSPATH and for the source code locations. For example, instead of using:
c:\jdk2\lib\rt.jar you would use ${JAVAHOME}\lib\rt.jar
This reference will let different users have different working locations. Again, the directory structure of the source code and libraries should be laid out efficiently for builds.
Machine-Specific Variables
If there are
any machine-specific items referenced in the Ant/XML script then they
should be referenced through a variable and abstracted out. When you
write the Ant/XML script assume that you won't be the only one using
the script.
By following a standard guideline, your Ant/XML scripts can become easier for another developer in your organization to follow and so more traceable. This is ultimately what you're striving for. Traceability in your build process can only be achieved if someone else can follow the build steps. By maintaining some standard sections such as pre-processing, compiling, and post-processing, your scripts should follow a basic structure that can be easily identified and traced.
Commercial Eclipse plug-ins are available that can substantially minimize the need for Ant/XML scripting. These tools provide a reusable build framework through a standardized interface.
Commercial build tools that simply execute your Ant/XML scripts may be helpful in managing the many scripts that are created over time; however, tools that minimize your scripting effort are preferable because they create a solid reusable framework once that can be reused over and over.
The inherent problem of Ant/XML scripting is that the scripts are written for one jar and one application at a time. This creates a lot of redundancy. Redundancy equates to higher cost and lower quality. Just as you strive for reuse when developing applications, you should strive for reuse in your application build framework. Using scripts to do this is close to impossible because manual Ant/XML scripts contain hard-coded application references.
Commercial tools such as Openmake by Catalyst Systems Corporation, Perfect Build by CodeFast, and Builder by Serena address the scripting issue directly by providing a reusable framework in your build process. Open Source tools such as Maven will also assist you in minimizing the amount of scripting necessary for each jar file you create.
As upper management demands more accountability from the development process, the build component will be scrutinized more closely. A point-and-click process from the Eclipse IDE won't meet the new IT mandates. Neither will overly complicated nor non-standardized build scripts. Eventually you'll be forced out of the comfort of your point-and-click IDE and into a more standardized method. Your choices will be to rely on Open Source languages such as Ant/XML and a lot of hard work or a commercial tool to help you with the job. Regardless of your future build requirements, the effort in creating standards for the build is critical and well worth the effort.
References
- www.apache.org - Learn about Ant Tasks, Ant scripting and Maven
- www.openmake.com - Learn about reusable scripts with Openmake
- www.codefast.com - Learn about script generation with Codefast
Published September 1, 2006 Reads 14,663
Copyright © 2006 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Steve Taylor
Steve Taylor is an experienced senior developer, bringing 17 years of expertise with client/server and mainframe application development and system integration. Prior to founding Catalyst Systems Corporation, he served as a lead technical consultant responsible for the successful implementation of applications into the production environment. Steve received his BS in computer science/mathematics from the University of Illinois-CU.
- Kindle 2 vs Nook
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- Confessions of a Ulitzer Addict
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- It's the Java vs. C++ Shootout Revisited!
- Cloud Computing Can Revitalize Your Career as Software Developer
- IBM Could "Reinvent" Java: Mills
- Oracle & Cloud Computing: Exclusive Q&A with SVP Richard Sarwal
- A Brief History of Cloud Computing
- Kindle 2 vs Nook
- Cloud CEOs, CTOs & SVPs to Speak at 4th International Cloud Computing Expo
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing Expo: Exclusive Q&A with Yahoo! SVP Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- The i-Technology Right Stuff
- JavaServer Faces (JSF) vs Struts
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- What's New in Eclipse?
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- i-Technology Predictions for 2007: Where's It All Headed?








































