SPRNET-1561 ASP.NET MVC 5 and WEB API 2 support

* also add .NET 4.5 targets
* fix issues with libs and build targets
This commit is contained in:
Marko Lahma
2013-12-02 19:28:33 +02:00
parent 1466cc9b43
commit fc5fa113bb
185 changed files with 42422 additions and 96 deletions

View File

@@ -310,12 +310,21 @@ Commandline Examples:
<call target="compile-build-3.5"/>
<call target="compile-build-4.0"/>
<call target="compile-build-4.5"/>
<call target="compile-build-mono-2.0"/>
</target>
-->
<target name="restore-nuget-packages" description="Restores NuGet packages that solution(s) reference">
<exec
program=".nuget\nuget.exe"
commandline="restore Spring.NET.2010.sln"
workingdir="."
failonerror="true" />
</target>
<target name="compile-build-3.5" description="Builds for .NET 3.5 if available">
<if test="${net-3.5.installed}">
@@ -353,6 +362,23 @@ Commandline Examples:
</if>
</target>
<target name="compile-build-4.5" description="Builds for .NET 4.5 if available">
<if test="${net-4.5.installed}">
<call target="compile-net-4.5"/>
</if>
<if test="${not net-4.5.installed}">
<if test="${property::exists('project.build.package') and project.build.package}">
.NET 4.5 Build Skipped for Package
<fail message="The .NET Framework 4.5 is not available."/>
<echo message="The .NET Framework 4.5 is not available. Build skipped during package."/>
</if>
<if test="${not(property::exists('project.build.package') and project.build.package)}">
<echo message="The .NET Framework 4.5 is not available. Build skipped."/>
</if>
</if>
</target>
<!-- Targets for other .NET frameworks -->
@@ -396,15 +422,26 @@ Commandline Examples:
<property name="nh32.lib.dir" value="${spring.basedir}/lib/NHibernate32/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}"/>
<property name="nh33.lib.dir" value="${spring.basedir}/lib/NHibernate33/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}"/>
<property name="quartz21.lib.dir" value="${spring.basedir}/lib/Quartz21/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}"/>
<call target="copylibtobin"/>
<!-- we use same libs for both 4.0 and 4.5 builds -->
<if test="${nant.settings.currentframework == 'net-4.5'}">
<property name="lib.dir" value="${spring.basedir}/lib/net/4.0"/>
<property name="nh32.lib.dir" value="${spring.basedir}/lib/NHibernate32/net/4.0"/>
<property name="nh33.lib.dir" value="${spring.basedir}/lib/NHibernate33/net/4.0"/>
<property name="quartz21.lib.dir" value="${spring.basedir}/lib/Quartz21/net/4.0"/>
</if>
<call target="copylibtobin"/>
<!-- build assemblies -->
<nant buildfile="src/Spring/Spring.Core/Spring.Core.build" target="build" />
<nant buildfile="src/Spring/Spring.Aop/Spring.Aop.build" target="build" if="${build-aop}"/>
<nant buildfile="src/Spring/Spring.Web/Spring.Web.build" target="build" if="${build-web}"/>
<nant buildfile="src/Spring/Spring.Web.Extensions/Spring.Web.Extensions.build" target="build" if="${build-web and (nant.settings.currentframework == 'net-3.5' or nant.settings.currentframework == 'net-4.0' or nant.settings.currentframework == 'mono-2.0')}"/>
<nant buildfile="src/Spring/Spring.Web.Mvc3/Spring.Web.Mvc3.build" target="build" if="${nant.settings.currentframework == 'net-4.0'}"/>
<nant buildfile="src/Spring/Spring.Web.Mvc4/Spring.Web.Mvc4.build" target="build" if="${nant.settings.currentframework == 'net-4.0'}"/>
<nant buildfile="src/Spring/Spring.Web.Mvc3/Spring.Web.Mvc3.build" target="build" if="${nant.settings.currentframework == 'net-4.0' or nant.settings.currentframework == 'net-4.5'}"/>
<nant buildfile="src/Spring/Spring.Web.Mvc4/Spring.Web.Mvc4.build" target="build" if="${nant.settings.currentframework == 'net-4.0' or nant.settings.currentframework == 'net-4.5'}"/>
<nant buildfile="src/Spring/Spring.Web.Mvc5/Spring.Web.Mvc5.build" target="build" if="${nant.settings.currentframework == 'net-4.5'}"/>
<nant buildfile="src/Spring/Spring.Data/Spring.Data.build" target="build" if="${build-data}"/>
<nant buildfile="src/Spring/Spring.Data.NHibernate32/Spring.Data.NHibernate32.build" target="build" if="${build-data}"/>
@@ -413,7 +450,7 @@ Commandline Examples:
<nant buildfile="src/Spring/Spring.Services/Spring.Services.build" target="build" if="${build-services}"/>
<nant buildfile="src/Spring/Spring.Testing.NUnit/Spring.Testing.NUnit.build" target="build" if="${build-testing-nunit}"/>
<nant buildfile="src/Spring/Spring.Testing.Microsoft/Spring.Testing.Microsoft.build" target="build" if="${build-testing-microsoft}"/>
<nant buildfile="src/Spring/Spring.Messaging.Ems/Spring.Messaging.Ems.build" target="build" if="${build-ems and (nant.settings.currentframework == 'net-3.5' or nant.settings.currentframework == 'net-4.0' )}"/>
<nant buildfile="src/Spring/Spring.Messaging.Ems/Spring.Messaging.Ems.build" target="build" if="${build-ems and (nant.settings.currentframework == 'net-3.5' or nant.settings.currentframework == 'net-4.0' or nant.settings.currentframework == 'net-4.5' )}"/>
<nant buildfile="src/Spring/Spring.Messaging.Nms/Spring.Messaging.Nms.build" target="build" if="${build-nms}"/>
<nant buildfile="src/Spring/Spring.Scheduling.Quartz21/Spring.Scheduling.Quartz21.build" target="build" if="${build-quartz}"/>
<nant buildfile="src/Spring/Spring.Messaging/Spring.Messaging.build" target="build" if="${build-msmq}"/>
@@ -436,8 +473,9 @@ Commandline Examples:
<nant buildfile="test/Spring/Spring.Services.Tests/Spring.Services.Tests.build" target="test" if="${build-services}"/>
<nant buildfile="test/Spring/Spring.Web.Tests/Spring.Web.Tests.build" target="test" if="${build-web}"/>
<nant buildfile="test/Spring/Spring.Web.Mvc3.Tests/Spring.Web.Mvc3.Tests.build" target="test" if="${build-web and nant.settings.currentframework == 'net-4.0'}"/>
<nant buildfile="test/Spring/Spring.Web.Mvc4.Tests/Spring.Web.Mvc4.Tests.build" target="test" if="${build-web and nant.settings.currentframework == 'net-4.0'}"/>
<nant buildfile="test/Spring/Spring.Web.Mvc3.Tests/Spring.Web.Mvc3.Tests.build" target="test" if="${build-web and nant.settings.currentframework == 'net-4.0' or nant.settings.currentframework == 'net-4.5'}"/>
<nant buildfile="test/Spring/Spring.Web.Mvc4.Tests/Spring.Web.Mvc4.Tests.build" target="test" if="${build-web and nant.settings.currentframework == 'net-4.0' or nant.settings.currentframework == 'net-4.5'}"/>
<nant buildfile="test/Spring/Spring.Web.Mvc5.Tests/Spring.Web.Mvc5.Tests.build" target="test" if="${build-web and nant.settings.currentframework == 'net-4.5'}"/>
<nant buildfile="test/Spring/Spring.Testing.NUnit.Tests/Spring.Testing.NUnit.Tests.build" target="test" if="${build-testing-nunit}"/>
<nant buildfile="test/Spring/Spring.Testing.Microsoft.Tests/Spring.Testing.Microsoft.Tests.build" target="test" if="${build-testing-microsoft}"/>
<nant buildfile="test/Spring/Spring.Messaging.Ems.Tests/Spring.Messaging.Ems.Tests.build" target="test" if="${build-ems}"/>
@@ -450,8 +488,10 @@ Commandline Examples:
<!--"Spring.ConversationWA.NH*.Tests.dll" should be at last to prevent the other tests are compiled with reference to this-->
<!-- conversation tests disabled for now because with .NET 4.5 installed NUnitAsp does not seem to work anymore -->
<nant buildfile="test/Spring/Spring.Web.Conversation.NHibernate32.Tests/Spring.Web.Conversation.NHibernate32.Tests.build" target="test" if="${build-conversation and nant.settings.currentframework == 'net-3.5'}"/>
<nant buildfile="test/Spring/Spring.Web.Conversation.NHibernate33.Tests/Spring.Web.Conversation.NHibernate33.Tests.build" target="test" if="${build-conversation and nant.settings.currentframework == 'net-3.5'}"/>
<if test="${nant.settings.currentframework == 'net-3.5'}">
<nant buildfile="test/Spring/Spring.Web.Conversation.NHibernate32.Tests/Spring.Web.Conversation.NHibernate32.Tests.build" target="test" if="${build-conversation}"/>
<nant buildfile="test/Spring/Spring.Web.Conversation.NHibernate33.Tests/Spring.Web.Conversation.NHibernate33.Tests.build" target="test" if="${build-conversation}"/>
</if>
<!-- Main solutions and examples are compiled via task build-solutions -->
@@ -472,7 +512,7 @@ Commandline Examples:
</target>
<target name="compile-net-3.5" description="Builds .NET Framework 3.5 version"
depends="set-net-3.5-runtime-configuration, check-spring-basedir, clean-current-bin-dir">
depends="set-net-3.5-runtime-configuration, check-spring-basedir, clean-current-bin-dir, restore-nuget-packages">
<if test="${property::exists('mstest.exe')}">
<property name="mstest.exe.current" value="${string::replace(property::get-value('mstest.exe'), 'Microsoft Visual Studio 10.0', 'Microsoft Visual Studio 9.0')}" />
@@ -498,7 +538,7 @@ Commandline Examples:
</target>
<target name="compile-net-4.0" description="Builds .NET Framework 4.0 version"
depends="set-net-4.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir">
depends="set-net-4.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir, restore-nuget-packages">
<property name="test.withcoverage" value="false" overwrite="true"/>
@@ -524,6 +564,38 @@ Commandline Examples:
<call target="compile-test" />
</target>
<target name="compile-net-4.5" description="Builds .NET Framework 4.5 version"
depends="set-net-4.5-runtime-configuration, check-spring-basedir, clean-current-bin-dir, restore-nuget-packages">
<property name="test.withcoverage" value="false" overwrite="true"/>
<if test="${property::exists('mstest.exe')}">
<property name="mstest.exe.current" value="${string::replace(property::get-value('mstest.exe'), 'Microsoft Visual Studio 9.0', 'Microsoft Visual Studio 10.0')}" />
</if>
<if test="${property::exists('mstest.exe')}">
<property name="vs-net.mstest.bin.dir.current" value="${string::replace(property::get-value('vs-net.mstest.bin.dir'), 'Microsoft Visual Studio 9.0', 'Microsoft Visual Studio 10.0')}" />
</if>
<call target="copykeys" if="${project.build.sign}"/>
<call target="common.generate-assemblyinfo"/>
<property name="build-ems" value="false" overwrite="true" />
<property name="build-nms" value="true" overwrite="true" />
<property name="build-quartz" value="true" overwrite="true" />
<property name="build-msmq" value="true" overwrite="true" />
<property name="build-msmq-tests" value="true" overwrite="true" />
<property name="build-velocity" value="true" overwrite="true" />
<property name="lib.dir" value="${spring.basedir}/lib/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}"/>
<if test="${nant.settings.currentframework == 'net-4.5'}">
<property name="lib.dir" value="${spring.basedir}/lib/net/4.0"/>
</if>
<call target="copylibs" />
<call target="compile-test" />
</target>
<target name="compile-mono-2.0" description="Builds MONO Framework 2.0 version"
depends="set-mono-2.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir">
<call target="copykeys" if="${project.build.sign}"/>
@@ -580,8 +652,9 @@ Commandline Examples:
<copy todir="${lib.dir}" verbose="${copy-verbose}">
<fileset basedir="${lib20.dir}">
<include name="*.dll"/>
<exclude if="${net-4.0}" name="**/System.Web.Extensions.dll"/>
<exclude if="${net-3.5}" name="**/System.Web.Extensions.dll"/>
<exclude if="${net-4.0}" name="**/System.Web.Extensions.dll"/>
<exclude if="${net-4.5}" name="**/System.Web.Extensions.dll"/>
<include name="*.xml"/>
</fileset>
</copy>
@@ -630,6 +703,24 @@ Commandline Examples:
<call target="compile-build-4.0"/>
</if>
</target>
<target name="build-4.5">
<call target="set-build-namespaces-release"/>
<echo message="------------------------"/>
<echo message="Building .NET 4.5 DEBUG "/>
<echo message="------------------------"/>
<call target="set-debug-build-configuration"/>
<call target="compile-build-4.5"/>
<if test="${property::exists('project.build.package') and project.build.package}">
<echo message="--------------------------"/>
<echo message="Building .NET 4.5 RELEASE "/>
<echo message="--------------------------"/>
<call target="set-release-build-configuration"/>
<call target="compile-build-4.5"/>
</if>
</target>
<target name="build-mono-2.0" if="false">
@@ -699,6 +790,8 @@ Commandline Examples:
<delete dir="src/Spring/Spring.Web.Mvc3/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Web.Mvc4/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Web.Mvc4/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Web.Mvc5/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Web.Mvc5/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Web.Conversation.NHibernate32/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Web.Conversation.NHibernate32/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Web.Conversation.NHibernate33/obj" failonerror="false"/>
@@ -712,6 +805,8 @@ Commandline Examples:
<delete dir="test/Spring/Spring.Web.Mvc3.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Mvc4.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Mvc4.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Mvc5.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Mvc5.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Aop.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Aop.Tests/bin" failonerror="false"/>
@@ -779,6 +874,8 @@ Commandline Examples:
<delete dir="test/Spring/Spring.Web.Mvc3.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Mvc4.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Mvc4.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Mvc5.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Mvc5.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Conversation.NHibernate32.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Conversation.NHibernate32.Tests/bin" failonerror="false"/>
@@ -1012,6 +1109,8 @@ Commandline Examples:
<call target="${nant.target.root.name}-3.5" />
<call target="${nant.target.root.name}-4.0" />
<call target="${nant.target.root.name}-4.5" />
<!-- ignore Mono 2.0 -->
<!-- <call target="${nant.target.root.name}-mono-2.0" /> -->
@@ -1039,6 +1138,16 @@ Commandline Examples:
<call target="set-release-build-configuration"/>
<call target="compile-build-4.0"/>
</target>
<target name="daily-build-4.5">
<call target="set-build-namespaces-all"/>
<call target="set-package-configuration"/>
<call target="set-debug-build-configuration"/>
<call target="compile-build-4.5"/>
<call target="set-release-build-configuration"/>
<call target="compile-build-4.5"/>
</target>
<!-- Target to use when packaging everything in CVS -->
<target name="package-cvs" description="Build and Package distribution">
@@ -1377,6 +1486,10 @@ Commandline Examples:
<include name="*/*/Spring.Web.Mvc4.xml"/>
<include name="*/*/Spring.Web.Mvc4.pdb"/>
<include name="*/*/Spring.Web.Mvc5.dll"/>
<include name="*/*/Spring.Web.Mvc5.xml"/>
<include name="*/*/Spring.Web.Mvc5.pdb"/>
<include name="*/*/Spring.Web.Extensions.dll"/>
<include name="*/*/Spring.Web.Extensions.xml"/>
<include name="*/*/Spring.Web.Extensions.pdb"/>
@@ -1631,6 +1744,7 @@ Commandline Examples:
<include name="src/Spring/Spring.Web/**"/>
<include name="src/Spring/Spring.Web.Mvc3/**"/>
<include name="src/Spring/Spring.Web.Mvc4/**"/>
<include name="src/Spring/Spring.Web.Mvc5/**"/>
<include name="src/Spring/Spring.Web.Extensions/**"/>
<include name="src/Spring/Spring.Services/**"/>
<include name="src/Spring/Spring.Data/**"/>
@@ -1652,6 +1766,7 @@ Commandline Examples:
<include name="test/Spring/Spring.Web.Tests/**"/>
<include name="test/Spring/Spring.Web.Mvc3.Tests/**"/>
<include name="test/Spring/Spring.Web.Mvc4.Tests/**"/>
<include name="test/Spring/Spring.Web.Mvc5.Tests/**"/>
<include name="test/Spring/Spring.Services.Tests/**"/>
<include name="test/Spring/Spring.Data.Tests/**"/>
<include name="test/Spring/Spring.Data.Integration.Tests/**"/>
@@ -1686,6 +1801,7 @@ Commandline Examples:
<include name="examples/Spring/Spring.WebQuickStart/**"/>
<include name="examples/Spring/Spring.Mvc3QuickStart/**"/>
<include name="examples/Spring/Spring.Mvc4QuickStart/**"/>
<include name="examples/Spring/Spring.Mvc5QuickStart/**"/>
<include name="examples/Spring/Spring.Web.Extensions.Example/**"/>
<include name="examples/Spring/Spring.Web.Extensions.Example/src/Spring.Web.Extensions.Example.2005/Bin/*.refresh"/>
<include name="examples/Spring/SpringAir/**"/>