AntBuilder
A simple Builder to interface with Ant
Overview
AntBuilder:
A simple Builder to interface with Ant
This type goes beyond Builder in allowing an AntZip dependency which can be installed via #Deploy. It also allows a custom-installed Ant and/or custom-installed Java for each AntBuilder. The number of available settings is much higher. It also provides integration with the CruiseControl and Hudson types in order to generate configuration files for those services.
Design
- Super Type
- Builder
| Role | Concrete. (Objects can be created.) |
| Instance Names | Unique |
| Notification | false |
| Template Directory | |
| Data View | Children, proximity: 1 |
| Logger Name | AntBuilder |
Constraints
Allowed Child Dependencies
- AntBuilderAntArgs 1
- AntBuilderAntOpts 1
- AntZip 1
- BuilderAntHome 1
- BuilderAutoUpdate1
- BuilderBuildFile1
- BuilderBuildstamp1
- BuilderBuildTarget1
- BuilderImportMax1
- BuilderImportMin1
- BuilderJavaHome 1
- BuilderNotificationList1
- BuilderPackageBuildtimePattern1
- BuilderPackageExtension1
- BuilderPackageFilebase1
- BuilderPackageInstallRank1
- BuilderPackageInstallRank1
- BuilderPackageInstallroot1
- BuilderPackagePurgeRegex1
- BuilderPackageRequireBuildstamp1
- BuilderPackageSeparator1
- BuilderPackageType1
- BuilderPackageVendor1
- BuilderPackageVersion1
- BuilderPath 1
- BuilderScmBinding1
- BuilderScmConnection1
- BuilderScmLabel1
- BuilderScmModule1
- BuilderScmUser1
- BuilderScmView1
- BuilderVersionBuild1
- BuilderVersionMajor1
- BuilderVersionMinor1
- BuilderVersionRelease1
- BuilderVersionTag1
- CruiseControlArtifact1
- CruiseControlInterval1
- CruiseControlMailHost1
- CruiseControlReturnAddress1
- HudsonPollSpec1
1: These types have a Singleton constraint. Only one instance may be added as a resource.
Allowed Parent Dependencies
- CruiseControl
- Hudson
- Node
- Updater
Attributes
Exported Attributes
| Name | Property |
|---|---|
| basedir | deployment-basedir |
| targetdir | deployment-install-root |
Defaults for Imported Attributes
| Name | Default |
|---|---|
| antArgs | |
| antOpts | |
| autoUpdate | false |
| buildAntHome | ${env.ANT_HOME} |
| buildFile | build.xml |
| buildPath | /bin:/usr/bin |
| buildTarget | all |
| cruiseControlInterval | 300 |
| hudsonPollSpec | */5 * * * * |
| importMax | 1 |
| importMin | 1 |
| javaHome | ${env.JAVA_HOME} |
| packageBuildtimePattern | yyyyMMdd'T'HHmmss |
| packageExtension | war |
| packageFilebase | .*? |
| packageInstallRank | 10 |
| packagePurgeRegex | ^(?!^${entity.attribute.buildstamp}$).*$ |
| packageSeparator | - |
| packageType | war |
| requireBuildstamp | false |
| scmBinding | cvs |
| scmLabel | |
| scmUser | ${user.name} |
Commands
runBuildScript
runs the build script
Makes sure the build file exists and then runs Ant using the custom ANT_HOME and JAVA_HOME.
- Usage
- runBuildScript [-antArgs <>] [-anthome <>] [-antOpts <>] [-basedir <>] [-buildfile <>] [-buildstamp <>] [-javahome <>] -packageBuildtimePattern [-path <>] [-target <>] [-targetdir <>]
Options
| Option | Description |
|---|---|
| antArgs | ANT_ARGS setting |
| anthome | Ant installation to use for build |
| antOpts | ANT_OPTS setting |
| basedir | directory where build resources reside |
| buildfile | build file to execute |
| buildstamp | build identifier |
| javahome | Java installation to use for build |
| packageBuildtimePattern | Build Time date format |
| path | System path to use for build |
| target | build target to evaluate |
| targetdir | directory build artifacts will be written |
generateProject
Generate a CruiseControl project definition for inclusion in config.xml
Called from CruiseControl#Docs-Generate. Checks to see if there is a CruiseControl referrer object. If so, generates a configuration file fragment which is then included in CruiseControl's config.xml which uses the exec task to run either the Build command on the object if building only, or the BuildAndUpdate command on this object's parent Updater if autoupdate=true.
- Usage
- generateProject [-anthome <>] [-artifactname <>] [-artifacttype <>] [-autoupdate <>] [-basedir <>] -file <> [-interval <>] [-mailhost <>] [-notificationlist <>] [-project <${context.name}>] [-returnaddress <>]
Options
| Option | Description |
|---|---|
| anthome | ANT_HOME to use for the build |
| artifactname | CruiseControl artifact name |
| artifacttype | CruiseControl artifact type |
| autoupdate | Set to true to automatically update after build |
| basedir | directory where build resources reside |
| file | The project absolute path of the file to generate for inclusion by CruiseControl |
| interval | Minimum duration between builds in seconds |
| mailhost | CruiseControl mail server address |
| notificationlist | Comma separated list of email addresses to be notified about the build |
| project | Name of the CruiseControl project to generate |
| returnaddress | CruiseControl returned mail address |
generateHudsonConfig
Generate a Hudson job (project) config.xml file
Called from Hudson#Docs-Generate. Generates a Hudson config.xml file in opts.jobdir based on the templates in templates/hudson.
- Usage
- generateHudsonConfig [-anthome <>] [-autoupdate <>] -jobdir <> [-notificationlist <>] [-project <${context.name}>]
Options
| Option | Description |
|---|---|
| anthome | ANT_HOME to use for the build |
| autoupdate | Set to true to automatically update after build |
| jobdir | Absolute path to Hudson jobs folder |
| notificationlist | Comma separated list of email addresses to be notified about the build |
| project | Name of the project to generate |
generateHudsonAntInstallation
Generate a Hudson Ant installation xml fragment
Generates an xml fragment to be included in Hudson's Ant configuration file with this AntBuilder's custom ANT_HOME
- Usage
- generateHudsonAntInstallation [-antHome <>] -file <>
Options
| Option | Description |
|---|---|
| antHome | ANT_HOME to use for the build |
| file | Absolute path to the Hudson xml fragment temp file |
generateHudsonJdkInstallation
Generate a Hudson JDK installation xml fragment
Generates an xml fragment to include in Hudson's main configuration that specifies the location of the JDK for this AntBuilder.
- Usage
- generateHudsonJdkInstallation -file <> [-javaHome <>]
Options
| Option | Description |
|---|---|
| file | Absolute path to the Hudson xml fragment temp file |
| javaHome | JavaHome |
writeBuildProperties
Write out properties file for use in Hudson
Uses a template to write out a file with properties that can be read by Ant during the build. This location is passed to Ant from the Hudson config.xml generated by #generateHudsonConfig
- Usage
- writeBuildProperties [-buildstamp <>] -file <>
Options
| Option | Description |
|---|---|
| buildstamp | build identifier |
| file | Absolute path to the Hudson xml fragment temp file |
Related Types
The following types are defined for use with AntBuilder.
BuilderJavaHome
Overview
BuilderJavaHome:
Java instance that ant should use
Design
- Super Type
- BuilderSetting
| Role | Concrete. (Objects can be created.) |
| Instance Names | Unique |
Attributes
Exported Attributes
| Name | Property |
|---|---|
| javaHome | settingValue |
BuilderAntHome
Overview
BuilderAntHome:
Ant instance that should be used
Design
- Super Type
- BuilderSetting
| Role | Concrete. (Objects can be created.) |
| Instance Names | Unique |
Attributes
Exported Attributes
| Name | Property |
|---|---|
| buildAntHome | settingValue |
BuilderPath
Overview
BuilderPath:
Path that should be used
Design
- Super Type
- BuilderSetting
| Role | Concrete. (Objects can be created.) |
| Instance Names | Unique |
Attributes
Exported Attributes
| Name | Property |
|---|---|
| buildPath | settingValue |
AntBuilderAntOpts
Overview
AntBuilderAntOpts:
Ant Opts like ANT_OPTS environment variable
Design
- Super Type
- BuilderSetting
| Role | Concrete. (Objects can be created.) |
| Instance Names | Unique |
Attributes
Exported Attributes
| Name | Property |
|---|---|
| antOpts | settingValue |
AntBuilderAntArgs
Overview
AntBuilderAntArgs:
Ant Args like ANT_ARGS environment variable
Design
- Super Type
- BuilderSetting
| Role | Concrete. (Objects can be created.) |
| Instance Names | Unique |
Attributes
Exported Attributes
| Name | Property |
|---|---|
| antArgs | settingValue |


