blob: e7dabb5b88559d12062297fbfec86f5acba33444 [file] [log] [blame]
<?xml version="1.0" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://nant.sourceforge.net/release/0.85/nant.xsd">
<!-- ============================================================================================ -->
<!-- I N I T I A L I Z A T I O N T A R G E T S -->
<!-- ============================================================================================ -->
<!-- global project settings -->
<property name="project.cls.compliant" value="true" unless="${property::exists('project.cls.compliant')}"/>
<property name="project.release.type" value="SNAPSHOT" unless="${property::exists('project.release.type')}" />
<property name="project.version.full" value="${project.version + if(project.release.type == 'release', '', '-' + project.release.type)}" dynamic="true" />
<property name="build.dir" value="${basedir}/build" />
<property name="doc.dir" value="${build.dir}/doc" />
<property name="lib.dir" value="${path::combine(basedir, 'lib')}" dynamic="true" />
<property name="lib.family.dir" value="${path::combine(lib.dir, framework::get-family(framework::get-target-framework()))}" dynamic="true" />
<property name="lib.framework.dir" value="${path::combine(lib.family.dir, version::to-string(framework::get-version(framework::get-target-framework())))}" dynamic="true" />
<!-- default configuration -->
<property name="build.defines" value=""/>
<property name="build.noskip" value="false"/>
<property name="build.skip" value="false"/>
<property name="current.build.config" value="${if(project.release.type == 'release', 'release', 'debug')}"/>
<property name="current.build.framework" value="${framework::get-target-framework()}"/>
<property name="current.build.defines" value="${build.defines}" />
<!-- Figure out the user's HOME directory -->
<property name="user.home" value="${environment::get-variable('HOME')}"
if="${environment::variable-exists('HOME') and platform::is-unix()}"
unless="${property::exists('user.home')}"/>
<property name="user.home" value="${environment::get-variable('USERPROFILE')}"
if="${environment::variable-exists('USERPROFILE') and platform::is-win32()}"
unless="${property::exists('user.home')}"/>
<fail message="The HOME environment variable is not defined. Please set it to your home directory."
unless="${property::exists('user.home')}" if="${platform::is-unix()}"/>
<fail message="The USERPROFILE environment variable is not defined. Please set it to your home directory."
unless="${property::exists('user.home')}" if="${platform::is-win32()}"/>
<!-- Figure out the NANT repositories-->
<property name="nant.repo" value="${environment::get-variable('NANT_REPO')}"
if="${environment::variable-exists('NANT_REPO')}"
unless="${property::exists('nant.repo')}"/>
<property name="nant.local.repo" value="${user.home}/.nant/repository"
unless="${property::exists('nant.local.repo')}"/>
<property name="nant.remote.repo" value="${environment::get-variable('NANT_REMOTE_REPO')}"
if="${environment::variable-exists('NANT_REMOTE_REPO')}"
unless="${property::exists('nant.remote.repo')}"/>
<property name="nant.remote.repo" value="http://people.apache.org/~chirino/nant-repo"
unless="${property::exists('nant.remote.repo')}"/>
<!-- Nant Repo Tasks -->
<target name="repo-download" description="Download a dependency from the remote repo to the local repo">
<fail message="The repo.task.artifact variable has not been set. Please set it before you call this task." unless="${property::exists('repo.task.artifact')}"/>
<property name="repo.task.src" value="${nant.remote.repo}/${repo.task.artifact}"/>
<property name="repo.task.dest" value="${nant.local.repo}/${repo.task.artifact}"/>
<property name="repo.task.download" value="false"/>
<if test="${not file::exists(repo.task.dest)}">
<property name="repo.task.download" value="true"/>
</if>
<if test="${file::exists(repo.task.dest)}">
<!-- TODO: we could also download if the file is a SNAPSHOT and is stale -->
<property name="repo.task.download" value="false"/>
<echo message="Artifact: ${nant.remote.repo}/${repo.task.artifact} is up to date."/>
</if>
<if test="${repo.task.download}">
<echo message="Downloading artifact: ${repo.task.src}"/>
<mkdir dir="${directory::get-parent-directory(repo.task.dest)}" />
<get src="${repo.task.src}" dest="${repo.task.dest}"/>
</if>
</target>
<target name="repo-install" description="Install a dependency to the local repo">
<fail message="The repo.task.artifact variable has not been set. Please set it before you call this task." unless="${property::exists('repo.task.artifact')}"/>
<fail message="The repo.task.src variable has not been set. Please set it before you call this task." unless="${property::exists('repo.task.src')}"/>
<property name="repo.task.dest" value="${nant.local.repo}/${repo.task.artifact}"/>
<mkdir dir="${directory::get-parent-directory(repo.task.dest)}" />
<copy file="${repo.task.src}" tofile="${repo.task.dest}"/>
</target>
<target name="release-init" description="Initializes release build properties">
<property name="snk.file" value="${environment::get-variable('ACTIVEMQ_DOTNET_SNK')}"
if="${environment::variable-exists('ACTIVEMQ_DOTNET_SNK')}"
unless="${property::exists('snk.file')}"/>
<property name="snk.file" value="${basedir}/activemq-dotnet.snk" if="${not property::exists('snk.file')}"/>
<if test="${not file::exists(snk.file)}">
<if test="${build.noskip}">
<fail message="Release key file not found. You can generate a key file by running 'sn -k activemq-dotnet.snk'. Then set the ACTIVEMQ_DOTNET_SNK environment variable to the full pathname of the file." />
</if>
<property name="build.skip.release" value="true" />
</if>
<if test="${file::exists(snk.file)}">
<property name="build.skip.release" value="false" />
</if>
</target>
<target name="init" description="Initializes build properties">
<!-- enabled the release or debug configuration -->
<call target="set-${current.build.config}-configuration"/>
<!-- Check to see if our build setup for the target framework -->
<if test="${not(target::exists('set-'+current.build.framework+'-framework-configuration'))}">
<fail message="The '${current.build.framework}' framework is not supported by this version of ActiveMQ .NET" />
</if>
<call target="set-${current.build.framework}-framework-configuration" />
<!-- Check to see current platform supports the target framework -->
<if test="${framework::exists(current.build.framework)}">
<!-- Make sure that the activemq-dotnet.snk exists for release builds -->
<if test="${current.build.config.release}">
<call target="release-init"/>
</if>
<property name="build.skip" value="false" />
</if>
<if test="${not framework::exists(current.build.framework)}">
<if test="${build.noskip}">
<fail message="${current.build.framework.name} is not available." />
</if>
<if test="${not(build.noskip)}">
<echo message="${current.build.framework.name} is not available. Build skipped." />
<property name="build.skip" value="true"/>
</if>
</if>
<!-- Check to see if we should skip this build framework. -->
<if test="${not(build.skip)}">
<if test="${property::exists('build.'+current.build.framework+'.skip')}">
<property name="build.skip" value="true"/>
<echo message="The '${current.build.framework}' framework is not supported by this version of ActiveMQ .NET" />
</if>
</if>
<if test="${not(build.skip)}">
<property name="current.build.keysign" value="${current.build.config=='release' and file::exists(snk.file) and current.build.framework.sign}"/>
<echo message="Doing ${if(current.build.keysign,'a signed','an unsigned')} ${current.build.config} build for the ${current.build.framework.name} framework" />
<property name="build.bin.dir" value="${basedir}/build/${nant.settings.currentframework}/${current.build.config}" />
<mkdir dir="${build.bin.dir}"/>
<call target="dependency-init"/>
</if>
</target>
<!-- ============================================================================================ -->
<!-- C O N F I G U R A T I O N T A R G E T S -->
<!-- ============================================================================================ -->
<target name="set-noskip-configuration" description="Disable skiping builds">
<property name="project.noskip" value="true" />
</target>
<target name="set-debug-configuration" description="Enabled 'debug' builds">
<property name="current.build.config" value="debug" />
<property name="current.build.config.debug" value="true" />
<property name="current.build.config.release" value="false" />
<property name="csc.debug" value="true" />
<property name="csc.optimize" value="false" />
</target>
<target name="set-release-configuration" description="Enabled 'release' builds">
<property name="current.build.config" value="release" />
<property name="current.build.config.release" value="true" />
<property name="current.build.config.debug" value="false" />
<property name="csc.debug" value="true" />
<property name="csc.optimize" value="true" />
</target>
<target name="set-net-1.1-framework-configuration">
<property name="current.build.framework" value="net-1.1" />
<property name="current.build.framework.name" value=".NET 1.1"/>
<property name="current.build.defines" value="${build.defines}NET,NET_1_1" dynamic="true" />
<property name="current.build.framework.sign" value="true" />
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="link.sdkdoc.web" value="true" />
<if test="${framework::exists(current.build.framework)}">
<property name="nant.settings.currentframework" value="${current.build.framework}" />
</if>
</target>
<target name="set-net-2.0-framework-configuration">
<property name="current.build.framework" value="net-2.0" />
<property name="current.build.framework.name" value=".NET 2.0"/>
<property name="current.build.defines" value="${build.defines}NET,NET_2_0" dynamic="true" />
<property name="current.build.framework.sign" value="true"/>
<property name="link.sdkdoc.version" value="SDK_v2_0" />
<property name="link.sdkdoc.web" value="true" />
<if test="${framework::exists(current.build.framework)}">
<property name="nant.settings.currentframework" value="${current.build.framework}" />
</if>
</target>
<target name="set-net-3.5-framework-configuration">
<property name="current.build.framework" value="net-3.5" />
<property name="current.build.framework.name" value=".NET 3.5"/>
<property name="current.build.defines" value="${build.defines}NET,NET_2_0,NET_3_5" dynamic="true" />
<property name="current.build.framework.sign" value="true"/>
<property name="link.sdkdoc.version" value="SDK_v6_0a" />
<property name="link.sdkdoc.web" value="true" />
<if test="${framework::exists(current.build.framework)}">
<property name="nant.settings.currentframework" value="${current.build.framework}" />
</if>
</target>
<target name="set-netcf-2.0-framework-configuration">
<property name="current.build.framework" value="netcf-2.0" />
<property name="current.build.framework.name" value=".NET Compact Framework 2.0"/>
<property name="current.build.defines" value="${build.defines}PocketPC,NETCF,NETCF_2_0" dynamic="true" />
<property name="current.build.framework.sign" value="false" />
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="link.sdkdoc.web" value="true" />
<if test="${framework::exists(current.build.framework)}">
<property name="nant.settings.currentframework" value="${current.build.framework}" />
</if>
</target>
<target name="set-mono-2.0-framework-configuration">
<property name="current.build.framework" value="mono-2.0" />
<property name="current.build.framework.name" value="Mono 2.0"/>
<property name="current.build.defines" value="${build.defines}MONO,MONO_2_0" dynamic="true" />
<property name="current.build.framework.sign" value="true" />
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="link.sdkdoc.web" value="true" />
<if test="${framework::exists(current.build.framework)}">
<property name="nant.settings.currentframework" value="${current.build.framework}" />
</if>
</target>
<!-- ============================================================================================ -->
<!-- C O M P I L E T A R G E T S -->
<!-- ============================================================================================ -->
<target name="compile-all" depends="release-init" description="Compile all build configurations for all runtime configurations">
<echo message="Compiling all build configurations for all runtime configurations." />
<call target="set-debug-configuration" />
<call target="set-net-1.1-framework-configuration" /><call target="conditional-compile" />
<call target="set-net-2.0-framework-configuration" /><call target="conditional-compile" />
<call target="set-net-3.5-framework-configuration" /><call target="conditional-compile" />
<call target="set-mono-2.0-framework-configuration" /><call target="conditional-compile" />
<call target="set-netcf-2.0-framework-configuration"/><call target="conditional-compile" />
<call target="set-release-configuration" />
<call target="set-net-1.1-framework-configuration" /><call target="conditional-compile" />
<call target="set-net-2.0-framework-configuration" /><call target="conditional-compile" />
<call target="set-net-3.5-framework-configuration" /><call target="conditional-compile" />
<call target="set-mono-2.0-framework-configuration" /><call target="conditional-compile" />
<call target="set-netcf-2.0-framework-configuration"/><call target="conditional-compile" />
</target>
<target name="conditional-compile" depends="init" unless="${build.skip}"
description="Conditionaly compiles all the modules if build framework and type are supported">
<call target="compile" />
</target>
<target name="compile" depends="compile-main,compile-test" description="Compile everything"/>
<target name="compile-main" depends="init" description="Build the main library">
<echo message="Building the ${project.name} library"/>
<asminfo output="src/main/csharp/CommonAssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
</imports>
<attributes>
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="CLSCompliantAttribute" value="${project.cls.compliant}" />
<attribute type="AssemblyTitleAttribute" value="${project.short_description}" />
<attribute type="AssemblyDescriptionAttribute" value="${project.description}" />
<attribute type="AssemblyConfigurationAttribute" value="${project.release.type}" />
<attribute type="AssemblyCompanyAttribute" value="http://activemq.apache.org/nms" />
<attribute type="AssemblyProductAttribute" value="${project.short_description}" />
<attribute type="AssemblyCopyrightAttribute" value="Copyright (C) 2005-${datetime::get-year(datetime::now())} Apache Software Foundation" />
<attribute type="AssemblyTrademarkAttribute" value="" />
<attribute type="AssemblyCultureAttribute" value="" />
<attribute type="AssemblyVersionAttribute" value="${project.version}" />
<attribute type="AssemblyInformationalVersionAttribute" value="${project.version}" />
</attributes>
</asminfo>
<csc if="${current.build.keysign}" keyfile="${snk.file}" target="library"
define="${current.build.defines}" warnaserror="false" debug="${csc.debug}" optimize="${csc.optimize}"
output="${build.bin.dir}/${project.name}.dll" doc="${build.bin.dir}/${project.name}.xml">
<nowarn>
<warning number="1591" /> <!-- do not report warnings for missing XML comments -->
</nowarn>
<sources failonempty="true">
<include name="src/main/csharp/**.cs" />
</sources>
<references refid="dependencies" />
</csc>
<csc if="${not current.build.keysign}" target="library"
define="${current.build.defines}" warnaserror="false" debug="${csc.debug}" optimize="${csc.optimize}"
output="${build.bin.dir}/${project.name}.dll" doc="${build.bin.dir}/${project.name}.xml">
<nowarn>
<warning number="1591" /> <!-- do not report warnings for missing XML comments -->
</nowarn>
<sources failonempty="true">
<include name="src/main/csharp/**.cs" />
</sources>
<references refid="dependencies" />
</csc>
<call target="copy-content"/>
</target>
<!-- Compile the nms-test module -->
<target name="compile-test" depends="compile-main" description="Build the test library">
<echo message="Building the ${project.name}.Test library" />
<asminfo output="src/test/csharp/CommonAssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
</imports>
<attributes>
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="CLSCompliantAttribute" value="${project.cls.compliant}" />
<attribute type="AssemblyTitleAttribute" value="${project.short_description}" />
<attribute type="AssemblyDescriptionAttribute" value="${project.description}" />
<attribute type="AssemblyConfigurationAttribute" value="${project.release.type}" />
<attribute type="AssemblyCompanyAttribute" value="http://activemq.apache.org/nms" />
<attribute type="AssemblyProductAttribute" value="${project.short_description}" />
<attribute type="AssemblyCopyrightAttribute" value="Copyright (C) 2005-${datetime::get-year(datetime::now())} Apache Software Foundation" />
<attribute type="AssemblyTrademarkAttribute" value="" />
<attribute type="AssemblyCultureAttribute" value="" />
<attribute type="AssemblyVersionAttribute" value="${project.version}" />
<attribute type="AssemblyInformationalVersionAttribute" value="${project.version}" />
</attributes>
</asminfo>
<csc if="${current.build.keysign}" keyfile="${snk.file}" target="library"
define="${current.build.defines}" warnaserror="false" debug="${csc.debug}" optimize="${csc.optimize}"
output="${build.bin.dir}/${project.name}.Test.dll" doc="${build.bin.dir}/${project.name}.Test.xml">
<nowarn>
<warning number="1591" /> <!-- do not report warnings for missing XML comments -->
<warning number="0618" /> <!-- do not report deprecation warnings -->
</nowarn>
<sources failonempty="true">
<include name="src/test/csharp/**.cs" />
</sources>
<references refid="test.dependencies" />
</csc>
<csc if="${not current.build.keysign}" target="library"
define="${current.build.defines}" warnaserror="false" debug="${csc.debug}" optimize="${csc.optimize}"
output="${build.bin.dir}/${project.name}.Test.dll" doc="${build.bin.dir}/${project.name}.Test.xml">
<nowarn>
<warning number="1591" /> <!-- do not report warnings for missing XML comments -->
<warning number="0618" /> <!-- do not report deprecation warnings -->
</nowarn>
<sources failonempty="true">
<include name="src/test/csharp/**.cs" />
</sources>
<references refid="test.dependencies" />
</csc>
<call target="copy-content"/>
</target>
<target name="copy-content">
<foreach item="File" property="content.filename">
<in>
<items refid="content.filenames" />
</in>
<do>
<copy todir="${build.bin.dir}" file="${content.filename}" if="${not file::up-to-date(content.filename, '${build.bin.dir}/${content.filename}')}" />
</do>
</foreach>
</target>
<!-- ============================================================================================ -->
<!-- I N S T A L L T A R G E T S -->
<!-- ============================================================================================ -->
<target name="install-all" depends="release-init" description="Install all build configurations for all runtime configurations">
<echo message="Installing all build configurations for all runtime configurations." />
<call target="set-debug-configuration" />
<call target="set-net-1.1-framework-configuration" /><call target="conditional-install" />
<call target="set-net-2.0-framework-configuration" /><call target="conditional-install" />
<call target="set-net-3.5-framework-configuration" /><call target="conditional-install" />
<call target="set-mono-2.0-framework-configuration" /><call target="conditional-install" />
<call target="set-netcf-2.0-framework-configuration"/><call target="conditional-install" />
<!-- we can only do a release skip if the Key file is available -->
<if test="${not build.skip.release}">
<call target="set-release-configuration" />
<call target="set-net-1.1-framework-configuration" /><call target="conditional-install" />
<call target="set-net-2.0-framework-configuration" /><call target="conditional-install" />
<call target="set-net-3.5-framework-configuration" /><call target="conditional-install" />
<call target="set-mono-2.0-framework-configuration" /><call target="conditional-install" />
<call target="set-netcf-2.0-framework-configuration"/><call target="conditional-install" />
</if>
</target>
<target name="conditional-install" depends="init" unless="${build.skip}"
description="Conditionaly install all the modules if build framework and type are supported">
<call target="install" />
</target>
<!-- Install the modules to the local repo -->
<target name="install" depends="compile" description="Install the artifacts into the nant repo">
<property name="path" value="${project.group}/${project.name}/${project.version.full}/${current.build.framework}/${current.build.config}"/>
<foreach item="File" property="install.filename">
<in>
<items refid="install.filenames" />
</in>
<do>
<property name="repo.task.artifact" value="${path}/${install.filename}"/>
<property name="repo.task.src" value="${build.bin.dir}/${install.filename}"/>
<call target="repo-install"/>
</do>
</foreach>
</target>
<!-- ============================================================================================ -->
<!-- D E P L O Y T A R G E T S -->
<!-- ============================================================================================ -->
<target name="deploy-all" depends="release-init" description="Deploy all build configurations for all runtime configurations">
<echo message="Deploying release configurations for all runtime configurations." />
<call target="set-release-configuration" />
<call target="set-net-1.1-framework-configuration" /><call target="conditional-deploy" />
<call target="set-net-2.0-framework-configuration" /><call target="conditional-deploy" />
<call target="set-net-3.5-framework-configuration" /><call target="conditional-deploy" />
<call target="set-mono-2.0-framework-configuration" /><call target="conditional-deploy" />
<call target="set-netcf-2.0-framework-configuration"/><call target="conditional-deploy" />
<!-- Commit the deployed files to repository. This completes the deployment. -->
<exec program="svn" failonerror="false">
<arg value="commit"/>
<arg value="deploy"/>
<arg value="-m"/>
<arg value="Deploy ${project.name} ${project.version}"/>
</exec>
</target>
<target name="conditional-deploy" depends="init" unless="${build.skip}"
description="Conditionaly deploy all the modules if build framework and type are supported">
<call target="deploy" />
</target>
<target name="init-deploy">
</target>
<!-- Deploy the modules to the global repo -->
<target name="deploy" depends="init-deploy" description="Deploy the artifacts into the nant repo">
<property name="repo.dir" value="deploy/${current.build.framework}"/>
<foreach item="File" property="deploy.filename">
<in>
<items refid="deploy.filenames" />
</in>
<do>
<property name="repo.task.dest" value="${path::get-file-name(deploy.filename)}"/>
<copy file="${deploy.filename}" todir="${repo.dir}" if="${not file::up-to-date(deploy.filename, '${repo.dir}/${repo.task.dest}')}" />
</do>
</foreach>
</target>
<!-- ============================================================================================ -->
<!-- M I S C E L L A N E O U S T A R G E T S -->
<!-- ============================================================================================ -->
<target name="clean" description="Deletes build">
<if test="${target::exists('clean-init')}">
<call target="clean-init"/>
</if>
<delete dir="build" if="${directory::exists('build')}" />
<delete dir="obj" if="${directory::exists('obj')}" />
</target>
<target name="doc" depends="compile">
<mkdir dir="${doc.dir}"/>
<ndoc failonerror="false">
<assemblies basedir="${build.bin.dir}">
<include name="${project.name}.dll" />
</assemblies>
<summaries basedir="${basedir}/src/main/ndoc">
<include name="NamespaceSummary.xml" />
</summaries>
<documenters>
<documenter name="MSDN">
<property name="OutputDirectory" value="${doc.dir}" />
<property name="HtmlHelpName" value="${project.name}" />
<property name="HtmlHelpCompilerFilename" value="hhc.exe" />
<property name="IncludeFavorites" value="False" />
<property name="Title" value="${project.short_description}" />
<property name="SplitTOCs" value="False" />
<property name="DefaulTOC" value="" />
<!--
<property name="ShowVisualBasic" value="True" />
<property name="ShowMissingSummaries" value="True" />
<property name="ShowMissingRemarks" value="True" />
<property name="ShowMissingParams" value="True" />
<property name="ShowMissingReturns" value="True" />
<property name="ShowMissingValues" value="True" />
-->
<property name="DocumentInternals" value="False" />
<property name="DocumentProtected" value="True" />
<property name="DocumentPrivates" value="False" />
<property name="DocumentEmptyNamespaces" value="False" />
<property name="IncludeAssemblyVersion" value="False" />
<property name="CopyrightText" value="" />
<property name="CopyrightHref" value="" />
</documenter>
</documenters>
</ndoc>
</target>
</project>