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 (313 sloc) 13.171 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" />
<!--
Supported versions of .NET Framework, separated by spaces.
Used by *-all-frameworks targets.
-->
<property name="supported.frameworks" value="net-2.0" />
<fileset id="buildfiles.all" basedir="src">
<!-- Files have to be in dependency order -->
<include name="Iesi.Collections/Iesi.Collections.build" />
<include name="Iesi.Collections.Test/Iesi.Collections.Test.build" />
<include name="NHibernate/NHibernate.build" />
<include name="NHibernate.ByteCode.LinFu/ByteCode.build" />
<include name="NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build" />
<include name="NHibernate.ByteCode.Castle/ByteCode.build" />
<include name="NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build" />
<include name="NHibernate.ByteCode.Spring/ByteCode.build" />
<include name="NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build" />
<include name="NHibernate.DomainModel/NHibernate.DomainModel.build" />
<include name="NHibernate.Test/NHibernate.Test.build" />
<include name="NHibernate.Tool.HbmXsd/NHibernate.Tool.HbmXsd.build" />
</fileset>
<fileset id="buildfiles.tests" basedir="src">
<include name="Iesi.Collections.Test/Iesi.Collections.Test.build" />
<include name="NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build" />
<include name="NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build" />
<include name="NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build" />
<include name="NHibernate.Test/NHibernate.Test.build" />
</fileset>
<target name="init" depends="common.init"
description="Initializes build properties" />
<target name="prepare-build-directory" depends="init">
<mkdir dir="${bin.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}">
<!--
Excludes the Iesi.Collections assembly because it is built during the build
of NHibernate. It is in the lib folder for VS.NET convenience. However, we
do want to copy the license file.
-->
<exclude name="Iesi.Collections.dll" />
<exclude name="Iesi.Collections.xml" />
<exclude name="NHibernate.ByteCode.LinFu.dll" />
<exclude name="NHibernate.ByteCode.LinFu.xml" />
<exclude name="NHibernate.ByteCode.Castle.dll" />
<exclude name="NHibernate.ByteCode.Castle.xml" />
<exclude name="NHibernate.ByteCode.Spring.dll" />
<exclude name="NHibernate.ByteCode.Spring.xml" />
<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 to compile (but can run on .Net 2.0), please use the -t:net-3.5 parameter when starting nant" 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="coverage-report" description="Builds the test coverage reports"
if="${clover.enabled}">
<mkdir dir="${build.dir}/clover" />
<clover-setup
initstring="${clover.db}"
flushinterval="1000"
/>
<clover-report>
<current title="NHibernate Clover Report" output="${build.dir}/clover" >
<format type="html" orderby="Alpha" />
</current>
</clover-report>
</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"
description="Builds Reference Manual">
<nant buildfile="doc/documentation.build" target="manual" />
</target>
<target name="reference-zip" depends="init binaries"
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">
<property name="clover.enabled" value="false" />
<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">
<property name="clover.enabled" value="false" />
<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/Iesi*/**" />
<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 the Clover modified source files. -->
<exclude name="${clover.src}/**" />
<!-- 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.requiredlazy" value="${bin-pack.tmpdir}/Required_For_LazyLoading" />
<property name="bin-pack.tests" value="${bin-pack.tmpdir}/Tests" />
<copy file="releasenotes.txt" todir="${bin-pack.tmpdir}"/>
<copy file="readme.html" todir="${bin-pack.tmpdir}"/>
<copy file="lgpl.txt" todir="${bin-pack.tmpdir}"/>
<copy file="gfdl.txt" todir="${bin-pack.tmpdir}"/>
<copy file="HowInstall.txt" todir="${bin-pack.tmpdir}"/>
<!--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="Antlr3.Runtime.dll" />
<include name="Iesi.Collections.???" />
<include name="log4net*" />
<include name="NHibernate.???" />
</fileset>
</copy>
<!--Required Bins for lazy loading NHibernate.ByteCode.Castle.dll-->
<copy file="Choose_Only_One.txt" todir="${bin-pack.requiredlazy}"/>
<copy todir="${bin-pack.requiredlazy}/Castle">
<fileset basedir="${bin.dir}">
<include name="Castle.*" />
<include name="NHibernate.ByteCode.Castle.???" />
</fileset>
</copy>
<copy todir="${bin-pack.requiredlazy}/LinFu">
<fileset basedir="${bin.dir}">
<include name="LinFu.*" />
<include name="NHibernate.ByteCode.LinFu.???" />
</fileset>
</copy>
<copy todir="${bin-pack.requiredlazy}/Spring">
<fileset basedir="${bin.dir}">
<include name="antlr.runtime.dll" />
<include name="Common.Logging.dll" />
<include name="Spring.*" />
<include name="NHibernate.ByteCode.Spring.???" />
</fileset>
</copy>
<!-- 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}">
<fileset basedir="${bin.dir}">
<include name="nunit*" />
<include name="NHibernate.Domain*" />
<include name="NHibernate.Test*" />
</fileset>
</copy>
</target>
<target name="package" depends="init binaries 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" />
<delete dir="${clover.src}" failonerror="false" />
</target>
<target name="clean" depends="init" description="Deletes current build">
<delete dir="${build.dir}" failonerror="false" />
<delete dir="${clover.src}" 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>
</project>
Jump to Line
Something went wrong with that request. Please try again.