Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

881 lines (839 sloc) 45.981 kb
<?xml version="1.0" ?>
<!-- NAnt build file for building NAnt -->
<project name="nant" default="test">
<!-- set build.date property to current date in format yyyy-MM-dd -->
<tstamp property="build.date" pattern="yyyy-MM-dd" />
<!-- global project settings -->
<property name="project.name" value="nant" />
<property name="project.version" value="0.92" unless="${property::exists('project.version')}" />
<property name="project.release.type" value="dev" unless="${property::exists('project.release.type')}" /> <!-- nightly | dev | alpha | beta# | rc# | release -->
<if test="${project.release.type == 'nightly'}">
<property name="project.version.full" value="${project.version + '-nightly-' + build.date}" />
</if>
<if test="${project.release.type != 'nightly'}">
<property name="project.version.full" value="${project.version + if(project.release.type == 'release', '', '-' + project.release.type)}" dynamic="true" />
</if>
<property name="build.warnaserror" value="false" />
<if test="${project.release.type == 'dev' or project.release.type == 'nightly'}">
<property name="build.warnaserror" value="true" />
</if>
<!--
specifies whether the CommonAssemblyInfo.cs file should be created.
we do not want this for releases (whether they're beta or release) as
this would cause the build number to be updated
-->
<property name="create.assemblyinfo" value="true" />
<!-- default configuration -->
<property name="project.config" value="debug" /> <!-- debug | release -->
<property name="nant.console.name" value="NAnt" />
<property name="build.defines" value="" />
<property name="build.number" value="${math::abs(math::floor(timespan::get-total-days(datetime::now() - datetime::parse('01/01/2000'))))}" />
<!-- platform specific properties. These are the defaults -->
<property name="current.build.defines" value="${build.defines}" />
<fileset id="ext.core" basedir="src">
<include name="NAnt.DotNet/NAnt.DotNet.build" />
<include name="NAnt.Compression/NAnt.Compression.build" />
<include name="NAnt.NUnit/NAnt.NUnit.build" />
<include name="NAnt.SourceControl/NAnt.SourceControl.build" />
<include name="NAnt.MSNet/NAnt.MSNet.build" />
<include name="NAnt.Win32/NAnt.Win32.build" />
<include name="NAnt.VisualCpp/NAnt.VisualCpp.build" />
<include name="NAnt.VSNet/NAnt.VSNet.build" />
</fileset>
<fileset id="ext.core.tests" basedir="tests">
<include name="NAnt.DotNet/NAnt.DotNet.build" />
<include name="NAnt.Compression/NAnt.Compression.build" />
<include name="NAnt.SourceControl/NAnt.SourceControl.build" />
<include name="NAnt.MSNet/NAnt.MSNet.build" />
<include name="NAnt.Win32/NAnt.Win32.build" />
<include name="NAnt.VisualCpp/NAnt.VisualCpp.build" />
<include name="NAnt.VSNet/NAnt.VSNet.build" />
</fileset>
<!-- build in help manual -->
<target name="help" description="Describe usage of this file">
<echo message="Synopsis:" />
<echo message=" nant" />
<echo message=" nant [debug|release] [clean|cleanall] [build] [test]" />
<echo message="" />
<echo message="Targets:" />
<echo message=" clean - clean the files for the current project configuration" />
<echo message=" cleanall - clean the files for all project configurations" />
<echo message=" debug - setup the build for 'debug' project configuration" />
<echo message=" release - setup the build for 'release' project configuration" />
<echo message="" />
</target>
<!-- project configurations (used by self-test and self-doc tasks) -->
<target name="debug" description="Perform a 'debug' build">
<property name="project.config" value="debug" />
<property name="build.debug" value="true" />
<property name="build.dir" value="${project::get-base-directory()}/build/${framework::get-target-framework()}.${platform::get-name()}/${project.name}-${project.config}" />
</target>
<target name="release" description="Perform a 'release' build">
<property name="project.config" value="release" />
<property name="build.debug" value="false" />
<property name="build.dir" value="${project::get-base-directory()}/build/${project.name}" />
</target>
<!-- build tasks -->
<target name="init" description="Initializes build properties">
<call target="${project.config}" />
<call target="set-framework-configuration" />
</target>
<target name="create-common-assemblyinfo" if="${create.assemblyinfo}">
<!-- ensure src/CommonAssemblyInfo.cs is writable if it already exists -->
<attrib file="src/CommonAssemblyInfo.cs" readonly="false" if="${file::exists('src/CommonAssemblyInfo.cs')}" />
<!-- generate the source file holding the common assembly-level attributes -->
<asminfo output="src/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="true" />
<attribute type="AssemblyTitleAttribute" value="NAnt" />
<attribute type="AssemblyDescriptionAttribute" value="A .NET Build Tool" />
<attribute type="AssemblyConfigurationAttribute" value="${project.release.type}" />
<attribute type="AssemblyCompanyAttribute" value="http://nant.sourceforge.net" />
<attribute type="AssemblyProductAttribute" value="NAnt" />
<attribute type="AssemblyCopyrightAttribute" value="Copyright (C) 2001-${datetime::get-year(datetime::now())} Gerry Shaw" />
<attribute type="AssemblyTrademarkAttribute" value="" />
<attribute type="AssemblyCultureAttribute" value="" />
<attribute type="AssemblyVersionAttribute" value="${project.version}.${build.number}.0" />
<attribute type="AssemblyInformationalVersionAttribute" value="${project.version}" />
</attributes>
</asminfo>
</target>
<!-- cleanup -->
<target name="clean" depends="init" description="Deletes current build configuration">
<delete dir="${build.dir}" if="${directory::exists(build.dir)}" />
</target>
<target name="cleanall" description="Deletes every build configuration">
<echo message="Deleting all builds from all configurations" />
<delete dir="build" if="${directory::exists('build')}" />
</target>
<target name="build" depends="init, create-common-assemblyinfo" description="Builds current configuration">
<echo message="Build Directory is ${build.dir}" />
<!-- ensure bin directory exists -->
<mkdir dir="${build.dir}/bin" />
<!-- ensure lib directory exists -->
<mkdir dir="${build.dir}/bin/lib" />
<!-- copy third party executables -->
<copy todir="${build.dir}/bin">
<fileset basedir="bin">
<include name="scvs.exe" />
</fileset>
</copy>
<copy todir="${build.dir}/bin">
<fileset basedir="lib/common/neutral">
<!-- copy log4net assembly, workaround for Mono bug #57602 -->
<include name="log4net.dll" />
<!-- #ziplib command line client -->
<include name="scvs.exe" />
</fileset>
</copy>
<!-- copy third party assemblies -->
<copy todir="${build.dir}/bin/lib">
<fileset basedir="lib">
<include name="**/*" />
<exclude name="common/neutral/log4net.dll" />
<exclude name="common/neutral/scvs.exe" />
</fileset>
</copy>
<!-- build NAnt.Core assembly -->
<nant buildfile="src/NAnt.Core/NAnt.Core.build" target="build" />
<!-- build NAnt.Console assembly -->
<nant buildfile="src/NAnt.Console/NAnt.Console.build" target="build" />
<!-- build extension assemblies -->
<nant target="build">
<buildfiles refid="ext.core" />
</nant>
<!-- build NAnt.MSBuild assembly -->
<nant buildfile="src/NAnt.MSBuild/NAnt.MSBuild.build" target="build" />
<!-- build NDoc.Documenter.NAnt assembly -->
<nant buildfile="src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build" target="build" />
<!-- build NAnt.Core.Tests assembly -->
<nant buildfile="tests/NAnt.Core/NAnt.Core.build" target="build" />
<!-- build NAnt.Console.Tests assembly -->
<nant buildfile="tests/NAnt.Console/NAnt.Console.build" target="build" />
<!-- build tests for extension assemblies -->
<nant target="build">
<buildfiles refid="ext.core.tests"/>
</nant>
</target>
<!-- test the newly built NAnt -->
<target name="test" depends="build" description="Tests current configuration">
<echo message="Running unit tests with just built version of NAnt." />
<exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
<arg value="-targetframework:${framework::get-target-framework()}" />
<arg value="${project.config}" />
<arg value="self-test" />
</exec>
</target>
<target name="test-core" depends="build">
<exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
<arg value="-targetframework:${framework::get-target-framework()}" />
<arg value="${project.config}" />
<arg value="self-test-core" />
</exec>
</target>
<target name="test-dotnet" depends="build">
<exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
<arg value="-targetframework:${framework::get-target-framework()}" />
<arg value="${project.config}" />
<arg value="self-test-dotnet" />
</exec>
</target>
<target name="test-sourcecontrol" depends="build">
<exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
<arg value="-targetframework:${framework::get-target-framework()}" />
<arg value="${project.config}" />
<arg value="self-test-sourcecontrol" />
</exec>
</target>
<target name="test-visualcpp" depends="build">
<exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
<arg value="-targetframework:${framework::get-target-framework()}" />
<arg value="${project.config}" />
<arg value="self-test-visualcpp" />
</exec>
</target>
<target name="test-compression" depends="build">
<exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
<arg value="-targetframework:${framework::get-target-framework()}" />
<arg value="${project.config}" />
<arg value="self-test-compression" />
</exec>
</target>
<target name="prepare-self-test" depends="init">
<copy file="${path::combine(nant::get-base-directory(), 'NAnt.exe.config')}" tofile="${path::combine(nant::get-base-directory(), 'nant.tests.config')}" />
<!-- make sure the config file is writable -->
<attrib file="${path::combine(nant::get-base-directory(), 'nant.tests.config')}" readonly="false" />
<!-- ensure the tests target the current framework -->
<xmlpoke file="${path::combine(nant::get-base-directory(), 'nant.tests.config')}"
xpath="//configuration/nant/frameworks/platform[@name='${platform::get-name()}']/@default"
value="${framework::get-target-framework()}"/>
<!-- output the config file that will be used to run the tests -->
<echo message="testing with config '${path::combine(nant::get-base-directory(), 'nant.tests.config')}'" />
</target>
<target name="self-test-core" depends="prepare-self-test">
<nant target="test">
<buildfiles basedir="tests">
<include name="NAnt.Core/NAnt.Core.build" />
</buildfiles>
</nant>
</target>
<target name="self-test-dotnet" depends="prepare-self-test">
<nant target="test">
<buildfiles basedir="tests">
<include name="NAnt.DotNet/NAnt.DotNet.build" />
</buildfiles>
</nant>
</target>
<target name="self-test-sourcecontrol" depends="prepare-self-test">
<nant target="test">
<buildfiles basedir="tests">
<include name="NAnt.SourceControl/NAnt.SourceControl.build" />
</buildfiles>
</nant>
</target>
<target name="self-test-visualcpp" depends="prepare-self-test">
<nant target="test">
<buildfiles basedir="tests">
<include name="NAnt.VisualCpp/NAnt.VisualCpp.build" />
</buildfiles>
</nant>
</target>
<target name="self-test-compression" depends="prepare-self-test">
<nant target="test">
<buildfiles basedir="tests">
<include name="NAnt.Compression/NAnt.Compression.build" />
</buildfiles>
</nant>
</target>
<target name="self-test" depends="prepare-self-test, test-examples">
<!-- test NAnt.Console assembly -->
<nant buildfile="tests/NAnt.Console/NAnt.Console.build" target="test" />
<!-- test NAnt.Core assembly -->
<nant buildfile="tests/NAnt.Core/NAnt.Core.build" target="test" />
<!-- test extension assemblies -->
<nant target="test">
<buildfiles refid="ext.core.tests" />
</nant>
</target>
<target name="test-examples" depends="init" unless="${framework::get-family(framework::get-target-framework()) == 'mono'}">
<echo message="Examples: Copy local and build."/>
<copy todir="${build.dir}">
<fileset>
<include name="examples/**" />
</fileset>
</copy>
<nant target="build clean">
<buildfiles basedir="${build.dir}/examples">
<include name="examples.build" />
</buildfiles>
</nant>
</target>
<!-- generate user documentation -->
<target name="userdoc" depends="build" description="Builds user documentation">
<echo message="Creating task and type documentation from ${build.dir}/bin" />
<exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-indent:1" />
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
<arg value="-targetframework:${framework::get-target-framework()}" />
<arg value="${project.config}" />
<arg value="self-userdoc" />
</exec>
</target>
<target name="self-userdoc" depends="init">
<!-- use ndoc and NAnt.Documenter to build user doc if they need it -->
<uptodate property="help.uptodate">
<targetfiles>
<include name="${build.dir}/doc/help/*.html" />
</targetfiles>
<sourcefiles basedir="${build.dir}/bin">
<!-- make sure the tasks/types are not new -->
<include name="NAnt.Core.dll" />
<include name="*Tasks.dll" />
<include name="NAnt.NUnit.dll" />
<!-- make sure the documenter is not new -->
<include name="NDoc.Documenter.*.dll" />
</sourcefiles>
</uptodate>
<if test="${not(help.uptodate)}">
<ndoc>
<assemblies basedir="${build.dir}/bin">
<include name="NAnt.Core.dll" />
<include name="*Tasks.dll" />
<include name="NAnt.NUnit.dll" />
<!-- never document NAntContrib as part of NAnt -->
<exclude name="NAnt.Contrib.Tasks.dll" />
</assemblies>
<documenters>
<documenter name="NAnt">
<property name="OutputDirectory" value="${build.dir}/doc/help" />
<property name="SdkDocVersion" value="${link.sdkdoc.version}" />
<property name="SdkLinksOnWeb" value="${link.sdkdoc.web}" />
<!-- set base uri used for linking to other NAnt docs -->
<property name="NAntBaseUri" value="../" />
<!-- do not filter on namespace -->
<property name="NamespaceFilter" value="" />
<!-- set the name and version of the product for which docs are generated -->
<property name="ProductName" value="NAnt" />
<property name="ProductVersion" value="${project.version.full}" />
<property name="ProductUrl" value="http://nant.sourceforge.net" />
<property name="Preliminary" value="${not(project.release.type == 'release')}" />
<property name="DocumentAttributes" value="True" />
<property name="IncludeAssemblyVersion" value="True" />
<property name="ShowMissingParams" value="True" />
<property name="ShowMissingReturns" value="True" />
<property name="ShowMissingValues" value="True" />
</documenter>
</documenters>
</ndoc>
</if>
<!-- copy doc files from source-->
<copy todir="${build.dir}">
<fileset>
<include name="doc/**" />
<exclude name="**/obj/**" />
<exclude name="**/bin/**" />
</fileset>
</copy>
<echo message="User documentation: file://${build.dir}/doc/index.html" />
</target>
<target name="sdkdoc" depends="build" description="Builds SDK documentation">
<echo message="Creating SDK Documentation for ${build.dir}/bin/${nant.console.name}.exe" />
<exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-indent:1" />
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
<arg value="-targetframework:${framework::get-target-framework()}" />
<arg value="${project.config}" />
<arg value="self-sdkdoc" />
</exec>
</target>
<target name="self-sdkdoc" depends="init">
<!-- use ndoc to build sdk doc if they are not uptodate-->
<uptodate property="sdk.uptodate">
<targetfiles>
<include name="${build.dir}/doc/sdk/*.chm" />
</targetfiles>
<sourcefiles basedir="${build.dir}/bin">
<include name="NAnt.Core.dll" />
<include name="*Tasks.dll" />
<include name="NAnt.NUnit.dll" />
<!-- make sure the documenter is not new -->
<include name="NDoc.Documenter.*.dll" />
</sourcefiles>
</uptodate>
<if test="${not(sdk.uptodate)}">
<ndoc>
<assemblies basedir="${build.dir}/bin">
<include name="NAnt.Core.dll" />
<include name="NAnt.*Tasks.dll" />
<include name="NAnt.NUnit.dll" />
</assemblies>
<documenters>
<documenter name="MSDN">
<property name="OutputDirectory" value="${build.dir}/doc/sdk" />
<property name="OutputTarget" value="HtmlHelpAndWeb" />
<property name="SdkDocVersion" value="${link.sdkdoc.version}" />
<property name="SdkLinksOnWeb" value="${link.sdkdoc.web}" />
<property name="HtmlHelpName" value="NAnt-SDK" />
<property name="IncludeFavorites" value="False" />
<property name="Title" value="NAnt SDK Documentation - v${project.version.full}" />
<property name="SplitTOCs" value="False" />
<property name="DefaulTOC" value="" />
<property name="ShowVisualBasic" value="True" />
<property name="Preliminary" value="${not(project.release.type == 'release')}" />
<property name="ShowMissingSummaries" value="${build.debug}" />
<property name="ShowMissingRemarks" value="${build.debug}" />
<property name="ShowMissingParams" value="${build.debug}" />
<property name="ShowMissingReturns" value="${build.debug}" />
<property name="ShowMissingValues" value="${build.debug}" />
<property name="DocumentAttributes" value="True" />
<property name="ShowTypeIdInAttributes" value="False" />
<property name="DocumentInternals" value="False" />
<property name="DocumentPrivates" value="False" />
<property name="DocumentProtected" value="True" />
<property name="DocumentEmptyNamespaces" value="False" />
<property name="IncludeAssemblyVersion" value="False" />
<property name="CopyrightText" value="Copyright (C) 2001-${datetime::get-year(datetime::now())} Gerry Shaw" />
<property name="CopyrightHref" value="http://nant.sourceforge.net" />
<property name="EditorBrowsableFilter" value="Off" />
</documenter>
</documenters>
</ndoc>
</if>
<!-- delete all intermediate build output -->
<delete>
<fileset basedir="${build.dir}/doc/sdk">
<include name="NAnt-SDK.hhc" />
<include name="NAnt-SDK.hhk" />
<include name="NAnt-SDK.hhp" />
<include name="NAnt-SDK.log" />
<!-- temporary directory -->
<include name="ndoc_msdn_temp" />
</fileset>
</delete>
</target>
<target name="self-schema" depends="init">
<property name="schema.output" value="${build.dir}/schema/${project.name}.xsd" />
<!-- ensure schema directory exists -->
<mkdir dir="${build.dir}/schema" />
<!-- determine target namespace -->
<if test="${project.release.type == 'nightly'}">
<property name="schema.ns" value="http://nant.sf.net/${project.release.type + '/' + build.date + '-' + project.version + '/nant.xsd'}" />
</if>
<if test="${project.release.type != 'nightly'}">
<property name="schema.ns" value="http://nant.sf.net/release/${project.version.full}/nant.xsd" />
</if>
<!-- generate schema -->
<nantschema output="${schema.output}" target-ns="${schema.ns}" />
</target>
<target name="schema" depends="build">
<exec program="${build.dir}/bin/${nant.console.name}.exe" managed="true">
<arg value="-buildfile:NAnt.build" />
<arg value="-D:project.version=${project.version}" />
<arg value="-D:project.release.type=${project.release.type}" />
<arg value="-targetframework:${framework::get-target-framework()}" />
<arg value="${project.config}" />
<arg value="self-schema" />
</exec>
</target>
<target name="changelog" depends="init">
<property name="start.date" value="2003/12/26"/>
<property name="now" value="${datetime::now()}"/>
<property name="end.date" value="${datetime::get-year(now)}/${datetime::get-month(now)}/${datetime::get-day(now)}"/>
<property name="changes.name-without-extension" value="changelog_${string::replace(start.date, '/', '-')}_to_${string::replace(end.date, '/', '-')}"/>
<cvs-changelog
start="${start.date}"
end="${end.date}"
xmlfile="${build.dir}/${changes.name-without-extension}.xml"
destination="${project::get-base-directory()}"
module="nant"
/>
<style
style="etc/changelog.xsl"
in="${build.dir}/${changes.name-without-extension}.xml"
out="${build.dir}/${changes.name-without-extension}.html"
>
<parameters>
<parameter name="module" value="nant" />
<parameter name="title" value="NAnt Changelog (${project.version.full})" />
<parameter name="logo" value="doc/logo.gif" />
<parameter name="cvsweb" value="http://cvs.sourceforge.net/viewcvs.py/nant/" />
<parameter name="start-date" value="${start.date}" />
<parameter name="end-date" value="${end.date}" />
</parameters>
</style>
<delete file="${build.dir}/${changes.name-without-extension}.xml" />
</target>
<target name="deploy-schema" depends="schema" description="Deploys the Schema to VS.Net schemas dirs. For now it only copies to 7.0 and 7.1">
<!-- retrieve location of VS.NET 2002 schema store -->
<readregistry property="vs2002.xml.schemas" key="SOFTWARE\Microsoft\VisualStudio\7.0\InstallDir" hive="LocalMachine" failonerror="false" />
<if test="${property::exists('vs2002.xml.schemas')}">
<!-- deploy schema to VS.NET 2002 schema store -->
<copy file="${schema.output}" todir="${vs2002.xml.schemas}..\\Packages\schemas\xml" />
</if>
<!-- retrieve location of VS.NET 2003 schema store -->
<readregistry property="vs2003.xml.schemas" key="SOFTWARE\Microsoft\VisualStudio\7.1\InstallDir" hive="LocalMachine" failonerror="false" />
<if test="${property::exists('vs2003.xml.schemas')}">
<!-- deploy schema to VS.NET 2002 schema store -->
<copy file="${schema.output}" todir="${vs2003.xml.schemas}..\\Packages\schemas\xml" />
</if>
</target>
<target name="package-common" depends="test, userdoc, sdkdoc, schema">
<!-- move config file -->
<move file="${build.dir}/bin/NAnt.exe.config" tofile="${build.dir}/bin/${nant.console.name}.exe.config" />
<!-- remove non-release files -->
<delete>
<fileset basedir="${build.dir}/bin">
<include name="NAnt.Console.*" />
<!-- remove test assemblies -->
<include name="*.Tests.*" />
</fileset>
</delete>
<!-- copy project files -->
<copy todir="${build.dir}">
<fileset>
<include name="*" />
<include name="doc/**" />
<include name="src/**" />
<include name="tests/**" />
<include name="examples/**" />
<include name="schema/**" />
<include name="etc/nant.pc.in" />
<!-- third party assemblies -->
<include name="lib/**" />
<!-- website -->
<include name="web/**" />
<!-- docs -->
<include name="doc/**" />
<!-- exclude static html pages as these will be filter-copied -->
<exclude name="doc/**/*.html" />
<!-- exclude nighlty build file -->
<exclude name="nightly.xml" />
<!-- exclude release build file -->
<exclude name="release.xml" />
<!--exclude VS.Net stuff -->
<exclude name="**/*.suo" />
<exclude name="**/*j.user" />
<exclude name="**/bin/**" />
<exclude name="**/obj/**" />
</fileset>
</copy>
<!-- filter-copy static html pages -->
<copy todir="${build.dir}" overwrite="true">
<fileset>
<include name="doc/**/*.html" />
</fileset>
<filterchain>
<replacetokens>
<token key="PRODUCT_VERSION" value="${project.version.full}" />
</replacetokens>
<!-- when NOT building a release package, add prelimary notice -->
<replacestring
from="&lt;!-- @PRELIMINARY_NOTICE@ -->"
to="&lt;p class=&quot;topicstatus&quot;>[This is preliminary documentation and subject to change.]&lt;/p>"
unless="${project.release.type == 'release'}"
/>
<!-- when building a release package, remove the placeholder -->
<replacestring
from="&lt;!-- @PRELIMINARY_NOTICE@ -->"
to=""
if="${project.release.type == 'release'}"
/>
</filterchain>
</copy>
<!-- determine the zip file prefix directory -->
<property name="project.zip.prefix" value="${project.name}-${project.version.full}" />
</target>
<!-- creates tar for distributing the user manual and SDK to SourceForge -->
<target name="package-doc" depends="package-common">
<!-- determine name of temporary doc distribution -->
<property name="project.gzip-path.doc" value="${project::get-base-directory()}/build/${project.name}-${project.version.full}-doc.tar.gz" />
<!-- remove package gzip file if it already exists -->
<delete file="${project.gzip-path.doc}" if="${file::exists(project.gzip-path.doc)}" />
<!-- create package gzip file -->
<tar destfile="${project.gzip-path.doc}" compression="GZip">
<fileset basedir="${build.dir}/doc">
<include name="help/**/*" />
</fileset>
</tar>
<echo message="Created '${project.config}' doc package at file://${project::get-base-directory()}/build/" />
</target>
<target name="package-src" depends="package-common">
<!-- determine name of source zip distribution -->
<property name="project.zip-path.src" value="${project::get-base-directory()}/build/${project.name}-${project.version.full}-src.zip" />
<!-- remove package zip file if it already exists -->
<delete file="${project.zip-path.src}" if="${file::exists(project.zip-path.src)}" />
<!-- create package zip file -->
<zip zipfile="${project.zip-path.src}" ziplevel="9">
<fileset basedir="${build.dir}" prefix="${project.zip.prefix}">
<include name="Makefile" />
<include name="Makefile.nmake" />
<include name="NAnt.build" />
<include name="NAnt.sln" />
<include name="COPYING.txt" />
<include name="README.txt" />
<include name="etc/nant.pc.in" />
<!-- third party assemblies -->
<include name="lib/**/*" />
<!-- license & release notes -->
<include name="doc/*" />
<!-- user manual (no SDK) -->
<include name="doc/help/**" />
<!-- examples -->
<include name="examples/**/*" />
<!-- sources -->
<include name="src/**/*" />
<!-- unit tests -->
<include name="tests/**/*" />
</fileset>
</zip>
<!-- determine name of source gzipped tar distribution -->
<property name="project.gzip-path.src" value="${project::get-base-directory()}/build/${project.name}-${project.version.full}-src.tar.gz" />
<!-- remove package gzip file if it already exists -->
<delete file="${project.gzip-path.src}" if="${file::exists(project.gzip-path.src)}" />
<!-- create package gzip file -->
<tar destfile="${project.gzip-path.src}" compression="GZip">
<fileset basedir="${build.dir}" prefix="${project.zip.prefix}">
<include name="Makefile" />
<include name="Makefile.nmake" />
<include name="NAnt.build" />
<include name="NAnt.sln" />
<include name="COPYING.txt" />
<include name="README.txt" />
<include name="etc/nant.pc.in" />
<!-- third party assemblies -->
<include name="lib/**/*" />
<!-- license & release notes -->
<include name="doc/*" />
<!-- user manual (no SDK) -->
<include name="doc/help/**" />
<!-- examples -->
<include name="examples/**/*" />
<!-- sources -->
<include name="src/**/*" />
<!-- unit tests -->
<include name="tests/**/*" />
</fileset>
</tar>
<echo message="Created '${project.config}' source packages at file://${project::get-base-directory()}/build/" />
</target>
<target name="package-bin" depends="package-common">
<!-- determine name of binary zip distribution -->
<property name="project.zip-path.bin" value="${project::get-base-directory()}/build/${project.name}-${project.version.full}-bin.zip" />
<!-- remove package zip file if it already exists -->
<delete file="${project.zip-path.bin}" if="${file::exists(project.zip-path.bin)}" />
<!-- create package zip file -->
<zip zipfile="${project.zip-path.bin}" ziplevel="9">
<fileset basedir="${build.dir}" prefix="${project.zip.prefix}">
<include name="COPYING.txt" />
<include name="README.txt" />
<include name="bin/**/*" />
<!-- license & release notes -->
<include name="doc/*" />
<!-- user manual -->
<include name="doc/help/**" />
<!-- SDK (in HTML Help format) -->
<include name="doc/sdk/NAnt-SDK.chm" />
<!-- examples -->
<include name="examples/**/*" />
<!-- XML Schema -->
<include name="schema/**/*" />
</fileset>
</zip>
<!-- determine name of binary gzipped tar distribution -->
<property name="project.gzip-path.bin" value="${project::get-base-directory()}/build/${project.name}-${project.version.full}-bin.tar.gz" />
<!-- remove package gzip file if it already exists -->
<delete file="${project.gzip-path.bin}" if="${file::exists(project.gzip-path.bin)}" />
<!-- create package gzip file -->
<tar destfile="${project.gzip-path.bin}" compression="GZip">
<fileset basedir="${build.dir}" prefix="${project.zip.prefix}">
<include name="COPYING.txt" />
<include name="README.txt" />
<include name="bin/**/*" />
<!-- license & release notes -->
<include name="doc/*" />
<!-- user manual -->
<include name="doc/help/**" />
<!-- SDK (in plain HTML format) -->
<include name="doc/sdk/*" />
<exclude name="doc/sdk/NAnt-SDK.chm" />
<!-- examples -->
<include name="examples/**/*" />
<!-- XML Schema -->
<include name="schema/**/*" />
</fileset>
</tar>
<echo message="Created '${project.config}' binary packages at file://${project.zip-path.bin}" />
</target>
<target name="package" depends="package-doc, package-src, package-bin" description="Creates a binary and source distribution package." />
<!-- Copies files to the bin folder. -->
<target name="UpdateBin" depends="build" description="Does a release build and copies them to the bin folder.">
<delete if="false">
<fileset basedir="bin">
<include name="NAnt*" />
<exclude name="${nant.console.name}.exe" />
</fileset>
</delete>
<copy todir="bin" overwrite="true">
<fileset basedir="${build.dir}/bin/">
<include name="NAnt*" />
<exclude name="*Test*" />
<exclude name="${nant.console.name}.xml" />
<exclude name="${nant.console.name}.exe" />
</fileset>
</copy>
</target>
<!-- Framework support targets -->
<target name="set-framework-configuration">
<if test="${not(target::exists('set-'+framework::get-target-framework()+'-framework-configuration'))}">
<fail message="The '${framework::get-target-framework()}' framework is not supported by this version of NAnt." />
</if>
<call target="set-${framework::get-target-framework()}-framework-configuration" />
</target>
<target name="set-net-2.0-framework-configuration">
<property name="nant.settings.currentframework" value="net-2.0" />
<property name="current.build.defines" value="${build.defines}NET,NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" dynamic="true" />
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="link.sdkdoc.web" value="true" />
</target>
<target name="set-net-3.5-framework-configuration">
<property name="nant.settings.currentframework" value="net-3.5" />
<property name="current.build.defines" value="${build.defines}NET,NET_1_0,NET_1_1,NET_2_0,NET_3_5,ONLY_3_5" dynamic="true" />
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="link.sdkdoc.web" value="true" />
</target>
<target name="set-net-4.0-framework-configuration">
<property name="nant.settings.currentframework" value="net-4.0" />
<property name="current.build.defines" value="${build.defines}NET,NET_1_0,NET_1_1,NET_2_0,NET_3_5,NET_4_0,ONLY_4_0" dynamic="true" />
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="link.sdkdoc.web" value="true" />
</target>
<target name="set-mono-2.0-framework-configuration">
<property name="nant.settings.currentframework" value="mono-2.0" />
<property name="current.build.defines" value="${build.defines}MONO,NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" dynamic="true" />
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="link.sdkdoc.web" value="true" />
</target>
<target name="set-mono-3.5-framework-configuration">
<property name="nant.settings.currentframework" value="mono-3.5" />
<property name="current.build.defines" value="${build.defines}MONO,NET_1_0,NET_1_1,NET_2_0,NET_3_5,ONLY_3_5" dynamic="true" />
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="link.sdkdoc.web" value="true" />
</target>
<target name="set-mono-4.0-framework-configuration">
<property name="nant.settings.currentframework" value="mono-4.0" />
<property name="current.build.defines" value="${build.defines}MONO,NET_1_0,NET_1_1,NET_2_0,NET_3_5,NET_4_0,ONLY_4_0" dynamic="true" />
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="link.sdkdoc.web" value="true" />
</target>
<!-- install targets -->
<target name="install" depends="install-windows, install-linux" />
<target name="install-windows" depends="build" if="${platform::is-windows()}">
<!-- Make sure that the docs are only built/installed when needed -->
<call target="userdoc" cascade="false" />
<!-- install to program files directory by default -->
<property name="install.prefix" value="${environment::get-folder-path('ProgramFiles')}" />
<if test="${property::exists('prefix') and string::get-length(prefix) != 0}">
<property name="install.prefix" value="${prefix}" />
</if>
<property name="install.nant" value="${path::combine(install.prefix, 'NAnt')}" />
<!-- support staged installs -->
<property name="install.destdir" value="" />
<if test="${property::exists('destdir') and string::get-length(destdir) != 0}">
<property name="install.destdir" value="${destdir}" />
</if>
<property name="install.copylocation" value="${install.destdir + install.nant}" />
<!-- perform (staged) install -->
<echo message="Installing NAnt to '${install.copylocation}' ..." />
<copy todir="${install.copylocation}" overwrite="true">
<fileset basedir="${build.dir}">
<include name="bin/**/*" />
<include name="doc/**/*" />
<exclude name="bin/nant.tests.config" />
<exclude name="bin/*.Tests.*" />
</fileset>
</copy>
</target>
<target name="install-linux" depends="build" if="${platform::is-unix()}">
<property name="install.prefix" value="/usr/local" />
<if test="${property::exists('prefix') and string::get-length(prefix) != 0}">
<property name="install.prefix" value="${prefix}" />
</if>
<property name="install.share" value="${path::combine(install.prefix, 'share')}" />
<property name="install.nant" value="${path::combine (install.share, 'NAnt')}" />
<!-- support staged installs -->
<property name="install.destdir" value="" />
<if test="${property::exists('destdir') and string::get-length(destdir) != 0}">
<property name="install.destdir" value="${destdir}" />
</if>
<property name="install.docdir" value="${install.destdir + path::combine(path::combine(install.share, 'doc'), 'NAnt')}" />
<if test="${property::exists('doc.prefix') and string::get-length(doc.prefix) != 0}">
<property name="install.docdir" value="${install.destdir + path::combine(doc.prefix, 'NAnt')}" />
</if>
<property name="install.bindir" value="${install.destdir + path::combine(install.prefix, 'bin')}" />
<property name="install.pkgconfigdir" value="${install.destdir + path::combine(install.prefix, 'lib/pkgconfig')}" />
<property name="install.copylocation" value="${install.destdir + install.nant}" />
<!-- perform (staged) install -->
<echo message="Installing NAnt to '${install.copylocation}' ..." />
<copy todir="${install.copylocation}" overwrite="true">
<fileset basedir="${build.dir}">
<include name="bin/**/*" />
<exclude name="bin/nant.tests.config" />
<exclude name="bin/*.Tests.*" />
</fileset>
</copy>
<echo message="Installing NAnt Docs to '${install.docdir}' ..." />
<mkdir dir="${install.docdir}" />
<copy todir="${install.docdir}" overwrite="true">
<fileset basedir="./doc">
<include name="**/*" />
</fileset>
</copy>
<mkdir dir="${install.pkgconfigdir}" />
<copy file="etc/nant.pc.in" tofile="${install.pkgconfigdir}/nant.pc">
<filterchain>
<replacetokens>
<token key="VERSION" value="${project.version}" />
</replacetokens>
</filterchain>
</copy>
<!-- create wrapper script -->
<echo message="Installing NAnt wrapper script to '${install.bindir}' ..." />
<property name="wrapper" value="${path::combine(install.bindir, 'nant')}" />
<!--
create wrapper file using separate echo tasks for each line to ensure
the line endings of the generated file match the platform on which
the wrapper is created
-->
<echo file="${wrapper}" append="false">#!/bin/sh${environment::newline()}</echo>
<echo file="${wrapper}" append="true">exec ${path::combine(install.prefix, 'bin')}/mono ${path::combine(install.nant, 'bin')}/NAnt.exe "$@"</echo>
<exec program="chmod" commandline="a+x ${path::combine(install.bindir, 'nant')}" />
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.