Skip to content

NAnt refactoring #1561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Tools/msbuild.cmd

This file was deleted.

166 changes: 0 additions & 166 deletions build-common/common-project.xml

This file was deleted.

96 changes: 13 additions & 83 deletions build-common/common.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<?xml version="1.0" ?>
<project xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd">

<!--
Use this to determine if the key file NHibernate.snk should be used to
sign the assemblies. Defaults to true since private key is present
in CVS.
-->
<property name="sign" value="true" overwrite="false" />

<!--
if Visual Studio Help Integration Kit has been installed
then change this to true or include -D:vshik.installed=true in the command line.
Expand All @@ -22,9 +14,6 @@
-->
<property name="nunit2report.installed" value="false" overwrite="false" />

<property name="nant-version.current" value="${assemblyname::get-version(assembly::get-name(nant::get-assembly()))}" />
<property name="nant-version.required" value="0.91.4312.0" /> <!-- Nant 0.91 release version -->

<!-- Path to the folder that contain the external assemblies -->
<property name="lib.dir" value="lib" dynamic="true" />

Expand All @@ -36,88 +25,29 @@
<!-- properties used to connect to database for testing -->
<include buildfile="nhibernate-properties.xml" />

<!-- named project configurations -->
<target name="set-debug-project-configuration" description="Perform a 'debug' build">
<property name="build.release" value="false" />
<property name="build.debug" value="true" />
<property name="build.name" value="NHibernate-${project.version}-${project.config}" />
</target>

<target name="set-release-project-configuration" description="Perform a 'release' build">
<property name="build.release" value="true" />
<property name="build.debug" value="pdbonly" />
<property name="build.name" value="NHibernate-${project.version}" />
</target>

<target name="set-project-configuration">
<target name="common.init" description="Initializes build properties">
<property name="project.config" value="debug" overwrite="false" />
<if test="${not(target::exists('set-' + project.config + '-project-configuration'))}">
<fail message="Unknown configuration: '${project.config}'" />
</if>

<call target="set-${project.config}-project-configuration" />

<property name="build.name" value="NHibernate-${project.version}" if="${project.config == 'release'}"/>
<property name="build.name" value="NHibernate-${project.version}-${project.config}" unless="${project.config == 'release'}" />
<property name="build.root.dir" value="${root.dir}/build/${build.name}" />
<property name="build.dir" value="${build.root.dir}" />
<property name="bin.dir" value="${build.dir}/bin" />
<property name="testresults.dir" value="${bin.dir}/test-results" />
<property name="tools.dir" value="${root.dir}/Tools"/>
</target>

<target name="display-current-runtime">
<echo message="" />
<echo message="----------------------------------------------------------" />
<echo message=" ${framework::get-description(framework::get-target-framework())}" />
<echo message="----------------------------------------------------------" />
<echo message="" />
<echo message="framework : ${framework::get-target-framework()}" />
<echo message="description : ${framework::get-description(framework::get-target-framework())}" />
<echo message="sdk directory : ${framework::get-sdk-directory(framework::get-target-framework())}" />
<echo message="framework directory : ${framework::get-framework-directory(framework::get-target-framework())}" />
<echo message="assembly directory : ${framework::get-assembly-directory(framework::get-target-framework())}" />
<echo message="runtime engine : ${framework::get-runtime-engine(framework::get-target-framework())}" />
<echo message="" />
<target name="common.download-nuget" depends="common.init">
<get
src="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
dest="${tools.dir}/nuget.exe"
usetimestamp="true"
/>
</target>

<target name="common.init"
depends="set-project-configuration"
description="Initializes build properties">

<fileset id="project.sources" failonempty="true">
<include name="**/*.cs" />
</fileset>
<resourcefileset id="project.resources" />
<target name="common.nuget-restore" depends="common.init common.download-nuget">
<exec basedir="${tools.dir}" workingdir="${root.dir}/Tools" program="NuGet.exe">
<arg value="install" />
</exec>
</target>

<target name="common.get-nuget-package-path">
<xmlpeek
file="${tools.dir}/packages.config"
xpath="/packages/package[@id = '${nuget-package-id}']/@version"
property="nuget-package-version" />
<property name="nuget-package-path" value="${tools.dir}/${nuget-package-id}.${nuget-package-version}/" />
</target>

<target name="common.find-async-generator-console">
<property name="nuget-package-id" value="CSharpAsyncGenerator.CommandLine" />
<call target="common.get-nuget-package-path" />
<property name="async-generator-console" value="${nuget-package-path}/tools/AsyncGenerator.CommandLine.exe" />
</target>

<target name="common.find-nunit">
<property name="nuget-package-id" value="NUnit.ConsoleRunner" />
<call target="common.get-nuget-package-path" />
<property name="nunit-console" value="${nuget-package-path}/tools/nunit3-console.exe" />
</target>

<target name="common.find-ndoc">
<property name="ndoc-console" value="${tools.dir}/ndoc/NDocConsole.exe" />
</target>

<target name="nuget.set-properties">
<property name="nuget.nupackages.relative-dir" value="nuget_gallery" />

<property name="nuget.nupackages.dir" value="${build.dir}/${nuget.nupackages.relative-dir}" />
<property name="nuget.nupackages.pushbatfile" value="${nuget.nupackages.dir}/NuGetPush.bat" />
</target>

</project>
Loading