This section takes you through the steps required to install hackyDoc_NewModule into your local configuration. Following the installation, we will briefly overview the module's contents along with the kinds of modifications you will typically make to it in order to create your own new module.
In addition to the standard "hackystat" subversion repository, which contains the public modules, the Hackystat Project also maintains a "hackystat-doc" repository, which contains "documentation" modules such as hackyDoc_NewModule. You should checkout the hackyDoc_NewModule module into a directory called hackyDoc_NewModule in your local directory containing the public Hackystat modules. You can access the latest release of the hackyDoc_NewModule module using the following Subversion URL:
svn://www.hackystat.org/hackystat-doc/hackyDoc_NewModule/trunk
When finished, you should have a directory structure similar to the following in your local Hackystat subversion-managed directory:
: :
hackyCore_Statistics/
hackyCore_Telemetry/
hackyDoc_NewModule/
src/..
local.build.xml
hackySdt_Activity/
: :
As you can see, upon successful checkout you will have created a new local directory called hackyDoc_NewModule. It contains two subdirectories and around a dozen files.
Now that you have the hackyDoc_NewModule directory, add it to your configuration. To do this, edit your hackystat.build.properties file to include this module and indicate that it is available. The set of uncommented lines should now look like:
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 hackyDoc_NewModule.available=true
To integrate hackyDoc_NewModule into the Hackystat build system, you need to run AutoConfig:
C:\svn\hackyCore_Build>ant -f autoconfig.build.xml
Buildfile: autoconfig.build.xml
run:
[mkdir] Created dir: C:\svn\hackyCore_Build\build\autoconfig
[echo] [AutoConfig] Generated modules.build.xml and sample.hackystat.build.properties.
autoconfig.build.default:
BUILD SUCCESSFUL
Total time: 1 second
In this step, the AutoConfig system discovers the presence of the hackyDoc_NewModule module (along with all of the others), and writes out the modules.build.xml file with targets that integrate this module into the core Hackystat build system.
If you forget this step, the build system will remind you by generating a warning:
[echo] Warning: modules.build.xml file may be out of date. Regenerate with: 'ant -f autoconfig.build.xml'
To build and test the new configuration, simply invoke 'ant -q quickStart all.junit'. Since we did a freshStart initially, we can save some time by using quickStart:
C:\svn\hackyCore_Build>ant -q quickStart all.junit
[echo] (16:54:29) Completed hackyCore_Build.checkModuleAvailability
[echo] (16:54:39) Completed hackyCore_Build.hotUndeployHackystat
[echo] (16:54:41) Completed all.compile
[echo] (16:54:47) Completed all.install.pre-sensorshell
[echo] (16:54:53) Completed all.install.post-sensorshell
[echo] (16:54:53) Completed hackyCore_Build.deployTestData
[echo] (16:55:02) Completed hackyCore_Build.hotDeployHackystat
[echo] (16:55:04) Completed hackyCore_Build.deploySoap
[echo] (16:55:14) Completed hackyCore_Kernel.junit.
[echo] (16:55:16) Completed hackyCore_Statistics.junit.
[echo] (16:55:26) Completed hackyCore_Report.junit.
[echo] (16:55:32) Completed hackyCore_Common.junit.
[echo] (16:55:37) Completed hackyCore_Telemetry.junit.
[echo] (16:55:52) Completed hackySdt_Activity.junit.
[echo] (16:55:56) Completed hackyCore_Installer.junit.
[echo] (16:55:59) Completed hackyDoc_NewModule.junit.
[echo] (16:56:00) Completed all.junitReport
[echo] (16:56:00) Completed all.junit
BUILD SUCCESSFUL
Total time: 1 minute 34 seconds
As you can see, using quickStart instead of freshStart enabled the build to complete in half the time. Also notice that the target hackyDoc_NewModule.junit is now being run as part of all.junit.
The hackyDoc_NewModule module implements a simple analysis called Sensor Data Summary, which simply indicates the number of days of data associated with any given Sensor Data Type. Figure 14.1, “ The Sensor Data Summary analysis defined by hackyDoc_NewModule ” shows this analysis, which is found on the Extras page.
This module does not define a Sensor Data Type or a Sensor, but simply performs a simple analysis on the set of data associated with a given user.
Since building the docbook documentation can add a minute or more to the time required for a build, it is not included in the quickStart and freshStart targets, which developers might invoke many times per day. To manually install the docbook documentation into your local build, just invoke "ant hackyCore_Build.buildDocBook":
C:\svn\hackyCore_Build>ant hackyCore_Build.buildDocBook
Buildfile: build.xml
hackyCore_Build.docbook.check.required.properties:
hackyCore_Build.docbook.init:
[delete] Deleting directory C:\svn\hackyCore_Build\build\docbook
[mkdir] Created dir: C:\svn\hackyCore_Build\build\docbook\gather\sdt
[mkdir] Created dir: C:\svn\hackyCore_Build\build\docbook\gather\def
:
lots of lines deleted
:
hackyCore_Build.buildDocBook:
[echo] (17:06:11) Completed hackyCore_Build.buildDocbook
BUILD SUCCESSFUL
Total time: 45 seconds
You can, of course, do everything in one Ant invocation using: "ant -q quickStart all.junit hackyCore_Build.buildDocBook".
The docbook documentation for this module (and all of the other modules in this configuration) will now be accessable from the Help page of the local server where this configuration is deployed. Figure 14.2, “ The DocBook page for hackyDoc_NewModule ” illustrates the Docbook chapter defined by this module: