📄 nunit.build
字号:
<exec basedir="${build.dir}/bin"
workingdir="${build.dir}/bin"
program="nunit-console.exe"
useruntimeengine="true"
commandline="nunit.tests.dll" />
</target>
<target name="nunit2-test"
description="Run tests for a build using console runner">
<echo message="*"/>
<echo message="* Starting ${runtime.config} ${runtime.version} ${build.config} test run"/>
<echo message="*"/>
<nunit2>
<formatter type="Plain"/>
<test assemblyname="${build.dir}/bin/nunit.tests.dll"/>
</nunit2>
</target>
<target name="timing-test" depends="build"
description="Run timing tests (long)">
<echo message="*"/>
<echo message="* Starting ${runtime.config} ${runtime.version} ${build.config} timing tests"/>
<echo message="*"/>
<echo message="* WARNING: Test may take some time to run"/>
<echo message="*"/>
<exec basedir="${build.dir}/bin" workingdir="${build.dir}/bin" program="nunit-console.exe" commandline="timing-tests.dll"/>
</target>
<target name="gui-test" depends="build"
description="Run tests for a build using gui runner">
<ifnot test="${nant.platform.win32}">
<fail message="NUnit-gui is only available on Win32"/>
</ifnot>
<ifnot test="${build.win32}">
<fail message="NUnit-gui is only available for Win32"/>
</ifnot>
<echo message="*"/>
<echo message="* Starting ${runtime.config} ${runtime.version} ${build.config} gui test run"/>
<echo message="*"/>
<exec basedir="${build.dir}/bin" workingdir="${build.dir}/bin" program="nunit-gui.exe" commandline="nunit.tests.dll"/>
</target>
<!-- Targets for packaging the NUnit distribution -->
<target name="package-zip" depends="set-package-config" description="Create distribution package">
<!-- Perform a build -->
<call target="build"/>
<!-- Copy top level files -->
<copy file="nunit-gui/logo.ico" tofile="${build.dir}/logo.ico"/>
<copy file="license.rtf" tofile="${build.dir}/license.rtf"/>
<!-- Copy source files that build doesn't copy -->
<copy todir="${build.dir}/src">
<fileset basedir=".">
<include name="nunit.build"/>
<include name="nunit.sln"/>
<include name="nunit.key"/>
<include name="nunit20under21.config"/>
<include name="install/install.vdproj"/>
</fileset>
</copy>
<!-- Samples are not built, so let them copy themselves -->
<nant buildfile="samples/samples.build" target="copy-all"/>
<!-- Copy docs -->
<call target="copy-docs"/>
<!-- Remove any temporary output files produced by tests
from the build directory - temporary fix -->
<delete>
<fileset>
<include name="temp*.xml"/>
</fileset>
</delete>
<!-- Re-copy everything to our package dir - this is so
we get a single top level directory called NUNit-x.x.x -->
<call target="clean-package-dir"/>
<mkdir dir="${package.dir}"/>
<copy todir="${package.dir}">
<fileset basedir="${build.dir}">
<include name="**"/>
</fileset>
</copy>
<!-- Create the zip file -->
<zip zipfile="${project.package.dir}/${zip.file.name}" ziplevel="9">
<fileset basedir="${package.dir}">
<include name="**"/>
</fileset>
</zip>
</target>
<target name="package-src" depends="clean-package-dir"
description="Create full source package for developer use">
<!-- Get source files into the package dir directly -->
<property name="src.dir" value="${package.dir}"/>
<mkdir dir="${src.dir}"/>
<call target="copy-src"/>
<!-- Get docs into the doc subdirectory of the package dir -->
<property name="doc.dir" value="${package.dir}/doc"/>
<call target="copy-docs"/>
<!-- Create the zip file -->
<zip zipfile="${project.package.dir}/${zipped.src.file.name}" ziplevel="9">
<fileset basedir="${package.dir}">
<include name="**"/>
</fileset>
</zip>
</target>
<target name="package-msi" depends="build-msi,set-package-config"
description="Build msi file and deploy it to the package dir">
<copy file="install\${build.config}\${msi.file.name}" tofile="${project.package.dir}/${msi.file.name}"/>
</target>
<target name="copy-docs">
<mkdir dir="${doc.dir}"/>
<copy todir="${doc.dir}">
<fileset basedir="doc">
<include name="ReleaseNotes.txt"/>
<include name="ChangeLog.txt"/>
<include name="*.html"/>
<include name="css/*"/>
<include name="files/*"/>
<exclude name="files/Supplement.doc"/>
<include name="img/*"/>
</fileset>
</copy>
</target>
<target name="copy-src">
<mkdir dir="${src.dir}"/>
<!-- Copy top level src files and install project -->
<copy todir="${src.dir}">
<fileset basedir=".">
<include name="license.rtf"/>
<include name="nunit.build"/>
<include name="nunit.sln"/>
<include name="nunit.key"/>
<include name="nunit20under22.config"/>
<include name="nunit21under22.config"/>
<include name="install/install.vdproj"/>
</fileset>
</copy>
<!-- Copy individual projects -->
<nant buildfile="framework\nunit.framework.build" target="copy"/>
<nant buildfile="core\nunit.core.build" target="copy"/>
<nant buildfile="extensions\nunit.extensions.build" target="copy"/>
<nant buildfile="util\nunit.util.build" target="copy"/>
<nant buildfile="nunit-console\nunit-console.build" target="copy"/>
<nant buildfile="mocks\nunit.mocks.build" target="copy"/>
<nant buildfile="samples\samples.build" target="copy-all"/>
<!-- Copy win32-only projects -->
<if test="${build.win32}">
<nant buildfile="uikit\nunit.uikit.build" target="copy"/>
<nant buildfile="nunit-gui\nunit-gui.build" target="copy"/>
</if>
<nant buildfile="tests\tests.build" target="copy-all"/>
</target>
<!-- Register core and framework in the gac -->
<target name="add-to-gac" depends="build">
<exec program="${nant.settings.currentframework.sdkdirectory}/gacutil.exe"
commandline="/i ${build.dir}/bin/nunit.framework.dll"/>
<echo message="The assembly nunit.framework was added to the GAC"/>
<exec program="${nant.settings.currentframework.sdkdirectory}/gacutil.exe"
commandline="/i ${build.dir}/bin/nunit.core.dll"/>
<echo message="The assembly nunit.core was added to the GAC"/>
</target>
<!-- Set up build configuration -->
<target name="set-build-config">
<call target="set-${build.config}-build-config"/>
</target>
<target name="set-debug-build-config">
<property name="build.config" value="debug"/>
<property name="build.debug" value="true"/>
<property name="build.defines.csc" value="DEBUG,TRACE" readonly="false" />
<property name="build.defines.jsc" value="DEBUG,TRACE" readonly="false" />
<property name="build.defines.vbc" value="DEBUG=True,TRACE=True" readonly="false" />
<property name="build.defines.vjc" value="DEBUG,TRACE" readonly="false" />
<property name="build.defines.cl" value="/D _DEBUG" readonly="false" />
<property name="zip.build.suffix" value="-dbg"/>
<property name="msi.build.suffix" value="-dbg"/>
</target>
<target name="set-release-build-config">
<property name="build.config" value="release"/>
<property name="build.debug" value="false"/>
<property name="build.defines.csc" value="TRACE,STRONG" readonly="false" />
<property name="build.defines.jsc" value="TRACE,STRONG" readonly="false" />
<property name="build.defines.vbc" value="TRACE=True,STRONG=True" readonly="false" />
<property name="build.defines.vjc" value="TRACE,STRONG" readonly="false" />
<property name="build.defines.cl" value="/D STRONG" readonly="false" />
<property name="zip.build.suffix" value=""/>
<property name="msi.build.suffix" value=""/>
</target>
<!-- Set up runtime configuration -->
<target name="set-runtime-config">
<call target="set-${runtime.config}-${runtime.version}-runtime-config"/>
</target>
<target name="set-net-1.0-runtime-config">
<property name="runtime.config" value="net"/>
<property name="runtime.version" value="1.0"/>
<property name="build.mono" value="false"/>
<property name="build.win32" value="true"/>
<property name="nant.settings.currentframework" value="net-1.0"/>
<property name="zip.runtime.suffix" value="-net-1.0"/>
<property name="msi.runtime.suffix" value="-net-1.0"/>
</target>
<target name="set-net-1.1-runtime-config">
<property name="runtime.config" value="net"/>
<property name="runtime.version" value="1.1"/>
<property name="build.mono" value="false"/>
<property name="build.win32" value="true"/>
<property name="nant.settings.currentframework" value="net-1.1"/>
<property name="zip.runtime.suffix" value="-net-1.1"/>
<!-- no suffix for the msi - we can only do it for 1.1 anyway -->
<property name="msi.runtime.suffix" value=""/>
</target>
<target name="set-net-2.0-runtime-config">
<property name="runtime.config" value="net"/>
<property name="runtime.version" value="2.0"/>
<property name="build.mono" value="false"/>
<property name="build.win32" value="true"/>
<property name="nant.settings.currentframework" value="net-2.0"/>
<property name="zip.runtime.suffix" value="-net-2.0"/>
<!-- no suffix for the msi - we can only do it for 1.1 anyway -->
<property name="msi.runtime.suffix" value=""/>
</target>
<target name="set-mono-1.0-runtime-config">
<property name="runtime.config" value="mono"/>
<property name="runtime.version" value="1.0"/>
<property name="build.mono" value="true"/>
<property name="build.win32" value="false"/>
<property name="nant.settings.currentframework" value="mono-1.0"/>
<property name="zip.runtime.suffix" value="-mono"/>
<property name="msi.runtime.suffix" value="-mono"/>
</target>
<!-- Set up the build directory -->
<target name="set-build-dir" depends="set-build-config,set-runtime-config">
<property name="build.dir" value="${project.build.dir}/${runtime.config}-${runtime.version}/${build.config}"/>
<property name="bin.dir" value="${build.dir}/bin"/>
<property name="src.dir" value="${build.dir}/src"/>
<property name="doc.dir" value="${build.dir}/doc"/>
</target>
<!-- Setup the package configuration info -->
<target name="set-package-config" depends="set-build-config,set-runtime-config">
<property name="zip.file.name" value="${package.name}${zip.runtime.suffix}${zip.build.suffix}.zip"/>
<property name="msi.file.name" value="${package.name}${msi.runtime.suffix}${msi.build.suffix}.msi"/>
<property name="zipped.src.file.name" value="${package.name}-src.zip"/>
</target>
<!-- Dump configuration settings for debugging -->
<target name="dump-settings" depends="set-build-dir,set-package-config">
<echo>Configuration</echo>
<echo> Config: ${build.config}</echo>
<echo> Runtime: ${runtime.config}-${runtime.version}</echo>
<echo> Version: ${package.version}</echo>
<echo> Package name: ${package.name}</echo>
<echo> Zip file: ${zip.file.name}</echo>
<echo> Msi file: ${msi.file.name}</echo>
<echo> Source zip: ${zipped.src.file.name}</echo>
<echo></echo>
<echo>Project Directories</echo>
<echo> Base: ${nant.project.basedir}</echo>
<echo> Build: ${project.build.dir}</echo>
<echo> Package: ${project.package.dir}</echo>
<echo></echo>
<echo>Current Directories</echo>
<echo> Build: ${build.dir}</echo>
<echo> Package: ${package.dir}</echo>
<echo></echo>
<echo>System Directories</echo>
<echo> Framework: ${nant.settings.currentframework.frameworkdirectory}</echo>
<echo> SDK: ${nant.settings.currentframework.sdkdirectory}</echo>
<echo> VS 2002: ${vs.2002.path}</echo>
<echo> VS 2003: ${vs.2003.path}</echo>
</target>
</project>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -