<?xml version="1.0" ?>
<project name="nant" default="test">
<echo message="Using '${nant.settings.currentframework}' framework on '${nant.platform.name}' platform."/>
<!-- global project settings --> <property name="project.name" value="nant" /> <property name="project.version" value="0.84" overwrite="false" />
<!-- default configuration --> <property name="project.config" value="debug" /> <!-- debug|release --> <property name="nant.console.name" value="NAnt" /> <property name="build.defines" value="" />
<!-- platform specific properties. These are the defaults -->
<property name="current.build.defines" value="${build.defines}" />
<!-- Win32TaskAssemblies (tas.win32) -->
<!-- These will be used in this order -->
<property name="tas.win32" value="NAnt.Win32,NAnt.VisualCpp,NAnt.VSNet" />
<property name="tas.win32.tests" value="${tas.win32}" />
<!-- CoreTaskAssemblies (tas.core) -->
<!-- These will be used in this order -->
<property name="tas.core" value="NAnt.DotNet,NAnt.Zip,NAnt.NUnit,NAnt.SourceControl" />
<property name="tas.core.tests" value="NAnt.DotNet,NAnt.Zip" /> <!-- exclude the nunit and sourcecontrol assemblies -->
<!-- named 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="${nant.project.basedir}/build/${nant.settings.currentframework}.${nant.platform.name}/${project.name}-${project.version}-${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="${nant.project.basedir}/build/${project.name}-${project.version}" />
</target>
<!-- build tasks -->
<target name="init" description="Initializes build properties">
<call target="${project.config}" />
<call target="set-runtime-configuration" />
</target>
<target name="clean" depends="init" description="Deletes current build configuration">
<delete dir="${build.dir}" failonerror="false" />
</target>
<target name="cleanall" description="Deletes every build configuration">
<echo message="Deleting all builds from all configurations" />
<delete dir="build" failonerror="false" />
</target>
<target name="build" depends="init" description="Builds current configuration">
<echo message="Build Directory is ${build.dir}" />
<!-- prepare build directory -->
<mkdir dir="${build.dir}/bin" />
<!-- copy framework-neutral libraries --> <copy todir="${build.dir}/bin"> <fileset basedir="lib"> <includes name="NUnitCore.dll" /> <includes name="ICSharpCode.SharpZipLib.dll" /> <includes name="ICSharpCode.SharpCvsLib.dll" /> </fileset> </copy>
<!-- copy framework-specific libraries --> <copy todir="${build.dir}/bin"> <fileset basedir="${lib.dir}"> <includes name="NDoc.Core.dll" /> <includes name="NDoc.Documenter.*.dll" /> <includes name="nunit.framework.dll" /> <includes name="log4net.dll"/> </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 task assemblies -->
<foreach item="String" delim="," property="filename" in="${tas.core}">
<nant buildfile="src/${filename}/${filename}.build" target="build" />
</foreach>
<!-- build win32 specific task assemblies if we are on win32 -->
<foreach item="String" delim="," property="filename" in="${tas.win32}">
<nant buildfile="src/${filename}/${filename}.build" target="build" if="${nant.platform.win32}" />
</foreach>
<!-- 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 task assemblies -->
<foreach item="String" delim="," property="filename" in="${tas.core.tests}">
<nant buildfile="tests/${filename}/${filename}.build" target="build" />
</foreach>
<!-- build tests for win32 specific task assemblies if we are on win32 -->
<foreach item="String" delim="," property="filename" in="${tas.win32.tests}">
<nant buildfile="tests/${filename}/${filename}.build" target="build" if="${nant.platform.win32}" />
</foreach>
</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" useruntimeengine="true">
<arg value="-buildfile:NAnt.build" />
<arg value="${project.config}" />
<arg value="self-test" />
<arg value="-D:project.version=${project.version}" />
<arg value="-k:${nant.settings.currentframework}" />
</exec>
</target>
<target name="self-test" depends="init">
<copy file="${nant.location}NAnt.exe.config" tofile="${nant.location}nant.tests.config" />
<!-- make sure the config file is writable -->
<attrib file="${nant.location}nant.tests.config" readonly="false" />
<!-- ensure the tests target the current framework -->
<xmlpoke file="${nant.location}nant.tests.config"
xpath="//configuration/nant/frameworks/[EMAIL PROTECTED]'${nant.platform.name}']/@default"
value="${nant.settings.currentframework}"/>
<!-- output the config file that will be used to run the tests -->
<echo message="testing with config '${nant.location}nant.tests.config'"/>
<!-- 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 task assemblies -->
<foreach item="String" delim="," property="filename" in="${tas.core.tests}">
<nant buildfile="tests/${filename}/${filename}.build" target="test" />
</foreach>
<!-- test win32 specific task assemblies -->
<foreach item="String" delim="," property="filename" in="${tas.win32.tests}">
<nant buildfile="tests/${filename}/${filename}.build" target="test" if="${nant.platform.win32}" />
</foreach>
</target>
<target name="userdoc" depends="build" description="Builds user documentation">
<!-- build the documenter -->
<csc target="library" define="${current.build.defines}" warnaserror="true" nowarn="0618" debug="${build.debug}" output="${build.dir}/bin/NDoc.Documenter.NAnt.dll">
<sources failonempty="true">
<includes name="src/NDoc.Documenter.NAnt/*.cs" />
<!-- common assembly-level attributes -->
<includes name="src/CommonAssemblyInfo.cs" />
</sources>
<references failonempty="true">
<includes name="${build.dir}/bin/NAnt.Core.dll" />
<includes name="${build.dir}/bin/NDoc.Core.dll" />
</references>
<resources basedir="src/NDoc.Documenter.NAnt/Resources" prefix="Documenter.xslt.">
<includes name="**/*" />
</resources>
</csc>
<echo message="Creating task and type documentation from ${build.dir}/bin" />
<exec program="${build.dir}/bin/${nant.console.name}.exe" useruntimeengine="true">
<arg value="-indent:1" />
<arg value="-buildfile:NAnt.build" />
<arg value="${project.config}" />
<arg value="self-userdoc" />
<arg value="-D:project.version=${project.version}" />
<arg value="-k:${nant.settings.currentframework}" />
</exec>
</target>
<target name="self-userdoc" depends="init">
<!-- use ndoc and NAnt.Documenter to build user doc if they need it -->
<ifnot uptodatefile="${build.dir}/doc/help/*.html">
<comparefiles basedir="${build.dir}/bin">
<!-- make sure the tasks/types are not new -->
<includes name="NAnt.Core.dll" />
<includes name="*Tasks.dll" />
<includes name="NAnt.NUnit.dll" />
<!-- make sure the documenter is not new -->
<includes name="NDoc.Documenter.*.dll"/>
</comparefiles>
<!--
<ndoc>
<assemblies basedir="${build.dir}/bin">
<includes name="NAnt.Core.dll" />
</assemblies>
<documenters>
<documenter name="XML">
<property name="OutputFile" value="${build.dir}/doc/nantdoc.raw.xml" />
<property name="LinkToSdkDocVersion" value="${link.sdkdoc.version}" />
<property name="DocumentAttributes" value="True" />
<property name="IncludeAssemblyVersion" value="True" />
</documenter>
</documenters>
</ndoc>
-->
<ndoc>
<assemblies basedir="${build.dir}/bin">
<includes name="NAnt.Core.dll" />
<includes name="*Tasks.dll" />
<includes name="NAnt.NUnit.dll" />
</assemblies>
<documenters>
<documenter name="NAntTask">
<property name="OutputDirectory" value="${build.dir}/doc/help" />
<property name="LinkToSdkDocVersion" value="${link.sdkdoc.version}" />
<property name="DocumentAttributes" value="True" />
<property name="IncludeAssemblyVersion" value="True" />
</documenter>
</documenters>
</ndoc>
</ifnot>
<!-- copy doc files from source-->
<copy todir="${build.dir}" failonerror="false">
<fileset>
<includes name="doc/**" />
<excludes name="**/obj/**"/>
<excludes 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" useruntimeengine="true">
<arg value="-indent:1" />
<arg value="-buildfile:NAnt.build" />
<arg value="${project.config}" />
<arg value="self-sdkdoc" />
<arg value="-D:project.version=${project.version}" />
<arg value="-k:${nant.settings.currentframework}" />
</exec>
<!-- delete everything but the .chm --> <delete> <fileset basedir="${build.dir}/doc/sdk"> <includes name="**/*" /> <excludes name="NAnt-SDK.chm" /> </fileset> </delete> </target>
<target name="self-sdkdoc" depends="init">
<!-- use ndoc to build sdk doc if they are not uptodate-->
<ifnot uptodatefile="${build.dir}/doc/sdk/*.chm">
<comparefiles basedir="${build.dir}/bin">
<includes name="NAnt.Core.dll" />
<includes name="*Tasks.dll" />
<includes name="NAnt.NUnit.dll" />
</comparefiles>
<ndoc>
<assemblies basedir="${build.dir}/bin">
<includes name="NAnt.Core.dll" />
<includes name="NAnt.*Tasks.dll" />
<includes name="NAnt.NUnit.dll" />
</assemblies>
<documenters>
<documenter name="MSDN">
<property name="OutputDirectory" value="${build.dir}/doc/sdk" />
<property name="OutputTarget" value="HtmlHelp" />
<property name="LinkToSdkDocVersion" value="${link.sdkdoc.version}" />
<property name="HtmlHelpName" value="NAnt-SDK" />
<property name="IncludeFavorites" value="False" />
<property name="Title" value="NAnt SDK Documentation - v.${project.version}" />
<property name="SplitTOCs" value="False" />
<property name="DefaulTOC" value="" />
<property name="ShowVisualBasic" value="True" />
<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="True" />
<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-2003 Gerry Shaw" />
<property name="CopyrightHref" value="http://nant.sourceforge.net" />
<property name="EditorBrowsableFilter" value="Off" />
</documenter>
</documenters>
</ndoc>
</ifnot>
</target>
<target name="schema" depends="init">
<property name="schema.output" value="${build.dir}/schema/${project.name}-${project.version}.xsd"/>
<!-- generate schema -->
<mkdir dir="${build.dir}/schema"/>
<nantschema output="${schema.output}" target-ns="http://nant.sf.net/schemas/${project.name}-${project.version}.${nant.platform.name}.${nant.settings.currentframework}.xsd"/>
</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 propertyexists="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 propertyexists="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" depends="test userdoc sdkdoc" description="Creates a package zip file.">
<exec program="${build.dir}/bin/${nant.console.name}.exe" useruntimeengine="true">
<arg value="-buildfile:NAnt.build" />
<arg value="${project.config}" />
<arg value="schema" />
<arg value="-D:project.version=${project.version}" />
<arg value="-k:${nant.settings.currentframework}" />
</exec>
<!-- 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"> <includes name="NAnt.Console.*" /> <!-- remove test assemblies --> <includes name="*.Tests.*" /> </fileset> </delete>
<!-- copy project files --> <copy todir="${build.dir}"> <fileset> <includes name="doc/**" /> <includes name="src/**" /> <includes name="tests/**" /> <includes name="examples/**" /> <includes name="schema/**" /> <includes name="*" />
<!-- exclude nighlty build file --> <excludes name="nightly.xml" /> <!-- exclude release build file --> <excludes name="release.xml" /> <!--exclude VS.Net stuff --> <excludes name="**/*.suo" /> <excludes name="**/*j.user" /> <excludes name="**/bin/**" /> <excludes name="**/obj/**" /> </fileset> </copy>
<!-- copy third-party libraries --> <mkdir dir="${build.dir}/lib" /> <copy todir="${build.dir}/lib"> <fileset basedir="lib"> <includes name="**/NDoc.Core.dll" /> <includes name="**/NDoc.Core.xml" /> <includes name="**/NDoc.Documenter.*.dll" /> <includes name="**/NDoc.Documenter.*.xml" /> <includes name="**/nunit.framework.dll" /> <includes name="**/NUnitCore.dll" /> <includes name="**/ICSharpCode.SharpZipLib.dll" /> <includes name="**/ICSharpCode.SharpCvsLib.dll" /> <includes name="**/log4net.dll"/> <includes name="**/log4net.xml"/> </fileset> </copy>
<!-- create zip file -->
<property name="project.zip-path" value="${nant.project.basedir}/build/${project.name}-${project.version}.zip" />
<zip zipfile="${project.zip-path}">
<fileset basedir="${build.dir}">
<includes name="**/*" />
<excludes name="**/cache/**"/>
<excludes name="**/_*/**"/>
</fileset>
</zip>
<echo message="Created a '${project.config}' package at file://${project.zip-path}" />
</target>
<!-- 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">
<includes name="NAnt*" />
<excludes name="${nant.console.name}.exe" /> </fileset> </delete> <copy todir="bin" overwrite="true"> <fileset basedir="${build.dir}/bin/"> <includes name="NAnt*" />
<excludes name="*Test*" />
<excludes name="${nant.console.name}.xml" />
<excludes name="${nant.console.name}.exe" />
</fileset>
</copy>
</target>
<!-- Framework support targets -->
<target name="set-runtime-configuration-flags">
<property name="current.runtime.config.net" value="true" />
<property name="current.runtime.config.netcf" value="false" />
<property name="current.runtime.config.mono" value="false" />
<property name="current.runtime.config.sscli" value="false" />
<property name="current.runtime.config.${current.runtime.config}" value="true" />
<property name="current.runtime.net-1.0" value="false" />
<property name="current.runtime.net-1.1" value="true" />
<property name="current.runtime.net-1.2" value="false" />
<property name="current.runtime.netcf-1.0" value="false" />
<property name="current.runtime.mono-1.0" value="false" />
<property name="current.runtime.sscli-1.0" value="false" />
<property name="current.runtime.${current.runtime.config}-${current.runtime.version}" value="true" />
</target>
<target name="set-runtime-configuration">
<ifnot propertyexists="current.runtime.config">
<ifnot propertyexists="nant.settings.currentframework">
<fail message="No runtime configuration was specified and the default NAnt runtime is not available." />
</ifnot>
<ifnot targetexists="set-${nant.settings.currentframework}-runtime-configuration">
<fail message="No runtime configuration was specified and the current runtime (${nant.settings.currentframework}) is not supported by NAnt." />
</ifnot>
<call target="set-${nant.settings.currentframework}-runtime-configuration"/>
</ifnot>
<ifnot propertyexists="current.runtime.version">
<ifnot propertyexists="nant.settings.currentframework">
<fail message="No runtime configuration was specified and the default NAnt runtime is not available." />
</ifnot>
<ifnot targetexists="set-${nant.settings.currentframework}-runtime-configuration">
<fail message="No runtime configuration was specified and the current runtime (${nant.settings.currentframework}) is not supported by NDoc." />
</ifnot>
<call target="set-${nant.settings.currentframework}-runtime-configuration" />
</ifnot>
<ifnot targetexists="set-${current.runtime.config}-${current.runtime.version}-runtime-configuration">
<fail message="The ${current.runtime.config}-${current.runtime.version} runtime is not supported by NDoc." />
</ifnot>
<call target="set-${current.runtime.config}-${current.runtime.version}-runtime-configuration"/>
</target>
<target name="set-net-1.0-runtime-configuration">
<property name="current.runtime.config" value="net" />
<property name="current.runtime.version" value="1.0" />
<property name="current.runtime.description" value="Microsoft .NET Framework 1.0" />
<property name="current.build.defines" value="${build.defines}NET,NET_1_0" />
<property name="link.sdkdoc.version" value="SDK_v1_0" />
<property name="lib.dir" value="lib/${current.runtime.config}/${current.runtime.version}" />
<property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" />
<call target="set-runtime-configuration-flags"/>
</target>
<target name="set-net-1.1-runtime-configuration">
<property name="current.runtime.config" value="net" />
<property name="current.runtime.version" value="1.1" />
<property name="current.runtime.description" value="Microsoft .NET Framework 1.1" />
<property name="current.build.defines" value="${build.defines}NET,NET_1_1" />
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="lib.dir" value="lib/${current.runtime.config}/${current.runtime.version}" /> <property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" />
<call target="set-runtime-configuration-flags" />
</target>
<target name="set-net-1.2-runtime-configuration">
<property name="current.runtime.config" value="net" />
<property name="current.runtime.version" value="1.2" />
<property name="current.runtime.description" value="Microsoft .NET Framework 1.2" />
<property name="current.build.defines" value="${build.defines}NET,NET_1_2" />
<property name="link.sdkdoc.version" value="MsdnOnline" />
<property name="lib.dir" value="lib/${current.runtime.config}/${current.runtime.version}" /> <property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" />
<call target="set-runtime-configuration-flags" />
</target>
<target name="set-netcf-1.0-runtime-configuration">
<property name="current.runtime.config" value="netcf" />
<property name="current.runtime.version" value="1.0" />
<property name="current.runtime.description" value="Microsoft .NET Compact Framework 1.0" />
<property name="current.build.defines" value="${build.defines}NETCF,NETCF_1_0" />
<property name="link.sdkdoc.version" value="SDK_v1_1" />
<property name="lib.dir" value="lib/${current.runtime.config}/${current.runtime.version}" />
<property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" />
<call target="set-runtime-configuration-flags" />
</target>
<target name="set-mono-1.0-runtime-configuration">
<property name="current.runtime.config" value="mono" />
<property name="current.runtime.version" value="1.0" />
<property name="current.runtime.description" value="Mono 1.0" />
<property name="current.build.defines" value="${build.defines}MONO,MONO_1_0" />
<property name="link.sdkdoc.version" value="MsdnOnline" />
<property name="lib.dir" value="lib/${current.runtime.config}/${current.runtime.version}" />
<property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" />
<call target="set-runtime-configuration-flags" />
</target>
<target name="set-sscli-1.0-runtime-configuration">
<property name="current.runtime.config" value="sscli" />
<property name="current.runtime.version" value="1.0" />
<property name="current.runtime.description" value="Microsoft Shared Source CLI 1.0" />
<property name="current.build.defines" value="${build.defines}SSCLI,SSCLI_1_0" />
<property name="link.sdkdoc.version" value="MsdnOnline" />
<property name="lib.dir" value="lib/${current.runtime.config}/${current.runtime.version}" />
<property name="nant.settings.currentframework" value="${current.runtime.config}-${current.runtime.version}" />
<call target="set-runtime-configuration-flags" />
</target>
</project>
--
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users