pyx4j-cruisecontrol

Overview

The pyx4j-cruisecontrol is cruisecontrol helpers.

  • SVNLabelIncrementer update version label file and store it in SVN.

SVNLabelIncrementer usage

This is the fragment from our cruisecontrol.xml that will store buildNumber in SVN.

    <project name="pyx4j-gwt" buildafterfailed="false">
        <bootstrappers>
            <currentbuildstatusbootstrapper file="${cc-logs}/${project.name}/${status.file}"/>
        </bootstrappers>
        <modificationset quietperiod="10" ignoreFiles="*/.classpath,*/.project,*/build.version">
            <svn RepositoryLocation="${svn.repository.base}/pyx4j-gwt/" username="${svn.username}" password="${svn.password}"/>
        </modificationset>

        <plugin name="labelincrementer" classname="com.pyx4j.cruisecontrol.SVNLabelIncrementer"/>
        <labelincrementer
                preBuildIncrementer="true"
                propertyfile="${cc-work}/${project.name}/build.version"
                propertyNameMajor = "build.version"
                propertyNameMinor = "build.buildNum"
                incrementEnabled  = "true"
                appendTimeEnabled = "false"
                repositoryLocation="${svn.repository.base}/pyx4j-gwt" username="${svn.username}" password="${svn.password}"/>

        <!-- Every 20 min = 1200 sec -->
        <schedule interval="1200">
            <maven2 goal="clean scm:update -P build|clean deploy site-deploy -P build -DperformRelease=true"
                   pomfile="${cc-work}/${project.name}/pyx4j-gwt/pom.xml"
                   mvnscript="${env.M2_HOME}/bin/mvn.bat"/>
        </schedule>

        ....

    </project>

This is how property file build.version looks like:

#$Id: index.apt 50 2007-03-20 16:38:12Z vlads $
# When you increment a build.version in this file You need to set build.buildNum=0
# This way the first build will start from 01
#Thu Dec 14 16:30:41 EST 2006
build.version=0.2
build.buildNum=169

SVNLabelIncrementer for J2ME

If you use SVNLabelIncrementer to create versions for MIDLet then your buildNum can't be greater than 99. See MIDlet Suite Versioning

To achieve this you need to set maxBuildNumber property to 99. After propertyNameMinor reaches 100 it would be set to 1 and propertyNameMajor would be Incremented