1 Star 0 Fork 2

leon39.7 / NHibernate

forked from Gitee 极速下载 / NHibernate 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
default.build 13.39 KB
一键复制 编辑 原始数据 按行查看 历史
<?xml version="1.0" ?>
<project
name="NHibernate"
default="build"
xmlns="http://nant.sf.net/release/0.90/nant.xsd"
>
<property name="root.dir" value="." />
<property name="bin.target.dir" value="net48" />
<property name="test.target.dir" value="net48" />
<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" />
<target name="init" depends="common.init" description="Initializes build properties" />
<target name="prepare-build-directory" depends="init">
<mkdir dir="${testresults.dir}" />
</target>
<target name="nuget.set-properties">
<property name="nuget.nupackages.dir" value="${build.dir}/nuget_gallery" />
<property name="nuget.nupackages.pushbatfile" value="${nuget.nupackages.dir}/NuGetPush.bat" />
</target>
<target name="build"
depends="init prepare-build-directory nuget.set-properties"
description="Builds NHibernate in the current configuration">
<property name="build.counter" value="" overwrite="false" />
<exec program="dotnet" verbose="true">
<arg value="msbuild" />
<arg value="${root.dir}/src/NHibernate.sln" />
<arg value="/p:Platform=&quot;Any CPU&quot;" />
<arg value="/p:Configuration=&quot;${build.config}&quot;"/>
<arg value="/p:GeneratePackageOnBuild=&quot;True&quot;" />
<arg value="/p:IncludeSymbols=&quot;True&quot;" />
<arg value="/p:IncludeSource=&quot;True&quot;" />
<arg value="/p:PackageOutputPath=&quot;${path::get-full-path(nuget.nupackages.dir)}&quot;" />
<!-- build.counter is not available by default. It needs to be exposed in Team City as system parameter system.build.counter with value %build.counter% -->
<arg value="/p:BuildNumber=&quot;${build.counter}&quot;" unless="${build.counter == ''}" />
<arg value="/t:Restore" />
<arg value="/t:Rebuild" />
<arg value="/v:q" />
<arg value="/m:1" />
</exec>
</target>
<target name="solution-restore" depends="common.tools-restore">
<exec program="dotnet" verbose="true">
<arg value="msbuild" />
<arg value="/t:Restore" />
<arg value="${root.dir}/src/NHibernate.sln" />
</exec>
</target>
<target name="get-tool-info" depends="common.tools-restore">
<xmlpeek
file="${tools.dir}/packages.csproj"
xpath="/Project/ItemGroup/PackageReference[@Include = '${tool.id}']/@Version"
property="tool.version" />
<property name="tool.path" value="${tools.dir}/${tool.id}/${tool.version}/" />
</target>
<target name="generate-async" depends="solution-restore">
<exec workingdir="${root.dir}/src" program="dotnet" verbose="true">
<arg line="async-generator" />
</exec>
</target>
<target name="put-connection-settings-into-defined-app-config">
<!-- make sure the config file is writable -->
<attrib file="${app.config}" readonly="false" />
<!--
Tell nhibernate how to connect to the test database.
-->
<xmlpoke file="${app.config}"
xpath="//*/hbm:property[@name='dialect']"
value="${nhibernate.dialect}">
<namespaces>
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
</namespaces>
</xmlpoke>
<xmlpoke file="${app.config}"
xpath="//*/hbm:property[@name='command_timeout']"
value="${nhibernate.command_timeout}">
<namespaces>
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
</namespaces>
</xmlpoke>
<xmlpoke file="${app.config}"
xpath="//*/hbm:property[@name='connection.driver_class']"
value="${nhibernate.connection.driver_class}">
<namespaces>
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
</namespaces>
</xmlpoke>
<xmlpoke file="${app.config}"
xpath="//*/hbm:property[@name='connection.connection_string']"
value="${nhibernate.connection.connection_string}">
<namespaces>
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
</namespaces>
</xmlpoke>
<!-- Make sure the property exists - it's only set for some scenarios. -->
<property name="nhibernate.odbc.explicit_datetime_scale" value="" unless="${property::exists('nhibernate.odbc.explicit_datetime_scale')}"/>
<xmlpoke file="${app.config}"
xpath="//*/hbm:property[@name='odbc.explicit_datetime_scale']"
value="${nhibernate.odbc.explicit_datetime_scale}">
<namespaces>
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
</namespaces>
</xmlpoke>
<!-- Make sure the property exists - it's only set for some scenarios. -->
<property name="nhibernate.oracle.use_n_prefixed_types_for_unicode" value="" unless="${property::exists('nhibernate.oracle.use_n_prefixed_types_for_unicode')}"/>
<xmlpoke file="${app.config}"
xpath="//*/hbm:property[@name='oracle.use_n_prefixed_types_for_unicode']"
value="${nhibernate.oracle.use_n_prefixed_types_for_unicode}">
<namespaces>
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
</namespaces>
</xmlpoke>
<!-- Make sure the property exists - it's only set for some scenarios. -->
<property name="nhibernate.query.default_cast_length" value="" unless="${property::exists('nhibernate.query.default_cast_length')}"/>
<xmlpoke file="${app.config}"
xpath="//*/hbm:property[@name='query.default_cast_length']"
value="${nhibernate.query.default_cast_length}">
<namespaces>
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
</namespaces>
</xmlpoke>
</target>
<target name="put-connection-settings-into-app-config">
<property name="app.config" value="src/${test.file}/bin/${build.config}/${test.target.dir}/${test.file}.dll.config" />
<call target="put-connection-settings-into-defined-app-config" />
</target>
<target name="find-nunit">
<property name="tool.id" value="NUnit.Console" />
<call target="get-tool-info" />
<property name="nunit-console" value="${tools.dir}/NUnit.ConsoleRunner/${tool.version}/tools/nunit3-console.exe" />
</target>
<target name="run-tests" depends="find-nunit" description="Run NUnit tests">
<exec program="${nunit-console}" failonerror="${not property::exists(test.file + '.IgnoreFail')}">
<arg value="${root.dir}/src/${test.file}/bin/${build.config}/${test.target.dir}/${test.file}.dll" />
<arg value="--result=${testresults.dir}/${test.file}.dll-results.xml;format=nunit2" />
<arg value="--teamcity" if="${property::exists('config.teamcity')}" />
<arg value="--x86" unless="${property::exists('nunit-x64')}" />
</exec>
</target>
<target name="remove-connection-settings-from-app-config">
<property name="app.config" value="${root.dir}/src/${test.file}/bin/${build.config}/${test.target.dir}/${test.file}.dll.config" />
<xmlpoke
file="${app.config}"
xpath="/configuration/nhibernate/add[@key='hibernate.connection.connection_string']/@value"
value="conn string here"
/>
</target>
<target name="run-database-tests"
depends="put-connection-settings-into-app-config run-tests remove-connection-settings-from-app-config" />
<target name="test" depends="init build" description="Runs all NHibernate tests for the current framework" unless="${skip.tests}">
<property name="testfiles.all" value="NHibernate.TestDatabaseSetup NHibernate.Test NHibernate.Test.VisualBasic" />
<foreach item="String" in="${testfiles.all}" delim=" " property="test.file">
<call target="run-database-tests"/>
</foreach>
</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="binaries" depends="init">
<call target="build" />
</target>
<target name="sources-zip" depends="init">
<exec program="git" commandline="archive HEAD --format zip --output &quot;${build.dir}/NHibernate-${project.version}-src.zip&quot;"/>
</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="LICENSE.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="${root.dir}/src/NHibernate.Config.Templates">
<include name="*"/>
</fileset>
</copy>
<!--Minimal Required Bins-->
<copy todir="${bin-pack.required}">
<fileset basedir="${root.dir}/src/NHibernate">
<include name="*.xsd" />
</fileset>
</copy>
<copy todir="${bin-pack.required}">
<fileset basedir="${root.dir}/src/NHibernate/bin/${build.config}/${bin.target.dir}/">
<include name="Antlr3.Runtime.???" />
<include name="Iesi.Collections.???" />
<include name="NHibernate.???" />
<include name="Remotion.Linq.???" />
<include name="Remotion.Linq.EagerFetching.???" />
</fileset>
</copy>
<!-- Tests -->
<copy file="${root.dir}/src/NHibernate.Test/TestEmbeddedConfig.cfg.xml" todir="${bin-pack.tests}"/>
<copy file="${root.dir}/src/NHibernate.DomainModel/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="${root.dir}/src/NHibernate.Test/bin/${build.config}/${test.target.dir}">
<include name="log4net*" />
<include name="NHibernate.DomainModel.*" />
<include name="NHibernate.Test.*" />
<include name="nunit*" />
</fileset>
</copy>
<copy todir="${bin-pack.tests}">
<fileset basedir="${root.dir}/src/NHibernate.Test.VisualBasic/bin/${build.config}/${test.target.dir}">
<include name="NHibernate.Test.VisualBasic.*" />
</fileset>
</copy>
<copy todir="${bin-pack.tests}">
<fileset basedir="${root.dir}/src/NHibernate.TestDatabaseSetup/bin/${build.config}/${test.target.dir}">
<include name="NHibernate.TestDatabaseSetup.*" />
</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="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>
<target name="nugetpushbat" depends="init binaries nuget.set-properties"
description="Creates files for the release on nuget gallery.">
<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="dotnet nuget push -s https://api.nuget.org/v3/index.json ${path::get-file-name(filename)} ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="true"/>
</do>
</foreach>
</target>
<target name="nugetpush" depends="init binaries nuget.set-properties"
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="dotnet">
<arg value="nuget" />
<arg value="push" />
<arg value="${filename}" />
</exec>
</do>
</foreach>
</target>
</project>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/leon39_7/NHibernate.git
git@gitee.com:leon39_7/NHibernate.git
leon39_7
NHibernate
NHibernate
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891