commitmonitor Code
Monitor your SVN repositories and notifies you on new commits
Brought to you by:
steveking
<?xml version="1.0"?>
<project name="CommitMonitor" default="help">
<!-- default configuration is release -->
<property name="configuration" value="release" />
<!-- default builds are dev builds -->
<property name="devrelease" value="-dev" unless="${property::exists('devrelease')}" />
<!-- default build for win32 platform -->
<property name="platform" value="win32" />
<!-- default: don't add a platform specific extension
to the bin folders 'release' / 'debug' -->
<property name="bindirextension" value="" />
<!-- default: we don't cross-compile -->
<property name="crosscompile" value="" />
<!-- default: we don't clean first -->
<property name="cleanup" value="" />
<!-- default: we build in a user session -->
<property name="solutionname" value="CommitMonitor.sln" />
<!-- the ${subsystem} to use -->
<property name="subsystem" value="/SUBSYSTEM:WINDOWS,5.01" />
<include buildfile="default.build.user" />
<!-- the signinfo.txt file has to contain one line with parameters for signtool.exe,
for example:
/t "url/to/timestamp/server" /q
-->
<loadfile file="signinfo.txt" property="signinfo" failonerror="false" if="${file::exists('signinfo.txt')}" />
<!-- ====================================================================== -->
<!-- Configuration targets -->
<!-- ====================================================================== -->
<target name="debug">
<description>
Sets the environment up to build the debug versions.
</description>
<property name="configuration" value="debug" />
</target>
<target name="release">
<description>
Sets the environment up to build an official release version,
without the '-dev' markers.
</description>
<property name="devrelease" value="" />
</target>
<target name="x64">
<description>
Compiles everything for the win64 platform.
</description>
<property name="platform" value="x64" />
<property name="bindirextension" value="64" />
<property name="subsystem" value="/SUBSYSTEM:WINDOWS,5.02" />
</target>
<target name="cross" depends="x64">
<description>
Cross-compiles on win32 for a different platform.
</description>
<property name="crosscompile" value="yes" if="${platform == 'x64'}" />
<echo message="ignore cross-compiling (only supported for x64)" level="Warning" if="${platform != 'x64'}" />
</target>
<!-- ====================================================================== -->
<!-- Project targets -->
<!-- ====================================================================== -->
<target name="clean" depends="VSNET">
<description>
Cleans before building the target
</description>
<property name="cleanup" value="yes" />
</target>
<target name="cleanall" depends="VSNET">
<description>
Cleans every subproject.
</description>
<property name="cleanup" value="yes" />
<nant target="clean">
<buildfiles>
<include name="ext/build/OpenSSL.build" />
<include name="ext/build/default.build" />
</buildfiles>
</nant>
<exec program="devenv.com">
<arg value="${solutionname}" />
<arg value="/clean" />
<arg value="${configuration}|${platform}" />
</exec>
</target>
<target name="VersionInfo" depends="VSNET,env">
<description>
Sets the version information as properties, env variables
and sets up the different version specific files.
</description>
<nant target="versioninfo">
<buildfiles>
<include name="versioninfo.build" />
</buildfiles>
</nant>
<loadfile file="src\version.in" property="versionheaderfile">
<filterchain>
<replacetokens begintoken="$" endtoken="$">
<token key="MajorVersion" value="${environment::get-variable('MajorVersion')}" />
<token key="MinorVersion" value="${environment::get-variable('MinorVersion')}" />
<token key="MicroVersion" value="${environment::get-variable('Microversion')}" />
<token key="WCREV" value="${environment::get-variable('WCREV')}" />
<token key="WCDATE" value="${environment::get-variable('WCDATE')}" />
<token key="DEVBUILD" value="${devrelease}" />
</replacetokens>
</filterchain>
</loadfile>
<echo file="src\version.h" message="${versionheaderfile}" />
</target>
<target name="Subversion" depends="VSNET,env,VersionInfo">
<description>
Builds all the libraries CommitMonitor depends on:
Subversion, apr, OpenSSL, ...
</description>
<nant target="OpenSSL">
<buildfiles>
<include name="ext\build\OpenSSL.build" />
</buildfiles>
</nant>
<nant target="build">
<buildfiles>
<include name="ext\build\default.build" />
</buildfiles>
</nant>
</target>
<target name="SubversionOnly" depends="VSNET,env">
<description>
Builds all the libraries CommitMonitor depends on:
Subversion, apr, ...
</description>
<nant target="build">
<buildfiles>
<include name="ext\build\default.build" />
</buildfiles>
</nant>
</target>
<target name="CommitMonitor" depends="VSNET,env,VersionInfo">
<description>
Builds CommitMonitor. The libraries must have been built
before.
</description>
<exec program="devenv.com">
<arg value="${solutionname}" />
<arg value="/rebuild" />
<arg value="${configuration}|${platform}" />
</exec>
<exec program="Tools\upx.exe">
<arg value="-q" />
<arg value="bin\${configuration}_${platform}\CommitMonitor.exe" />
</exec>
</target>
<target name="binaries" depends="Subversion,CommitMonitor">
<description>
Builds all binaries
</description>
</target>
<target name="setup" depends="Subversion,CommitMonitor">
<description>
Uses WiX to create an msi installer file.
</description>
<nant target="setup">
<buildfiles>
<include name="src\Setup\setup.build" />
</buildfiles>
</nant>
</target>
<target name="msi" depends="VersionInfo">
<description>
Builds the msi installer from already built binaries.
</description>
<nant target="setup">
<buildfiles>
<include name="src\Setup\setup.build" />
</buildfiles>
</nant>
</target>
<!-- ====================================================================== -->
<!-- Help target -->
<!-- ====================================================================== -->
<target name="help">
<!-- note: use spaces in the help text below! Otherwise the output won't be aligned in the console. -->
<echo message="You must specify a target to tell us what you want to build!" />
<echo />
<echo message="The following targets are available:" />
<echo message="clean : this will clean up previous builds and force a" />
<echo message=" complete rebuild later" />
<echo message="cleanall : clean every subproject" />
<echo message="Subversion : builds the Subversion libraries, including its" />
<echo message=" dependencies" />
<echo message="CommitMonitor: builds CommitMonitor. You must have build the" />
<echo message=" Subversion libraries before, or this will fail" />
<echo message="setup : creates an msi installer for CommitMonitor" />
<echo message="msi : creates the msi, but doesn't build the libs first" />
<echo />
<echo message="The following targets can be used to tweak the builds:" />
<echo message="clean : clean those targets which are built next" />
<echo message="debug : if this target is called before other build targets," />
<echo message=" those targets are built with debug support" />
<echo message="release : call this if you want to create official releases." />
<echo message=" It removes the '-dev' string from some builds" />
<echo message="x64 : call this if you want to create native 64 bit builds." />
<echo message=" (AMD64/EM64T only -- will not work on Itanium systems.)" />
<echo message="cross : cross-compile on win32 for the given target platform." />
<echo message=" (currently only available with x64.)" />
<echo />
<echo message="Please specify the configuration targets BEFORE the main target." />
<echo message="Examples:" />
<echo />
<echo message="nant release setup" />
<echo message="nant -v x64 debug" />
<echo message="nant cross x64 setup" />
<echo />
</target>
</project>