brett 2003/08/31 00:20:40
Added: src/plugins-build/cruisecontrol plugin.jelly
plugin.properties project.properties project.xml
src/plugins-build/cruisecontrol/src/plugin-resources
cruisecontrol.jsl
src/plugins-build/cruisecontrol/xdocs goals.xml
navigation.xml properties.xml
Log:
initial version - cruisecontrol config file generation plugin
Revision Changes Path
1.1 maven/src/plugins-build/cruisecontrol/plugin.jelly
Index: plugin.jelly
===================================================================
<?xml version="1.0"?>
<project
xmlns:j="jelly:core"
xmlns:util="jelly:util"
xmlns:x="jelly:xml"
xmlns:ant="jelly:ant">
<goal name="cruisecontrol" prereqs="cruisecontrol:configure"/>
<!--==================================================================-->
<!-- Validate necessary properties for Cruise Control -->
<!--==================================================================-->
<goal name="cruisecontrol:validate" prereqs="scm:validate">
<j:set var="ccHome" value="${maven.cruisecontrol.home}" />
<j:if test="${ccHome == 'CC_HOME_NOT_SET'}">
<ant:fail>You must specify maven.cruisecontrol.home</ant:fail>
</j:if>
<j:set var="nagEmail" value="${pom.build.nagEmailAddress}" />
<j:if test="${nagEmail == ''}">
<ant:fail>You must specify pom.build.nagEmailAddress</ant:fail>
</j:if>
<j:set var="defaultSuffix" value="${maven.cruisecontrol.mail.defaultsuffix}" />
<j:if test="${defaultSuffix == 'DEFAULT_SUFFIX_NOT_SET'}">
<util:tokenize var="tokens"
delim="@">${pom.build.nagEmailAddress}</util:tokenize>
<j:set var="maven.cruisecontrol.mail.defaultsuffix" value="@${tokens[1]}" />
</j:if>
</goal>
<!--==================================================================-->
<!-- Update a configuration file for Cruise Control -->
<!-- Will add or update this project's section -->
<!--==================================================================-->
<goal name="cruisecontrol:configure"
description="Update a Cruise Control configuration file with this project"
prereqs="cruisecontrol:validate">
<x:parse var="doc"><cruisecontrol></cruisecontrol></x:parse>
<util:available file="${maven.cruisecontrol.config}">
<util:file var="inputFile" name="${maven.cruisecontrol.config}" />
<x:parse var="doc" xml="${inputFile}" />
</util:available>
<j:set
var="tempConfigFile"
value="${maven.build.dir}/cruisecontrol-config-temp.xml" />
<j:set
var="stylesheet"
value="file:${plugin.resources}/cruisecontrol.jsl" />
<j:file name="${tempConfigFile}" outputMode="xml" prettyPrint="yes">
<j:include uri="${stylesheet.toString()}" />
</j:file>
<ant:copy file="${tempConfigFile}" tofile="${maven.cruisecontrol.config}" />
</goal>
<!--==================================================================-->
<!-- Run Cruise Control -->
<!--==================================================================-->
<goal name="cruisecontrol:run"
description="Run Cruise Control">
<!-- TODO -->
</goal>
</project>
1.1 maven/src/plugins-build/cruisecontrol/plugin.properties
Index: plugin.properties
===================================================================
maven.cruisecontrol.config=${basedir}/cruisecontrol.xml
maven.cruisecontrol.schedule.interval=300
maven.cruisecontrol.checkout.dir=${basedir}/checkout
maven.cruisecontrol.logs.dir=${basedir}/target/cc-logs
maven.cruisecontrol.goals=scm:update|clean test|site:deploy
maven.cruisecontrol.home=CC_HOME_NOT_SET
maven.cruisecontrol.mail.host=localhost
maven.cruisecontrol.mail.defaultsuffix=DEFAULT_SUFFIX_NOT_SET
maven.cruisecontrol.mail.subjectprefix=[BUILD]
1.1 maven/src/plugins-build/cruisecontrol/project.properties
Index: project.properties
===================================================================
# -------------------------------------------------------------------
# P R O J E C T P R O P E R T I E S
# -------------------------------------------------------------------
maven.xdoc.date=left
maven.xdoc.version=${pom.currentVersion}
maven.license.licenseFile=${basedir}/../../../LICENSE.txt
1.1 maven/src/plugins-build/cruisecontrol/project.xml
Index: project.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<project>
<extend>${basedir}/../project.xml</extend>
<id>maven-cruisecontrol-plugin</id>
<name>Maven Cruise Control Plug-in</name>
<currentVersion>1.0-SNAPSHOT</currentVersion>
<description>A plugin to handle the generating and maintaining of Cruise Control
configuration</description>
<shortDescription>Cruise Control Plugin for Maven</shortDescription>
<url>http://maven.apache.org/reference/plugins/cruisecontrol/</url>
<siteDirectory>/www/maven.apache.org/reference/plugins/cruisecontrol/</siteDirectory>
<repository>
<connection>scm:cvs:pserver:[EMAIL
PROTECTED]:/home/cvspublic:maven/src/plugins-build/cruisecontrol/</connection>
<url>http://cvs.apache.org/viewcvs/maven/src/plugins-build/cruisecontrol/</url>
</repository>
<developers>
<developer>
<name>Brett Porter</name>
<id>brett</id>
<email>[EMAIL PROTECTED]</email>
<organization>f2 network</organization>
<roles>
<role>Developer</role>
</roles>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>commons-jelly</groupId>
<artifactId>commons-jelly-tags-xml</artifactId>
<version>20030211.142705</version>
<url>http://jakarta.apache.org/commons/jelly/libs/xml/</url>
</dependency>
<dependency>
<groupId>commons-jelly</groupId>
<artifactId>commons-jelly-tags-jsl</artifactId>
<version>20030211.143151</version>
<url>http://jakarta.apache.org/commons/jelly/libs/jsl/</url>
</dependency>
</dependencies>
<build>
<nagEmailAddress>[EMAIL PROTECTED]</nagEmailAddress>
</build>
</project>
1.1
maven/src/plugins-build/cruisecontrol/src/plugin-resources/cruisecontrol.jsl
Index: cruisecontrol.jsl
===================================================================
<?xml version="1.0"?>
<jsl:stylesheet select="$doc"
xmlns:jsl="jelly:jsl"
xmlns:x="jelly:xml"
xmlns:j="jelly:core"
xmlns="dummy" trim="false">
<jsl:template match="cruisecontrol" trim="false">
<jsl:copy>
<!-- TODO: more configurable -->
<project name="${pom.artifactId}">
<bootstrappers>
<currentbuildstatusbootstrapper
file="${maven.cruisecontrol.logs.dir}/currentbuildstatus.txt"/>
</bootstrappers>
<modificationset>
<j:if
test="${pom.getPluginContext('maven-scm-plugin').getVariable('maven.scm.method') ==
'cvs'}">
<cvs
cvsroot="${pom.getPluginContext('maven-scm-plugin').getVariable('maven.scm.cvs.root')}"
localWorkingCopy="${maven.cruisecontrol.checkout.dir}/${pom.getPluginContext('maven-scm-plugin').getVariable('maven.scm.cvs.module')}"
/>
</j:if>
</modificationset>
<schedule interval="${maven.cruisecontrol.schedule.interval}">
<maven mavenscript="${maven.home}/bin/maven"
goal="${maven.cruisecontrol.goals}"
projectfile="${maven.cruisecontrol.checkout.dir}/${pom.getPluginContext('maven-scm-plugin').getVariable('maven.scm.cvs.module')}/project.xml"/>
</schedule>
<publishers>
<currentbuildstatuspublisher
file="${maven.cruisecontrol.logs.dir}/currentbuildstatus.txt"/>
<htmlemail
subjectprefix="${maven.cruisecontrol.mail.subjectprefix}"
defaultsuffix="${maven.cruisecontrol.mail.defaultsuffix}"
mailhost="${maven.cruisecontrol.mail.host}"
returnaddress="${pom.build.nagEmailAddress}"
logdir="${maven.cruisecontrol.logs.dir}/${pom.artifactId}"
css="${maven.cruisecontrol.home}/reporting/jsp/css/cruisecontrol.css"
xsldir="${maven.cruisecontrol.home}/reporting/jsp/xsl">
<failure address="${pom.build.nagEmailAddress}" />
</htmlemail>
</publishers>
</project>
<jsl:applyTemplates select="./project" />
</jsl:copy>
</jsl:template>
<jsl:template match="*" trim="false">
<j:set var="name"><x:expr select="@name" /></j:set>
<j:if test="${name != pom.artifactId}">
<jsl:copy>
<jsl:applyTemplates />
</jsl:copy>
</j:if>
</jsl:template>
<jsl:template match="@*" trim="false" />
</jsl:stylesheet>
1.1 maven/src/plugins-build/cruisecontrol/xdocs/goals.xml
Index: goals.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<document>
<properties>
<title>Maven Cruise Control Plug-in Goals</title>
</properties>
<body>
<goals>
<goal>
<name>cruisecontrol:configure</name>
<description>Update a Cruise Control configuration file with this
project</description>
</goal>
<goal>
<name>cruisecontrol:run</name>
<description>Run Cruise Control</description>
</goal>
</goals>
</body>
</document>
1.1 maven/src/plugins-build/cruisecontrol/xdocs/navigation.xml
Index: navigation.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="Maven Cruise Control Plug-in">
<title>Maven Cruise Control Plug-in</title>
<body>
<links>
<item href="http://maven.apache.org/" name="Maven">
</item>
</links>
<menu name="Overview">
<item href="/goals.html" name="Goals">
</item>
<item href="/properties.html" name="Properties">
</item>
</menu>
</body>
</project>
1.1 maven/src/plugins-build/cruisecontrol/xdocs/properties.xml
Index: properties.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<document>
<properties>
<title>Maven Cruise Control Plug-in Properties</title>
</properties>
<body>
<section name="Maven Cruise Control Plug-in Settings">
<table>
<tr>
<th>Property</th>
<th>Optional?</th>
<th>Description</th>
</tr>
<tr>
<td>maven.cruisecontrol.home</td>
<td>No</td>
<td>
<p>Location of cruise control installation - for finding the reporting
directory</p>
</td>
</tr>
<tr>
<td>maven.cruisecontrol.schedule.interval</td>
<td>Yes</td>
<td>
<p>Seconds in between builds for this project. Default value is
<code>300</code>.</p>
</td>
</tr>
<tr>
<td>maven.cruisecontrol.mail.host</td>
<td>Yes</td>
<td>
<p>Default value is
<code>localhost</code>.</p>
</td>
</tr>
<tr>
<td>maven.cruisecontrol.mail.subjectprefix</td>
<td>Yes</td>
<td>
<p>Default value is
<code>[BUILD]</code>.</p>
</td>
</tr>
<tr>
<td>maven.cruisecontrol.checkout.dir</td>
<td>Yes</td>
<td>
<p>Where to checkout/update code temporarily. Default value is
<code>${basedir}/checkout</code>.</p>
</td>
</tr>
<tr>
<td>maven.cruisecontrol.logs.dir</td>
<td>Yes</td>
<td>
<p>Default value is
<code>${basedir}/target/cc-logs</code>.</p>
</td>
</tr>
<tr>
<td>maven.cruisecontrol.goals</td>
<td>Yes</td>
<td>
<p>Default value is
<code>scm:update|clean test|site:deploy</code>.</p>
</td>
</tr>
<tr>
<td>maven.cruisecontrol.config</td>
<td>Yes</td>
<td>
<p>Config file to update/create. Default value is
<code>${basedir}/cruisecontrol.xml</code>.</p>
</td>
</tr>
<tr>
<td>maven.cruisecontrol.mail.defaultsuffix</td>
<td>Yes</td>
<td>
<p>Default value is the domain name of the first email in
<code>${pom.build.nagEmailAddress}</code>.</p>
</td>
</tr>
</table>
</section>
</body>
</document>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]