Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

373 lines (309 sloc) 13.309 kB
<?xml version="1.0" ?>
<project
name="NHibernate"
default="build"
xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd"
>
<property name="root.dir" value="." />
<include buildfile="${root.dir}/build-common/common.xml" />
<!-- Pass -D:skip.tests=true to NAnt to skip running tests when building -->
<property name="skip.tests" value="false" overwrite="false" />
<property name="skip.manual" value="false" overwrite="false" />
<!--
Supported versions of .NET Framework, separated by spaces.
Used by *-all-frameworks targets.
-->
<property name="supported.frameworks" value="net-3.5" />
<fileset id="buildfiles.all" basedir="src">
<!-- Files have to be in dependency order -->
<include name="NHibernate/NHibernate.build" />
<include name="NHibernate.DomainModel/NHibernate.DomainModel.build" />
<include name="NHibernate.Test/NHibernate.Test.build" />
<include name="NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.build" />
<include name="NHibernate.TestDatabaseSetup/TestDatabaseSetup.build" />
<include name="NHibernate.Tool.HbmXsd/NHibernate.Tool.HbmXsd.build" />
</fileset>
<fileset id="buildfiles.tests" basedir="src">
<include name="NHibernate.TestDatabaseSetup/TestDatabaseSetup.build" />
<include name="NHibernate.Test/NHibernate.Test.build" />
<include name="NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.build" />
</fileset>
<target name="init" depends="common.init" description="Initializes build properties" />
<target name="prepare-build-directory" depends="init">
<mkdir dir="${bin.dir}" />
<mkdir dir="${testresults.dir}" />
<call target="copy-referenced-assemblies" />
</target>
<target name="copy-referenced-assemblies">
<!-- Copy framework-neutral libraries -->
<copy todir="${bin.dir}" >
<fileset basedir="${lib.dir}">
<include name="*.dll" />
<include name="*.xml" />
<include name="*.license.txt" />
<include name="nant/*.*" />
</fileset>
</copy>
<!-- Copy family-specific libraries -->
<!--
The builds of log4net and nunit work just fine for all versions of .NET.
When they do get framework specific extensions then we
can just move them to the framework specific section
-->
<copy todir="${bin.dir}">
<fileset basedir="${lib.family.dir}">
<include name="*.dll" />
<include name="*.xml" />
<include name="*.license.txt" />
</fileset>
</copy>
<!-- Copy framework-specific libraries -->
<copy todir="${bin.dir}">
<fileset basedir="${lib.framework.dir}">
<include name="*.dll" />
<include name="*.xml" />
<include name="*.license.txt" />
</fileset>
</copy>
</target>
<target name="build"
depends="check-framework-version init prepare-build-directory"
description="Builds NHibernate in the current configuration">
<nant target="build">
<buildfiles refid="buildfiles.all" />
</nant>
</target>
<target name="check-framework-version">
<echo>Running with ${framework::get-target-framework()}</echo>
<fail message="ERROR: NHibernate requires .Net 3.5." if="${framework::get-target-framework()!='net-3.5'}"/>
</target>
<target name="test-report" if="${nunit2report.installed}">
<mkdir dir="${build.dir}/testresults" />
<nunit2report out="${build.dir}/testresults/index.html" format="Frames" todir="${build.dir}/testresults">
<fileset>
<include name="${bin.dir}/*results.xml" />
</fileset>
</nunit2report>
</target>
<target name="test" depends="init build" description="Runs all NHibernate tests for the current framework" unless="${skip.tests}">
<nant target="test">
<buildfiles refid="buildfiles.tests" />
</nant>
</target>
<target name="doc" depends="init binaries"
description="Builds the Help Documentation and the API documentation">
<nant buildfile="doc/documentation.build" target="api manual" />
</target>
<target name="reference" depends="init binaries" unless="${skip.manual}"
description="Builds Reference Manual">
<nant buildfile="doc/documentation.build" target="manual" />
</target>
<target name="reference-zip" depends="init binaries" unless="${skip.manual}"
description="Builds Reference Manual zip">
<nant buildfile="doc/documentation.build" target="manual-zip"/>
</target>
<target name="api" depends="init binaries"
description="Builds the API Documentation">
<nant buildfile="doc/documentation.build" target="api" />
</target>
<target name="build-all-frameworks" depends="init">
<!-- Save the current framework -->
<property name="current.framework.saved" value="${nant.settings.currentframework}" />
<!-- Execute build for each framework -->
<foreach item="String" delim=" " property="framework" in="${supported.frameworks}">
<call target="set-${framework}-framework-configuration" />
<call target="build" />
<!-- Copy and rename the license -->
<copy file="lgpl.txt" tofile="${bin.dir}/NHibernate.license.txt" />
</foreach>
<!-- Reset the current framework to the saved value -->
<call target="set-${current.framework.saved}-framework-configuration" />
</target>
<target name="binaries" depends="init">
<call target="build" />
</target>
<target name="test-all-frameworks" depends="init">
<!-- Save the current framework -->
<property name="current.framework.saved" value="${nant.settings.currentframework}" />
<!-- Execute build for each framework -->
<foreach item="String" delim=" " property="framework" in="${supported.frameworks}">
<call target="set-${framework}-framework-configuration" />
<call target="test" />
</foreach>
<!-- Reset the current framework to the saved value -->
<call target="set-${current.framework.saved}-framework-configuration" />
</target>
<target name="reports" depends="init">
<call target="test-all-frameworks" />
<call target="test-report" />
<call target="coverage-report" />
</target>
<target name="sources">
<property name="source.tmpdir" value="${build.dir}/tmp-src" />
<copy todir="${source.tmpdir}">
<fileset>
<!-- copy dlls used by this build -->
<include name="${lib.dir}/**" />
<!-- copy all of the NHibernate source -->
<include name="src/NHibernate*/**" />
<include name="src/*.*" />
<include name="build-common/**" />
<include name="*.build" />
<include name="gfdl.txt" />
<include name="lgpl.txt" />
<include name="releasenotes.txt" />
<include name="readme.html" />
<!-- exclude ReSharper stuff -->
<exclude name="**/_ReSharper*/**" />
<exclude name="**/*.resharperoptions" />
<exclude name="**/*resharper*" />
<!-- exclude VS.NET stuff -->
<exclude name="**/*.suo" />
<exclude name="**/*.user" />
<exclude name="**/bin/**" />
<exclude name="**/obj/**" />
</fileset>
</copy>
<!-- Generate AssemblyInfo.cs files for Visual Studio -->
<nant buildfile="${source.tmpdir}/default.build" target="visual-studio" />
</target>
<target name="sources-zip" depends="init sources">
<zip zipfile="${build.dir}/NHibernate-${project.version}-src.zip">
<fileset basedir="${source.tmpdir}">
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="binaries-zip" depends="init bin-pack">
<zip zipfile="${build.dir}/NHibernate-${project.version}-bin.zip">
<fileset basedir="${bin-pack.tmpdir}">
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="bin-pack" depends="init binaries">
<property name="bin-pack.tmpdir" value="${build.dir}/tmp-bin" />
<property name="bin-pack.conf-template" value="${bin-pack.tmpdir}/Configuration_Templates" />
<property name="bin-pack.required" value="${bin-pack.tmpdir}/Required_Bins" />
<property name="bin-pack.tests" value="${bin-pack.tmpdir}/Tests" />
<copy file="releasenotes.txt" todir="${bin-pack.tmpdir}"/>
<copy file="lgpl.txt" todir="${bin-pack.tmpdir}/NHibernate.license.txt"/>
<copy file="gfdl.txt" todir="${bin-pack.tmpdir}"/>
<copy file="HowInstall.txt" todir="${bin-pack.tmpdir}"/>
<exec program="CScript.exe"
commandline="Tools\showdown\showdown.wsf README.md ${bin-pack.tmpdir}/readme.html"/>
<!--Configuration templates-->
<copy todir="${bin-pack.conf-template}">
<fileset basedir="src/NHibernate.Config.Templates">
<include name="*"/>
</fileset>
</copy>
<!--Minimal Required Bins-->
<copy todir="${bin-pack.required}">
<fileset basedir="src/NHibernate">
<include name="*.xsd" />
</fileset>
</copy>
<copy todir="${bin-pack.required}">
<fileset basedir="${bin.dir}">
<include name="Iesi.Collections.???" />
<include name="NHibernate.???" />
</fileset>
</copy>
<!--Required Bins for lazy loading NHibernate.ByteCode.Castle.dll-->
<!-- Tests -->
<copy file="${bin.dir}/TestEnbeddedConfig.cfg.xml" todir="${bin-pack.tests}"/>
<copy file="${bin.dir}/ABC.hbm.xml" todir="${bin-pack.tests}"/>
<copy todir="${bin-pack.tests}/DbScripts">
<fileset basedir="${root.dir}/src/NHibernate.Test/DbScripts">
<include name="*.sql" />
</fileset>
</copy>
<copy todir="${bin-pack.tests}">
<fileset basedir="${bin.dir}">
<include name="nunit*" />
<include name="SharpTestsEx*" />
<include name="NHibernate.Domain*" />
<include name="NHibernate.Test*" />
<include name="log4net*" />
</fileset>
</copy>
</target>
<target name="package" depends="init binaries test reference-zip sources-zip binaries-zip"
description="Creates files for the General Available Release on SourceForge">
<echo message="Created a '${project.config}' package in ${build.dir}" />
</target>
<target name="release" depends="init binaries binaries-zip sources-zip"
description="Creates files for the partial (Alpha-Beta-Candidate) Release on SourceForge">
<echo message="Created a '${project.config}' package in ${build.dir}" />
</target>
<target name="visual-studio" depends="init" description="Modifies AssemblyInfo.cs files to work with Visual Studio">
<property name="visual-studio" value="true" />
<nant target="generate-assemblyinfo">
<buildfiles refid="buildfiles.all" />
</nant>
</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="clean" depends="init" description="Deletes current build">
<delete dir="${build.dir}" failonerror="false" />
</target>
<target name="gen-schema-classes" descripton="Generates schema classes from nhibernate-mapping.xsd">
<exec program="xsd.exe"
commandline="src\NHibernate\nhibernate-mapping.xsd /classes /fields /order /namespace:NHibernate.Cfg.MappingSchema /out:src\NHibernate\Cfg\MappingSchema\"/>
</target>
<fileset id="nugetfiles.all" basedir="src">
<include name="NHibernate/NHibernate.build" />
</fileset>
<target name="nuspec" depends="init nuget.set-properties" description="Create nuspec files">
<nant target="nuspec">
<buildfiles refid="nugetfiles.all" />
</nant>
</target>
<target name="nuget" depends="init binaries nuget.set-properties nuspec"
description="Creates files for the release on nuget gallery.">
<nant target="nuget">
<buildfiles refid="nugetfiles.all" />
</nant>
<mkdir dir="${nuget.nupackages.dir}" />
<move todir="${nuget.nupackages.dir}">
<fileset basedir="${nuget.workingdir}">
<include name="*.nupkg" />
</fileset>
</move>
</target>
<target name="nugetpushbat" depends="init binaries nuget.set-properties nuspec nuget"
description="Creates files for the release on nuget gallery.">
<copy file="${tools.dir}/NuGet.exe" todir="${nuget.nupackages.dir}"/>
<echo message="rem In order to use this bat you have to be sure you have executed 'nuget SetApiKey' ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="false"/>
<foreach item="File" property="filename">
<in>
<items>
<include name="${nuget.nupackages.dir}/*.nupkg"/>
</items>
</in>
<do>
<echo message="nuget push ${filename} ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="true"/>
</do>
</foreach>
</target>
<target name="nugetpush" depends="init binaries nuget.set-properties nuspec nuget"
description="Push packages on nuget gallery.">
<!-- In order to use this task you have to be sure you have executed 'nuget SetApiKey' -->
<foreach item="File" property="filename">
<in>
<items>
<include name="${nuget.nupackages.dir}/*.nupkg"/>
</items>
</in>
<do>
<exec basedir="${tools.dir}" workingdir="${nuget.nupackages.dir}" program="NuGet.exe">
<arg value="push" />
<arg value="${filename}" />
</exec>
</do>
</foreach>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.