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>
|
2017-05-19 22:50:08 +03:00
|
|
|
<RunningFrom2017Prompt Condition="'$(VisualStudioVersion)' >= '15.0'">true</RunningFrom2017Prompt>
|
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>
|
|
|
|
|
2017-05-19 22:50:08 +03:00
|
|
|
<PropertyGroup Condition="('$(Has10Sdk)' != 'true' or '$(RunningFrom2017Prompt)' != 'true') and $(BuildUAP)">
|
2015-01-28 00:28:54 +03:00
|
|
|
<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>
|
2016-03-03 05:37:48 +03:00
|
|
|
<WindowsProject Include="winrt\test.external\Windows\winrt.test.external.Windows.vcxproj">
|
2014-07-26 01:52:36 +04:00
|
|
|
<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-05-28 23:14:35 +03:00
|
|
|
<WindowsProject Include="samples\SimpleSample\Windows\SimpleSample.Windows.csproj" />
|
2015-05-22 02:14:29 +03:00
|
|
|
<WindowsProject Include="samples\CoreWindowExample\Windows\CoreWindowExample.Windows.csproj" />
|
|
|
|
<WindowsProject Include="samples\ExampleGallery\Direct3DInterop\Windows\ExampleGallery.Direct3DInterop.Windows.vcxproj">
|
2015-04-24 22:07:11 +03:00
|
|
|
<BuildInParallel>false</BuildInParallel>
|
|
|
|
</WindowsProject>
|
2015-07-24 03:03:45 +03:00
|
|
|
<WindowsProject Include="samples\ExampleGallery\BackgroundTask\Windows\ExampleGallery.BackgroundTask.Windows.csproj" />
|
2015-05-22 02:14:29 +03:00
|
|
|
<WindowsProject Include="samples\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)">
|
2016-03-03 05:37:48 +03:00
|
|
|
<PhoneProject Include="winrt\test.external\WindowsPhone\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-05-28 23:14:35 +03:00
|
|
|
<PhoneProject Include="samples\SimpleSample\WindowsPhone\SimpleSample.WindowsPhone.csproj" />
|
2015-05-22 02:14:29 +03:00
|
|
|
<PhoneProject Include="samples\CoreWindowExample\WindowsPhone\CoreWindowExample.WindowsPhone.csproj" />
|
|
|
|
<PhoneProject Include="samples\ExampleGallery\Direct3DInterop\WindowsPhone\ExampleGallery.Direct3DInterop.WindowsPhone.vcxproj">
|
2015-04-24 22:07:11 +03:00
|
|
|
<BuildInParallel>false</BuildInParallel>
|
|
|
|
</PhoneProject>
|
2015-07-24 03:03:45 +03:00
|
|
|
<PhoneProject Include="samples\ExampleGallery\BackgroundTask\WindowsPhone\ExampleGallery.BackgroundTask.WindowsPhone.csproj"/>
|
2015-05-22 02:14:29 +03:00
|
|
|
<PhoneProject Include="samples\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>
|
2016-03-03 05:37:48 +03:00
|
|
|
<UAPProject Include="winrt\test.external\UAP\winrt.test.external.uap.vcxproj">
|
|
|
|
<Platforms>Win32;x64</Platforms>
|
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-06-03 00:00:07 +03:00
|
|
|
<AutomatedTests Condition="$(ShouldRunUAPTests)">store</AutomatedTests>
|
2015-01-28 00:28:54 +03:00
|
|
|
</UAPProject>
|
2015-05-29 00:05:32 +03:00
|
|
|
<UAPProject Include="samples\SimpleSample\UAP\SimpleSample.uap.csproj" />
|
2015-05-29 02:10:39 +03:00
|
|
|
<UAPProject Include="samples\CoreWindowExample\UAP\CoreWindowExample.uap.csproj" />
|
2015-10-14 01:15:48 +03:00
|
|
|
<UAPProject Include="samples\CompositionExample\CompositionExample.csproj" />
|
2015-07-30 04:20:05 +03:00
|
|
|
<UAPProject Include="samples\ExampleGallery\Direct3DInterop\UAP\ExampleGallery.Direct3DInterop.uap.vcxproj">
|
|
|
|
<BuildInParallel>false</BuildInParallel>
|
|
|
|
</UAPProject>
|
2015-07-02 18:48:01 +03:00
|
|
|
<UAPProject Include="samples\ExampleGallery\BackgroundTask\UAP\ExampleGallery.BackgroundTask.uap.csproj" />
|
2015-05-22 02:14:29 +03:00
|
|
|
<UAPProject Include="samples\ExampleGallery\UAP\ExampleGallery.uap.csproj" />
|
2015-01-28 00:28:54 +03:00
|
|
|
</ItemGroup>
|
|
|
|
|
2014-07-18 03:32:19 +04:00
|
|
|
<!-- Tools projects -->
|
|
|
|
<ItemGroup Condition="$(BuildTools)">
|
2016-01-09 00:35:42 +03:00
|
|
|
<AnyCPUProject Include="tools\checkcode\checkcode.csproj" />
|
2014-07-18 03:32:19 +04:00
|
|
|
<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" />
|
2015-08-11 02:09:41 +03:00
|
|
|
<AnyCPUProject Include="tools\docs\DocPreprocess\DocPreprocess.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" />
|
2015-05-22 22:12:09 +03:00
|
|
|
<AnyCPUProject Include="tools\exportsample\exportsample.csproj" />
|
2014-07-18 03:32:19 +04:00
|
|
|
</ItemGroup>
|
|
|
|
|
2015-07-25 01:07:26 +03:00
|
|
|
<!-- Restore NuGet packages for all projects -->
|
|
|
|
<ItemGroup>
|
2015-09-17 22:11:48 +03:00
|
|
|
<NuGetRestore Include="samples\**\packages.config" Condition="$(BuildTests)" />
|
|
|
|
<NuGetRestore Include="samples\**\project.json" Condition="$(BuildUAP) and $(BuildTests)" />
|
|
|
|
<NuGetRestore Include="winrt\**\project.json" Condition="$(BuildUAP) and $(BuildTests)" />
|
|
|
|
<NuGetRestore Include="numerics\**\project.json" Condition="$(BuildUAP)" />
|
|
|
|
<NuGetRestore Include="tools\exportsample\packages.config" Condition="$(BuildTools)" />
|
2015-07-25 01:07:26 +03:00
|
|
|
</ItemGroup>
|
|
|
|
|
2014-07-26 01:52:36 +04:00
|
|
|
|
|
|
|
<!-- Master target just chains to a bunch of workers -->
|
|
|
|
<Target Name="Build"
|
2016-01-09 00:35:42 +03:00
|
|
|
DependsOnTargets="BuildProjects; CheckCode; 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>
|
|
|
|
|
|
|
|
|
2016-01-09 00:35:42 +03:00
|
|
|
<!-- Make sure all our source files have the right copyright and formatting -->
|
|
|
|
<Target Name="CheckCode"
|
2015-05-30 01:13:41 +03:00
|
|
|
Condition="$(BuildTools) and $(BuildPlatforms.Contains('AnyCPU'))">
|
2014-07-26 01:52:36 +04:00
|
|
|
|
2016-01-09 00:35:42 +03:00
|
|
|
<Message Importance="High" Text="Checking copyright banners and source code formatting" />
|
2014-07-26 01:52:36 +04:00
|
|
|
|
2016-01-09 00:35:42 +03:00
|
|
|
<MSBuild Projects="tools\checkcode\RunCodeChecks.proj" />
|
2014-07-26 01:52:36 +04:00
|
|
|
</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
|
2015-11-03 00:46:39 +03:00
|
|
|
$(BuildUAP) and
|
2014-08-12 08:37:27 +04:00
|
|
|
$(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
|
2015-12-01 02:56:56 +03:00
|
|
|
Win2D.proj up to this point, and to suppress the Sandcastle
|
|
|
|
false positive warning BHT0001 -->
|
2016-09-19 18:36:58 +03:00
|
|
|
<Exec Command="msbuild $(MSBuildThisFileDirectory)tools\docs\BuildDocs.proj"
|
2015-12-01 02:56:56 +03:00
|
|
|
IgnoreStandardErrorWarningFormat="true"
|
|
|
|
CustomErrorRegularExpression=": error "
|
|
|
|
CustomWarningRegularExpression=": warning (?!BHT0001)" />
|
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." />
|
|
|
|
|
2015-07-25 01:57:08 +03:00
|
|
|
<Warning Condition="'$(SkippedBuildUAP)' == 'true' and '$(Has10Sdk)' != 'true'"
|
2015-01-28 00:28:54 +03:00
|
|
|
Text="Skipped building for Windows 10 UAP since Windows 10 SDK is not installed." />
|
2015-07-25 01:57:08 +03:00
|
|
|
|
2017-05-19 22:50:08 +03:00
|
|
|
<Warning Condition="'$(SkippedBuildUAP)' == 'true' and '$(Has10Sdk)' == 'true' and '$(RunningFrom2017Prompt)' != 'true'"
|
|
|
|
Text="Skipped building for Windows 10 UAP since not running from a MSBuild Command Prompt for VS2017" />
|
2015-01-28 00:28:54 +03:00
|
|
|
</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>
|