|
|
YOUR FEEDBACK
SOA World Conference
Virtualization Conference $50 Savings Expire June 24, 2008... – Register Today!
SYS-CON.TV SYS-CON.TV WEBCASTS |
TOP LINKS YOU MUST CLICK ON Code
Code Development in Distributed Environments
Requires effective build management tools
By: Matt Gabor; Steve Taylor
Mar. 12, 2007 10:15 AM
Digg This!
Page 2 of 2
« previous page
Another commonly faced problem is lack of build portability. Builds often work only on an individual developer's machine, which by default becomes the "production" build machine. This approach can cause severe problems when trying to track down bugs that are discovered once an application has been released to Production. To solve this problem, development teams should standardize their directory structure. All developers should work on code in the same directory structure. If a versioning or CM tool is used, pull the directory structure from it; if not, enforce strong directory conventions for all developers. Portability problems also can be mitigated by using global variables in the build script templates that identify the root location for all source code, compilers and common libraries. By setting environment variables such as SRC_HOME, COMPILER_HOME, and COMMON_HOME, the same build scripts should work on all machines. Using global variables in the build script templates also reduces the amount of template editing that is required by developers. Finally, isolate the build scripts to just that: builds. Too often, "build" scripts include substantial pre- and post-build logic unrelated to the build. Pre- and post-build logic can be extremely complex, especially as an application matures and development is being performed on multiple versions simultaneously. The Ant script in Listing 2 demonstrates a build script with a very basic and generic deployment portion. Rather than writing pre- and post-build logic within a build script (where the functionality is often limited by the scripting language or tool), place the non-build logic in external scripts. The external scripts should be written in a scalable, lightweight, and cross-platform language such as PERL or PYTHON. Tightly focused build scripts can then have built-in hooks to the external build utility. Listing 3 takes the overly complex build script of the prior example and replaces it with a call to an external script. By partitioning the build scripts in this way, developers (or build masters) who encounter build problems can drill down to the root cause very rapidly. Additionally, as development grows in complexity and new languages or target Operating Systems are added, the in-house build utility can scale more effectively. For example, consider a C and C++ development shop that uses an entirely Make based build system with all pre- and post-build logic written in the Make scripts. When the development shop decides to add a Java component to their application, they are faced with writing an Ant component (equivalent to their existing Make scripts) that manages all of Java-related pre-build, build, and post-build logic. However, if the development shop has a build utility, written in PERL, that executes Make scripts limited to build execution, they only have to write Ant scripts that handle the Java builds, and can use the existing PERL framework as a basis for all of the non-build functionality.
Dealing with multiple languages A common problem in such complex environments is the lack of an effective audit trail. Log all build script templates and "non-build" script components, and make sure audit trails track source code to executable. For each action that touches source code (check-out, move, compile etc.), embed a logging message into the script templates. This is facilitated by adding a basic Bill Of Materials report to the in-house build solution, including:
There are a number of critical "breaking points" that cause in-house build systems to become cost- and/or resource-prohibitive. When they occur, development teams generally begin to consider an automated, non-scripting environment. One of the first breaking points occurs when the amount of time it takes for an application to build begins to limit unit- and integration-testing effectiveness. Only the items that need to be built should be built, in a true incremental approach. Another breaking point is excessive problem-resolution turnaround, because the development environment scales beyond the capabilities of the in-house scripted manual build system. Developers find themselves spending most of their time tracking down what source code and common libraries went into a built object rather than resolving coding problems. A sure sign that developers are reaching the limits of manual scripting efficiency is when they find themselves consistently spending as much as an hour a day working on build problems (either their own, or debugging build problems of a centralized CM team). Some companies actually assign a dedicated CM team whose sole responsibility it is to execute builds. Developers find themselves waiting for the CM team to build their applications before they can move on to the next development effort. It can reach the point where the centralized CM team simply cannot keep up with the demand, especially when builds are cross-language, cross-platform and incredibly complex.
Migrating to Automated Build-Management One example of this approach is a build management tool that weaves together human and machine intelligence to automate and standardize the enterprise build process. It is possible to incorporate a browser-based user interface and a Tomcat or WebSphere Application Server to provide access to a Knowledge Base Server. Enterprise-based features allow for the connection to multiple remote build servers. Simple Object Access Protocol (SOAP) is used as the communication layer between the browser and the application servers. Developers interface through a web client, a command line interface, or indirectly through IDE plug-ins. Build meta-data is stored and managed via the central Knowledge Base Server and reused by multiple developers to generate Ant/XML scripts for Java support, or to generate "Make"-like scripts for traditional build requirements. Build Control files can be generated to build a single object (supporting developer daily compile activities) or a complete application (containing hundreds of inter-dependent modules). When a complete application Build Control file is generated, it eliminates the problem of recursive Make and ensures the accuracy of incremental builds. Builds can be managed from an empty build directory pulling source code from a pre-defined search path, or by retrieving source code from a version management tool. Build management also allows control over environment variable settings such as LIB, INCLUDE and CLASSPATH so that, regardless of the build machine, the build results are the same. Build management does not replace Ant for completing Java builds, but rather extends the use of Jakarta Ant without the need for manually coding XML scripts. In the place of hard-coded Make and Ant/XML scripts, for instance, its rules engine takes advantage of a knowledge base of build meta-data, such as Target Name and Dependency information, to dynamically generate portable, PERL-based build processes at build time that can be referenced by multiple development teams. Page 2 of 2 « previous page
LATEST ECLIPSE STORIES . . .
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||