Let's assume that you've downloaded the sources from Subversion, configured your hackystat.site.properties file, and so forth. To see how the components of the system work together, let's execute a few Ant targets.
First, let's run the AutoConfig system to generate (or re-generate) the modules.build.xml and sample.hackystat.build.xml files.
c:\svn\hackyCore_Build>ant -f autoconfig.build.xml
Buildfile: autoconfig.build.xml
run:
[echo] [AutoConfig] Generated modules.build.xml and sample.hackystat.build.properties.
autoconfig.build.default:
BUILD SUCCESSFUL
Total time: 1 second
c:\svn\hackyCore_Build>
This target has inspected all of the sibling directories of hackyCore_Build, found any local.build.xml files, and used that information to generate a modules.build.xml file and a sample.hackystat.build.properties file.
Next, we rename sample.hackystat.build.properties to hackystat.build.properties, and comment out all modules other than those in the hackyCore subsystem. That way, when we do a build, only the hackyCore system modules will be used. The resulting file is shown in Example 13.1, “hackystat.build.properties file (builds hackyCore subsystem only)”.
Example 13.1. hackystat.build.properties file (builds hackyCore subsystem only)
# -*-Sh-*- # hackystat.build.properties file # 65 defined modules. # Generated by AutoConfig on: Mon Jan 09 08:53:18 HST 2006 # hackyApp_BuildAnalysis.available=true # hackyApp_Cgqm.available=true # hackyApp_Cocomo.available=true # hackyApp_Course.available=true # hackyApp_Experiment.available=true # hackyApp_Hpcs.available=true # hackyApp_Mds.available=true # hackyApp_Pri.available=true # hackyApp_PrjSize.available=true # hackyApp_Review.available=true # hackyApp_StdCmd.available=true # hackyApp_TelemetryControlCenter.available=true # hackyApp_Zorro.available=true hackyCore_Build.available=true hackyCore_Common.available=true hackyCore_Installer.available=true hackyCore_Kernel.available=true hackyCore_Report.available=true hackyCore_Statistics.available=true hackyCore_Telemetry.available=true # hackySdt_Activity.available=true # hackySdt_BadData.available=true # hackySdt_BuffTrans.available=true # hackySdt_Build.available=true # hackySdt_Cli.available=true # hackySdt_CodeIssue.available=true # hackySdt_Commit.available=true # hackySdt_Coverage.available=true # hackySdt_Dependency.available=true # hackySdt_DevEvent.available=true # hackySdt_FileMetric.available=true # hackySdt_Issue.available=true # hackySdt_Perf.available=true # hackySdt_ReviewActivity.available=true # hackySdt_ReviewIssue.available=true # hackySdt_UnitTest.available=true # hackySdt_WorkspaceMap.available=true # hackySensor_Ant.available=true # hackySensor_Bcml.available=true # hackySensor_Cccc.available=true # hackySensor_Checkstyle.available=true # hackySensor_Cli.available=true # hackySensor_CppUnit.available=true # hackySensor_Cvs.available=true # hackySensor_DependencyFinder.available=true # hackySensor_Eclipse.available=true # hackySensor_Emacs.available=true # hackySensor_Emma.available=true # hackySensor_FindBugs.available=true # hackySensor_JBlanket.available=true # hackySensor_JBuilder.available=true # hackySensor_JUnit.available=true # hackySensor_Jira.available=true # hackySensor_Jira2.available=true # hackySensor_Jupiter.available=true # hackySensor_LoadTest.available=true # hackySensor_Locc.available=true # hackySensor_Office.available=true # hackySensor_Pmd.available=true # hackySensor_Sclc.available=true # hackySensor_Svn.available=true # hackySensor_Vcs.available=true # hackySensor_Vim.available=true # hackySensor_VisualStudio.available=true # hackySensor_XmlSensorData.available=true
Each time you invoke the Hackystat Build System, it checks to see if any local.build.xml files have changed since the last time you created the modules.build.xml file with AutoConfig. If so, the build system will issue a warning suggesting that you run AutoConfig again to guarantee that the module-dependent local.build.xml file targets are correctly integrated into the overall build system. Here's an example of this warning message:
c:\svn\hackyCore_Build>ant -q freshStart
[echo] Warning: modules.build.xml file may be out of date. Regenerate with: 'ant -f autoconfig.build.xml'
[echo] (16:51:12) Completed hackyCore_Build.checkModuleAvailability
[echo] (16:51:17) Completed hackyCore_Build.hotUndeployHackystat
[echo] (16:52:33) Completed hackyCore_Build.clean
[echo] (16:53:10) Completed all.checkstyle
[echo] (16:53:24) Completed all.compile
[echo] (16:53:40) Completed all.install.pre-sensorshell
[echo] (16:53:57) Completed hackyCore_Build.unjarSensorShellFiles
[echo] (16:53:59) Completed hackyCore_Build.installSensorShell
[echo] (16:54:29) Completed all.install.post-sensorshell
[echo] (16:54:29) Completed hackyCore_Build.deployTestData
[echo] (16:54:30) Completed hackyCore_Build.hotDeployHackystat
[echo] (16:54:32) Completed hackyCore_Build.deploySoap
BUILD SUCCESSFUL
Total time: 3 minutes 37 seconds
If you see this warning, just invoke 'ant -f autoconfig.build.xml' as suggested to rebuild the modules.build.xml file and the warning will go away.
Next, we invoke 'ant -q freshStart', which will do a clean compile, build the Hackystat web application based upon the modules indicated above, and deploy it to the running Tomcat instance. The invocation produces the following output:
c:\svn\hackyCore_Build>ant -q freshStart
[echo] (17:00:53) Completed hackyCore_Build.checkModuleAvailability
[echo] (17:00:53) Completed hackyCore_Build.hotUndeployHackystat
[echo] (17:01:00) Completed hackyCore_Build.clean
[echo] (17:01:07) Completed all.checkstyle
[echo] (17:01:17) Completed all.compile
[echo] (17:01:23) Completed all.install.pre-sensorshell
[echo] (17:01:40) Completed hackyCore_Build.unjarSensorShellFiles
[echo] (17:01:42) Completed hackyCore_Build.installSensorShell
[echo] (17:02:08) Completed all.install.post-sensorshell
[echo] (17:02:08) Completed hackyCore_Build.deployTestData
[echo] (17:02:09) Completed hackyCore_Build.hotDeployHackystat
[echo] (17:02:11) Completed hackyCore_Build.deploySoap
BUILD SUCCESSFUL
Total time: 1 minute 21 seconds
There are several useful things to note about this invocation of freshStart.
First, we use "-q" to suppress most output from the command. You will typically want to use "-q" as above. With -q, each displayed line includes a timestamp indicating the time its associated target completed. This is useful for determining where the time is being spent during the build. For example, we can see that the all.checkstyle target took 7 seconds to complete, since the component before it (hackyCore_Build.clean) completed at 17:01:00, and all.checkstyle completed 7 seconds later at 17:01:07.
Second, the targets called by freshStart have a prefix which is either a module name (i.e. "hackyCore_Build") or the prefix "all". A target containing a module name as a prefix tells you the module where this target is implemented. For example, "hackyCore_Build.checkModuleAvailability" indicates a target implemented in the hackyCore_Build module. Targets with the prefix "all" indicate a special kind of target that is effectively a combination of all targets in all currently available modules with that name. So, for example, "all.checkstyle" indicates a target that will result in invocation of hackyCore_Build.checkstyle, hackyCore_Kernel.checkstyle, hackyCore_Report.checkstyle, and so forth: all (and only those) modules indicated as "available" in your hackystat.build.properties file will have their corresponding target invoked.
Finally, building the system with freshStart requires 12 primary subtargets. We will discuss each of these subtargets in detail in a later section. First, however, let's test our build.
Finally, we run the JUnit tests associated with the selected modules to make sure the system was built, installed, deployed correctly:
c:\svn\hackyCore_Build>ant -q all.junit
[echo] (09:34:22) Completed hackyCore_Kernel.junit.
[echo] (09:34:26) Completed hackyCore_Statistics.junit.
[echo] (09:34:43) Completed hackyCore_Report.junit.
[echo] (09:34:50) Completed hackyCore_Common.junit.
[echo] (09:35:00) Completed hackyCore_Telemetry.junit.
[echo] (09:35:25) Completed hackyCore_Installer.junit.
[echo] (09:35:25) Completed all.junitReport
[echo] (09:35:25) Completed all.junit
BUILD SUCCESSFUL
Total time: 1 minute 23 seconds
Sending build result to Hackystat server... Done!
If any of these tests failed, then a message would have been printed out to the console and more information would be available about the failure(s) in the hackyCore_Build/build/reports/junit directory.
![]() | Note |
|---|---|
| Before going further, you should make sure that you can successfully configure, build, and test the system as illustrated above. If you run into problems, please consult Chapter 8, Hackystat server installation for detailed instructions. | |