2014-07-18 03:32:19 +04:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Master script for building all permutations of project * platform * configuration.
|
|
|
|
|
|
|
|
For best performance, enable parallel builds:
|
|
|
|
|
2015-04-24 22:07:11 +03:00
|
|
|
msbuild Win2D.proj /maxcpucount /nr:false
|
2014-07-18 03:32:19 +04:00
|
|
|
-->
|
|
|
|
|
|
|
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0" DefaultTargets="Build">
|
|
|
|
|
2014-09-04 02:46:39 +04:00
|
|
|
<!-- Parameters that can be configured by the caller, eg. "msbuild Win2D.proj /p:BuildPhone=false" -->
|
2014-07-18 03:32:19 +04:00
|
|
|
<PropertyGroup>
|
|
|
|
<BuildPlatforms>Win32;x64;ARM;AnyCPU</BuildPlatforms>
|
|
|
|
<BuildConfigurations>Debug;Release</BuildConfigurations>
|
|
|
|
<BuildWindows>true</BuildWindows>
|
|
|
|
<BuildPhone>true</BuildPhone>
|
2015-01-28 00:28:54 +03:00
|
|
|
<BuildUAP>true</BuildUAP>
|
2014-07-18 03:32:19 +04:00
|
|
|
<BuildTests>true</BuildTests>
|
|
|
|
<BuildTools>true</BuildTools>
|
2014-08-12 08:37:27 +04:00
|
|
|
<BuildDocs>true</BuildDocs>
|
2014-07-26 01:52:36 +04:00
|
|
|
<RunTests>true</RunTests>
|
2014-07-18 03:32:19 +04:00
|
|
|
</PropertyGroup>
|
|
|
|
|
2015-01-28 00:28:54 +03:00
|
|
|
<PropertyGroup>
|
|
|
|
<Has81Sdk Condition="'$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot81)' != ''">true</Has81Sdk>
|
|
|
|
<Has10Sdk Condition="'$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot10)' != ''">true</Has10Sdk>
|
2015-04-16 01:39:12 +03:00
|
|
|
|
|
|
|
<ShouldRunUAPTests>false</ShouldRunUAPTests>
|
2015-04-16 20:03:52 +03:00
|
|
|
<ShouldRunUAPTests Condition="'$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion@CurrentBuildNumber)' >= '10000'">true</ShouldRunUAPTests>
|
2015-01-28 00:28:54 +03:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<!-- Disable building targets when the SDK isn't installed -->
|
|
|
|
|
|
|
|
<PropertyGroup Condition="'$(Has81Sdk)' != 'true' and $(BuildWindows)">
|
|
|
|
<BuildWindows>false</BuildWindows>
|
|
|
|
<SkippedBuildWindows>true</SkippedBuildWindows>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<PropertyGroup Condition="'$(Has81Sdk)' != 'true' and $(BuildPhone)">
|
|
|
|
<BuildPhone>false</BuildPhone>
|
|
|
|
<SkippedBuildPhone>true</SkippedBuildPhone>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<PropertyGroup Condition="'$(Has10Sdk)' != 'true' and $(BuildUAP)">
|
|
|
|
<BuildUAP>false</BuildUAP>
|
|
|
|
<SkippedBuildUAP>true</SkippedBuildUAP>
|
|
|
|
</PropertyGroup>
|
2014-07-26 01:52:36 +04:00
|
|
|
|
|
|
|
<!-- Set default platforms for each project type -->
|
2014-07-18 03:32:19 +04:00
|
|
|
<ItemDefinitionGroup>
|
|
|
|
<WindowsProject>
|
|
|
|
<Platforms>Win32;x64;ARM</Platforms>
|
2015-01-28 00:28:54 +03:00
|
|
|
<BinDir>Windows</BinDir>
|
2014-07-18 03:32:19 +04:00
|
|
|
</WindowsProject>
|
|
|
|
<PhoneProject>
|
|
|
|
<Platforms>Win32;ARM</Platforms>
|
2015-01-28 00:28:54 +03:00
|
|
|
<BinDir>Phone</BinDir>
|
2014-07-18 03:32:19 +04:00
|
|
|
</PhoneProject>
|
2015-01-28 00:28:54 +03:00
|
|
|
<UAPProject>
|
2015-03-11 20:59:26 +03:00
|
|
|
<Platforms>Win32;x64;ARM</Platforms>
|
2015-01-28 00:28:54 +03:00
|
|
|
<BinDir>UAP</BinDir>
|
|
|
|
</UAPProject>
|
2014-07-18 03:32:19 +04:00
|
|
|
<AnyCPUProject>
|
|
|
|
<Platforms>AnyCPU</Platforms>
|
2015-01-28 00:28:54 +03:00
|
|
|
<BinDir>Windows</BinDir>
|
2014-07-18 03:32:19 +04:00
|
|
|
</AnyCPUProject>
|
|
|
|
</ItemDefinitionGroup>
|
|
|
|
|
2014-07-26 01:52:36 +04:00
|
|
|
|
2014-07-18 03:32:19 +04:00
|
|
|
<!-- Windows projects implementing the Canvas API -->
|
|
|
|
<ItemGroup Condition="$(BuildWindows)">
|
2014-07-26 01:52:36 +04:00
|
|
|
<WindowsProject Include="winrt\lib\winrt.lib.Windows.vcxproj" />
|
|
|
|
<WindowsProject Include="winrt\dll\winrt.dll.Windows.vcxproj" />
|
|
|
|
<WindowsProject Include="numerics\DotNet\DotNetNumerics.Windows.csproj" />
|
2014-07-18 03:32:19 +04:00
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<!-- Windows Phone projects implementing the Canvas API -->
|
|
|
|
<ItemGroup Condition="$(BuildPhone)">
|
2014-07-26 01:52:36 +04:00
|
|
|
<PhoneProject Include="winrt\lib\winrt.lib.WindowsPhone.vcxproj" />
|
|
|
|
<PhoneProject Include="winrt\dll\winrt.dll.WindowsPhone.vcxproj" />
|
|
|
|
<PhoneProject Include="numerics\DotNet\DotNetNumerics.WindowsPhone.csproj" />
|
2014-07-18 03:32:19 +04:00
|
|
|
</ItemGroup>
|
|
|
|
|
2015-01-28 00:28:54 +03:00
|
|
|
<!-- UAP projects implementing the Canvas API -->
|
|
|
|
<ItemGroup Condition="$(BuildUAP)">
|
|
|
|
<UAPProject Include="winrt\lib\winrt.lib.uap.vcxproj" />
|
|
|
|
<UAPProject Include="winrt\dll\winrt.dll.uap.vcxproj" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
2014-07-18 03:32:19 +04:00
|
|
|
<!-- Windows test projects -->
|
|
|
|
<ItemGroup Condition="$(BuildWindows) and $(BuildTests)">
|
2015-01-28 00:28:54 +03:00
|
|
|
<WindowsProject Include="winrt\test.internal\winrt.test.internal.Windows.vcxproj">
|
2014-07-18 03:32:19 +04:00
|
|
|
<Platforms>Win32;x64</Platforms>
|
2014-07-26 01:52:36 +04:00
|
|
|
<AutomatedTests>desktop</AutomatedTests>
|
|
|
|
</WindowsProject>
|
|
|
|
<WindowsProject Include="winrt\test.external\winrt.test.external.Windows.vcxproj">
|
|
|
|
<AutomatedTests>store</AutomatedTests>
|
|
|
|
</WindowsProject>
|
WinRT IVector<T> implementation
I could not find any existing implementations that were sufficiently complete,
high quality, supported collections of runtime types as well as interfaces and
value types, and were under a suitable open source license, so had to write my
own. Hopefully this Vector.h will fill that hole for others with similar needs
in future!
Features:
- Implements IVector<T> and IIterable<T>, but not IObservableVector<T>
- T can be interface, runtime class, or value type, and is factored such that
strings can easily be added if/when needed.
- Vectors may optionally be locked to a fixed size, in which case users can
change their elements but not add/remove elements.
- Vectors track a dirty flag so their owner can tell when their contents
changed. This is a lightweight internal-only mechanism rather than full
IObservableVector implementation to avoid complications with event handlers
causing circular refcount chains.
- By default vectors own their content data (internally using an STL
collection) but there is also an option to wrap them around some other source
so as to just provide a WinRT API surface on top of any other data.
- Provides an internal mechanism to get direct access to the STL container
inside a WinRT vector, so API implementations can work directly with this
rather than having to go through the overhead of WinRT vtable dispatch and
exception boundaries for every get/set/iterate operation.
2014-08-26 07:24:14 +04:00
|
|
|
<WindowsProject Include="winrt\test.nativecomponent\winrt.test.nativecomponent.Windows.vcxproj" />
|
2014-07-26 01:52:36 +04:00
|
|
|
<WindowsProject Include="winrt\test.managed\Windows\winrt.test.managed.Windows.csproj">
|
|
|
|
<AutomatedTests>store</AutomatedTests>
|
2014-07-18 03:32:19 +04:00
|
|
|
</WindowsProject>
|
2015-03-10 02:22:10 +03:00
|
|
|
<WindowsProject Include="tests\CoreWindowExample\Windows\CoreWindowExample.Windows.csproj" />
|
2014-07-18 03:32:19 +04:00
|
|
|
<WindowsProject Include="tests\CsConsumer\Windows\CsConsumer.Windows.csproj" />
|
2015-04-24 22:07:11 +03:00
|
|
|
<WindowsProject Include="tests\ExampleGallery\Direct3DInterop\Windows\ExampleGallery.Direct3DInterop.Windows.vcxproj">
|
|
|
|
<BuildInParallel>false</BuildInParallel>
|
|
|
|
</WindowsProject>
|
2014-07-26 03:35:34 +04:00
|
|
|
<WindowsProject Include="tests\ExampleGallery\Windows\ExampleGallery.Windows.csproj" />
|
2014-07-26 01:52:36 +04:00
|
|
|
<WindowsProject Include="numerics\Cpp\tests\CppNumericsTests.Windows.vcxproj">
|
|
|
|
<AutomatedTests>store</AutomatedTests>
|
|
|
|
</WindowsProject>
|
|
|
|
<WindowsProject Include="numerics\DotNet\tests\Windows\DotNetNumericsTests.Windows.csproj">
|
|
|
|
<AutomatedTests>store</AutomatedTests>
|
|
|
|
</WindowsProject>
|
2014-12-16 02:17:15 +03:00
|
|
|
<WindowsProject Include="numerics\Cpp\perftest\CppNumericsPerfTest.vcxproj">
|
|
|
|
<Platforms>Win32;x64</Platforms>
|
|
|
|
</WindowsProject>
|
2014-07-18 03:32:19 +04:00
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<!-- Windows Phone test projects -->
|
|
|
|
<ItemGroup Condition="$(BuildPhone) and $(BuildTests)">
|
|
|
|
<PhoneProject Include="winrt\test.external\winrt.test.external.WindowsPhone.vcxproj" />
|
WinRT IVector<T> implementation
I could not find any existing implementations that were sufficiently complete,
high quality, supported collections of runtime types as well as interfaces and
value types, and were under a suitable open source license, so had to write my
own. Hopefully this Vector.h will fill that hole for others with similar needs
in future!
Features:
- Implements IVector<T> and IIterable<T>, but not IObservableVector<T>
- T can be interface, runtime class, or value type, and is factored such that
strings can easily be added if/when needed.
- Vectors may optionally be locked to a fixed size, in which case users can
change their elements but not add/remove elements.
- Vectors track a dirty flag so their owner can tell when their contents
changed. This is a lightweight internal-only mechanism rather than full
IObservableVector implementation to avoid complications with event handlers
causing circular refcount chains.
- By default vectors own their content data (internally using an STL
collection) but there is also an option to wrap them around some other source
so as to just provide a WinRT API surface on top of any other data.
- Provides an internal mechanism to get direct access to the STL container
inside a WinRT vector, so API implementations can work directly with this
rather than having to go through the overhead of WinRT vtable dispatch and
exception boundaries for every get/set/iterate operation.
2014-08-26 07:24:14 +04:00
|
|
|
<PhoneProject Include="winrt\test.nativecomponent\winrt.test.nativecomponent.WindowsPhone.vcxproj" />
|
2014-07-18 03:32:19 +04:00
|
|
|
<PhoneProject Include="winrt\test.managed\WindowsPhone\winrt.test.managed.WindowsPhone.csproj" />
|
2015-03-10 02:22:10 +03:00
|
|
|
<PhoneProject Include="tests\CoreWindowExample\WindowsPhone\CoreWindowExample.WindowsPhone.csproj" />
|
2014-07-18 03:32:19 +04:00
|
|
|
<PhoneProject Include="tests\CsConsumer\WindowsPhone\CsConsumer.WindowsPhone.csproj" />
|
2015-04-24 22:07:11 +03:00
|
|
|
<PhoneProject Include="tests\ExampleGallery\Direct3DInterop\WindowsPhone\ExampleGallery.Direct3DInterop.WindowsPhone.vcxproj">
|
|
|
|
<BuildInParallel>false</BuildInParallel>
|
|
|
|
</PhoneProject>
|
2014-07-26 03:35:34 +04:00
|
|
|
<PhoneProject Include="tests\ExampleGallery\WindowsPhone\ExampleGallery.WindowsPhone.csproj"/>
|
2014-07-18 03:32:19 +04:00
|
|
|
<PhoneProject Include="numerics\Cpp\tests\CppNumericsTests.WindowsPhone.vcxproj" />
|
|
|
|
<PhoneProject Include="numerics\DotNet\tests\WindowsPhone\DotNetNumericsTests.WindowsPhone.csproj" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
2015-01-28 00:28:54 +03:00
|
|
|
<!-- UAP test projects -->
|
|
|
|
<ItemGroup Condition="$(BuildUAP) and $(BuildTests)">
|
|
|
|
<UAPProject Include="winrt\test.internal\winrt.test.internal.uap.vcxproj">
|
|
|
|
<Platforms>Win32;x64</Platforms>
|
2015-04-16 01:39:12 +03:00
|
|
|
<AutomatedTests Condition="$(ShouldRunUAPTests)">desktop</AutomatedTests>
|
2015-01-28 00:28:54 +03:00
|
|
|
</UAPProject>
|
|
|
|
<UAPProject Include="winrt\test.external\winrt.test.external.uap.vcxproj">
|
2015-04-16 01:39:12 +03:00
|
|
|
<AutomatedTests Condition="$(ShouldRunUAPTests)">store</AutomatedTests>
|
2015-01-28 00:28:54 +03:00
|
|
|
</UAPProject>
|
|
|
|
<UAPProject Include="winrt\test.nativecomponent\winrt.test.nativecomponent.uap.vcxproj" />
|
|
|
|
<UAPProject Include="winrt\test.managed\UAP\winrt.test.managed.uap.csproj">
|
2015-04-16 01:39:12 +03:00
|
|
|
<!-- <AutomatedTests Condition="$(ShouldRunUAPTests)">store</AutomatedTests> TODO: reenable managed UAP tests
|
|
|
|
-->
|
2015-01-28 00:28:54 +03:00
|
|
|
</UAPProject>
|
|
|
|
<UAPProject Include="tests\CsConsumer\UAP\CsConsumer.uap.csproj" />
|
|
|
|
<UAPProject Include="tests\ExampleGallery\UAP\ExampleGallery.uap.csproj" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
2015-03-13 23:30:43 +03:00
|
|
|
<!-- Restore NuGet packages for all projects -->
|
|
|
|
<ItemGroup Condition="$(BuildTests)">
|
|
|
|
<PackagesConfig Include="tests\**\packages.config" />
|
|
|
|
<PackagesConfig Include="winrt\**\packages.config" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
2014-07-18 03:32:19 +04:00
|
|
|
<!-- Tools projects -->
|
|
|
|
<ItemGroup Condition="$(BuildTools)">
|
|
|
|
<AnyCPUProject Include="tools\copyright\copyright.csproj" />
|
|
|
|
<AnyCPUProject Include="tools\codegen\exe\codegen.exe.csproj" />
|
2014-07-26 01:52:36 +04:00
|
|
|
<AnyCPUProject Include="tools\codegen\test\codegen.test.csproj" Condition="$(BuildTests)">
|
|
|
|
<AutomatedTests>desktop</AutomatedTests>
|
2014-07-18 03:32:19 +04:00
|
|
|
</AnyCPUProject>
|
2015-02-26 03:20:43 +03:00
|
|
|
<AnyCPUProject Include="tools\mock\exe\mock.exe.csproj" />
|
|
|
|
<AnyCPUProject Include="tools\mock\test\mock.test.csproj" Condition="$(BuildTests)">
|
|
|
|
<AutomatedTests>desktop</AutomatedTests>
|
|
|
|
</AnyCPUProject>
|
2014-08-14 04:45:08 +04:00
|
|
|
<AnyCPUProject Include="tools\docs\DocDiff\DocDiff.csproj" />
|
2014-08-12 08:37:27 +04:00
|
|
|
<AnyCPUProject Include="tools\docs\ExtractAPISurface\ExtractAPISurface.csproj" />
|
2014-08-12 08:55:09 +04:00
|
|
|
<AnyCPUProject Include="tools\docs\MergeIntellisense\MergeIntellisense.csproj" />
|
2014-07-18 03:32:19 +04:00
|
|
|
</ItemGroup>
|
|
|
|
|
2014-07-26 01:52:36 +04:00
|
|
|
|
|
|
|
<!-- Master target just chains to a bunch of workers -->
|
|
|
|
<Target Name="Build"
|
2014-08-12 08:37:27 +04:00
|
|
|
DependsOnTargets="BuildProjects; CheckCopyrightBanners; BuildDocs; RunTests" />
|
2014-07-26 01:52:36 +04:00
|
|
|
|
|
|
|
|
|
|
|
<!-- Use batching to build each project in turn -->
|
|
|
|
<Target Name="BuildProjects"
|
2015-03-13 23:30:43 +03:00
|
|
|
DependsOnTargets="PrepareVersionInfo; ChooseProjectsToBuild; ListSkippedTargets; RestoreNuGetPackages"
|
2014-07-26 01:52:36 +04:00
|
|
|
Inputs="@(ProjectsToBuild)"
|
|
|
|
Outputs="%(PlatformIndependentName)">
|
|
|
|
|
|
|
|
<Message Importance="High" Text="Building all variants of project %(ProjectsToBuild.PlatformIndependentName):" />
|
|
|
|
<Message Importance="High" Text=" %(ProjectsToBuild.Filename) (%(ProjectsToBuild.Configuration)|%(ProjectsToBuild.Platform))" />
|
|
|
|
|
2015-04-24 22:07:11 +03:00
|
|
|
<!-- All the variants (platform and configuration) of most projects can be built in parallel -->
|
|
|
|
<MSBuild Projects="@(ProjectsToBuild)" BuildInParallel="%(ProjectsToBuild.BuildInParallel)" Properties="IncludeVersionInfo=true" />
|
2014-07-26 01:52:36 +04:00
|
|
|
</Target>
|
|
|
|
|
2014-07-18 03:32:19 +04:00
|
|
|
|
|
|
|
<Target Name="ChooseProjectsToBuild">
|
|
|
|
<ItemGroup>
|
|
|
|
<!-- Expand parameter properties into item groups, so we can batch over them -->
|
|
|
|
<BuildPlatform Include="$(BuildPlatforms)" />
|
|
|
|
<BuildConfiguration Include="$(BuildConfigurations)" />
|
|
|
|
|
|
|
|
<!-- Generate the cartesian product of all projects * all platforms we are building -->
|
2015-01-28 00:28:54 +03:00
|
|
|
<CandidateProjects Include="@(WindowsProject);@(PhoneProject);@(UAPProject);@(AnyCPUProject)">
|
2014-07-18 03:32:19 +04:00
|
|
|
<Platform>%(BuildPlatform.Identity)</Platform>
|
|
|
|
</CandidateProjects>
|
|
|
|
|
|
|
|
<!-- Filter the list to include only project/platform pairs where the project actually supports that platform -->
|
|
|
|
<FilteredProjects Include="@(CandidateProjects)" Condition="$([System.String]::new('%(CandidateProjects.Platforms)').Contains('%(CandidateProjects.Platform)'))" />
|
|
|
|
|
|
|
|
<!-- Generate the cartesian product of our filtered project list * the configurations we are building -->
|
|
|
|
<ProjectsPerConfig Include="@(FilteredProjects)">
|
|
|
|
<Configuration>%(BuildConfiguration.Identity)</Configuration>
|
|
|
|
</ProjectsPerConfig>
|
|
|
|
|
2014-07-26 01:52:36 +04:00
|
|
|
<!-- Move platform and configuration into the AdditionalProperties metadata, and generate a
|
2015-03-13 20:12:45 +03:00
|
|
|
platform independent name that will be the same for Windows, Phone and UAP project variants -->
|
2014-07-18 03:32:19 +04:00
|
|
|
<ProjectsToBuild Include="@(ProjectsPerConfig)">
|
|
|
|
<AdditionalProperties>Platform=%(ProjectsPerConfig.Platform);Configuration=%(ProjectsPerConfig.Configuration)</AdditionalProperties>
|
2015-03-13 20:12:45 +03:00
|
|
|
<PlatformIndependentName>$([System.String]::new('%(ProjectsPerConfig.Filename)').Replace('Windows', '').Replace('Phone', '').Replace('uap', '').TrimEnd('.'))</PlatformIndependentName>
|
2015-04-24 22:07:11 +03:00
|
|
|
<BuildInParallel Condition="'%(ProjectsPerConfig.BuildInParallel)' == ''">true</BuildInParallel>
|
2014-07-18 03:32:19 +04:00
|
|
|
</ProjectsToBuild>
|
|
|
|
</ItemGroup>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
|
2014-10-31 00:45:51 +03:00
|
|
|
<Target Name="PrepareVersionInfo">
|
|
|
|
<MakeDir Directories="obj" />
|
|
|
|
|
|
|
|
<!-- Read the current Win2D version number -->
|
|
|
|
<ReadLinesFromFile File="build\nuget\VERSION">
|
|
|
|
<Output TaskParameter="Lines" PropertyName="Win2DVersion" />
|
|
|
|
</ReadLinesFromFile>
|
|
|
|
|
|
|
|
<!-- Read the SHA-1 hash for git HEAD, so we can later identify exactly what code went into this build -->
|
|
|
|
<Exec Command="git rev-parse --verify HEAD > obj\Win2D.githash.txt" IgnoreExitCode="true">
|
|
|
|
<Output TaskParameter="ExitCode" PropertyName="GitExitCode" />
|
|
|
|
</Exec>
|
|
|
|
|
|
|
|
<WriteLinesToFile Condition="$(GitExitCode) != 0" File ="obj\Win2D.githash.txt" Lines="unknown git hash" />
|
|
|
|
|
|
|
|
<ReadLinesFromFile File="obj\Win2D.githash.txt">
|
|
|
|
<Output TaskParameter="Lines" PropertyName="GitHash" />
|
|
|
|
</ReadLinesFromFile>
|
|
|
|
|
|
|
|
<!-- Generate AssemblyVersion.cs, which adds the latest version info to managed assembly outputs -->
|
|
|
|
<ItemGroup>
|
|
|
|
<AssemblyVersionCode Include="[assembly: System.Reflection.AssemblyVersion("$(Win2DVersion)")]" />
|
|
|
|
<AssemblyVersionCode Include="[assembly: System.Reflection.AssemblyFileVersion("$(Win2DVersion)")]" />
|
|
|
|
<AssemblyVersionCode Include="[assembly: System.Reflection.AssemblyInformationalVersionAttribute("$(Win2DVersion) ($(GitHash))")]" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<ReadLinesFromFile File="obj\AssemblyVersion.cs">
|
|
|
|
<Output TaskParameter="Lines" ItemName="ExistingAssemblyVersion" />
|
|
|
|
</ReadLinesFromFile>
|
|
|
|
|
|
|
|
<WriteLinesToFile Condition="@(AssemblyVersionCode) != @(ExistingAssemblyVersion)" File="obj\AssemblyVersion.cs" Lines="@(AssemblyVersionCode)" Overwrite="true" />
|
|
|
|
|
|
|
|
<!-- Also generate DllVersion.h, which adds version info to native DLLs -->
|
|
|
|
<ItemGroup>
|
|
|
|
<DllVersionCode Include="#define DLL_VERSION $(Win2DVersion.Replace('.', ','))" />
|
|
|
|
<DllVersionCode Include="#define DLL_VERSION_STRING "$(Win2DVersion)"" />
|
|
|
|
<DllVersionCode Include="#define DLL_VERSION_STRING_LONG "$(Win2DVersion) ($(GitHash))"" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<ReadLinesFromFile File="obj\DllVersion.h">
|
|
|
|
<Output TaskParameter="Lines" ItemName="ExistingDllVersion" />
|
|
|
|
</ReadLinesFromFile>
|
|
|
|
|
|
|
|
<WriteLinesToFile Condition="@(DllVersionCode) != @(ExistingDllVersion)" File="obj\DllVersion.h" Lines="@(DllVersionCode)" Overwrite="true" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
|
2014-07-26 01:52:36 +04:00
|
|
|
<!-- Make sure all our source files have the right copyright -->
|
|
|
|
<Target Name="CheckCopyrightBanners"
|
|
|
|
Condition="$(BuildTools) and $(BuildPlatforms.Contains('AnyCPU')) and $(BuildConfigurations.Contains('Release'))">
|
|
|
|
|
|
|
|
<Message Importance="High" Text="Checking copyright banners" />
|
|
|
|
|
|
|
|
<MSBuild Projects="tools\copyright\CheckCopyrightBanners.proj" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
|
2014-08-12 08:37:27 +04:00
|
|
|
<!-- Build the reference documentation -->
|
2015-03-12 23:48:39 +03:00
|
|
|
<UsingTask TaskName="SetEnv" AssemblyFile="$(VCTargetsPath)Microsoft.Build.CppTasks.Common.dll"/>
|
|
|
|
|
2014-08-12 08:37:27 +04:00
|
|
|
<Target Name="BuildDocs"
|
|
|
|
Condition="$(BuildDocs) and
|
|
|
|
$(BuildTools) and
|
|
|
|
$(BuildWindows) and
|
|
|
|
$(BuildPlatforms.Contains('AnyCPU')) and
|
|
|
|
$(BuildPlatforms.Contains('Win32')) and
|
|
|
|
$(BuildConfigurations.Contains('Release'))">
|
|
|
|
|
|
|
|
<Message Importance="High" Text="Building documentation" />
|
|
|
|
|
2015-03-12 23:48:39 +03:00
|
|
|
<!-- unset SHFBROOT, so that BuildDocs only picks up the version of
|
|
|
|
sandcastle installed via nuget -->
|
|
|
|
<SetEnv Name="SHFBROOT" Prefix="false" />
|
|
|
|
|
2015-03-12 22:49:53 +03:00
|
|
|
<!-- Use <Exec> rather than <MSBuild> here, since we want BuildDocs.proj to
|
|
|
|
be isolated from the environment that's formed around running
|
|
|
|
Win2D.proj up to this point -->
|
|
|
|
<Exec Command="msbuild $(MSBuildThisFileDirectory)tools\docs\BuildDocs.proj" />
|
2014-08-12 08:37:27 +04:00
|
|
|
</Target>
|
|
|
|
|
|
|
|
|
2014-07-26 01:52:36 +04:00
|
|
|
<!-- Run the automated tests -->
|
2015-01-28 00:28:54 +03:00
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
<_VsTestPathUnderCommonTools>..\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe</_VsTestPathUnderCommonTools>
|
|
|
|
<_VsTest Condition="Exists('$(VS120COMNTOOLS)$(_VsTestPathUnderCommonTools)')">$(VS120COMNTOOLS)$(_VsTestPathUnderCommonTools)</_VsTest>
|
|
|
|
<_VsTest Condition="Exists('$(VS140COMNTOOLS)$(_VsTestPathUnderCommonTools)')">$(VS140COMNTOOLS)$(_VsTestPathUnderCommonTools)</_VsTest>
|
|
|
|
<VsTest>"$([System.IO.Path]::GetFullPath('$(_VsTest)'))"</VsTest>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
2014-07-26 01:52:36 +04:00
|
|
|
<Target Name="RunTests"
|
|
|
|
Condition="$(BuildTests) and $(RunTests)"
|
|
|
|
DependsOnTargets="ChooseProjectsToBuild; ChooseTestsToRun"
|
|
|
|
Inputs="@(TestProjects)"
|
|
|
|
Outputs="%(TestProjects.TestAppX)">
|
|
|
|
|
|
|
|
<Message Importance="High" Text="Running tests: %(TestProjects.Filename) (%(TestProjects.Configuration)|%(TestProjects.Platform))" />
|
|
|
|
|
2015-01-28 00:28:54 +03:00
|
|
|
<Exec Command="$(VsTest) %(TestProjects.TestBinary)%(TestProjects.TestArgs)" ContinueOnError="ErrorAndContinue" IgnoreStandardErrorWarningFormat="true" />
|
2014-07-26 01:52:36 +04:00
|
|
|
</Target>
|
|
|
|
|
|
|
|
|
|
|
|
<Target Name="ChooseTestsToRun">
|
|
|
|
<ItemGroup>
|
|
|
|
<TestProjects Include="@(ProjectsToBuild)" Condition="%(ProjectsToBuild.AutomatedTests) != '' and %(ProjectsToBuild.Platform) != ARM">
|
|
|
|
<!-- Remap Win32 to x86 -->
|
|
|
|
<TestPlatform Condition="%(ProjectsToBuild.Platform) == Win32">x86</TestPlatform>
|
|
|
|
<TestPlatform Condition="%(ProjectsToBuild.Platform) != Win32">%(ProjectsToBuild.Platform)</TestPlatform>
|
|
|
|
|
|
|
|
<!-- Work out where the test binaries are located -->
|
2015-01-28 00:28:54 +03:00
|
|
|
<TestPath>bin\%(ProjectsToBuild.BinDir)%(TestProjects.TestPlatform)\%(ProjectsToBuild.Configuration)</TestPath>
|
2014-07-26 01:52:36 +04:00
|
|
|
|
|
|
|
<TestAppX Condition="%(ProjectsToBuild.Configuration) == Release">%(ProjectsToBuild.Filename)_1.0.0.0_%(ProjectsToBuild.Platform)</TestAppX>
|
|
|
|
<TestAppX Condition="%(ProjectsToBuild.Configuration) != Release">%(ProjectsToBuild.Filename)_1.0.0.0_%(ProjectsToBuild.Platform)_%(ProjectsToBuild.Configuration)</TestAppX>
|
|
|
|
|
|
|
|
<!-- Binaries can be either a .dll for desktop tests, or .appx for store app tests -->
|
|
|
|
<TestBinary Condition="%(ProjectsToBuild.AutomatedTests) == desktop">%(TestProjects.TestPath)\%(ProjectsToBuild.Filename)\%(ProjectsToBuild.Filename).dll</TestBinary>
|
|
|
|
<TestBinary Condition="%(ProjectsToBuild.AutomatedTests) == store">%(TestProjects.TestPath)\%(ProjectsToBuild.Filename)\AppPackages\%(TestProjects.TestAppX)_Test\%(TestProjects.TestAppX).appx</TestBinary>
|
|
|
|
|
|
|
|
<!-- Do we need the /Platform or /InIsolation arguments for this test project? -->
|
|
|
|
<TestArgs Condition="%(ProjectsToBuild.Platform) == x64">%(TestProjects.TestArgs) /Platform:x64</TestArgs>
|
|
|
|
<TestArgs Condition="%(ProjectsToBuild.Platform) == x64 or %(ProjectsToBuild.AutomatedTests) == store">%(TestProjects.TestArgs) /InIsolation</TestArgs>
|
|
|
|
</TestProjects>
|
|
|
|
</ItemGroup>
|
2014-07-18 03:32:19 +04:00
|
|
|
</Target>
|
2014-08-12 08:37:27 +04:00
|
|
|
|
2015-01-28 00:28:54 +03:00
|
|
|
|
|
|
|
<Target Name="ListSkippedTargets">
|
|
|
|
<Warning Condition="'$(SkippedBuildWindows)' == 'true'"
|
|
|
|
Text="Skipped building for Windows 8.1 since Windows 8.1 SDK is not installed." />
|
|
|
|
|
|
|
|
<Warning Condition="'$(SkippedBuildPhone)' == 'true'"
|
|
|
|
Text="Skipped building for Windows Phone 8.1 since Windows 8.1 SDK is not installed." />
|
|
|
|
|
|
|
|
<Warning Condition="'$(SkippedBuildUAP)' == 'true'"
|
|
|
|
Text="Skipped building for Windows 10 UAP since Windows 10 SDK is not installed." />
|
|
|
|
</Target>
|
|
|
|
|
2015-03-13 23:30:43 +03:00
|
|
|
<Import Project="$(MsBuildThisFileDirectory)build\nuget-restore.targets" />
|
|
|
|
|
2014-07-18 03:32:19 +04:00
|
|
|
</Project>
|