only automatically generate projection for release config

This commit is contained in:
Scott Jones 2019-10-24 13:48:06 -07:00
Родитель 3c34f8564c
Коммит 5082125ba6
4 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -2,6 +2,7 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildTestProjection Condition="'$(BuildTestProjection)$(Configuration)' == 'Release'">true</BuildTestProjection>
<RemoveWindowsReference>true</RemoveWindowsReference>
</PropertyGroup>
@ -10,7 +11,7 @@
<Exec Command="xcopy /D /Y &quot;$(OutDir)TestComp\TestComp.pdb&quot; &quot;$(TargetDir)&quot;" />
</Target>
<Target Name="ProjectTestComponent" BeforeTargets="CoreCompile">
<Target Name="ProjectTestComponent" BeforeTargets="CoreCompile" Condition="'$(BuildTestProjection)' == 'true'">
<Exec Command="$(CsWinrtExe) -verbose -in $(OutDir)TestComp\TestComp.winmd local -out &quot;$(ProjectDir)Generated Files&quot; -include TestComp -include Windows.Foundation -exclude Windows.Foundation.Diagnostics -exclude Windows.Foundation.Metadata" />
<ItemGroup>
<Compile Include="$(ProjectDir)Generated Files/*.cs" Exclude="@(Compile)" />

Просмотреть файл

@ -2,10 +2,11 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildTestProjection Condition="'$(BuildTestProjection)$(Configuration)' == 'Release'">true</BuildTestProjection>
<RemoveWindowsReference>true</RemoveWindowsReference>
</PropertyGroup>
<Target Name="ProjectWinUI" BeforeTargets="CoreCompile">
<Target Name="ProjectWinUI" BeforeTargets="CoreCompile" Condition="'$(BuildTestProjection)' == 'true'">
<ItemGroup>
<!--PkgMicrosoft_UI_Xaml is defined by Nuget reference-->
<WinUIWinMDs Include="$(PkgMicrosoft_UI_Xaml)/**/*.winmd" />

Просмотреть файл

@ -1,13 +1,13 @@
This project simply generates and compiles a complete projection of Windows SDK and WinUI metadata.
With a release cswinrt.exe, it takes < 1s to generate all of the projection sources.
With debug, it takes a minute. With Test Explorer and other IDE features that
implcitly invoke the compiler, this may interfere - will fiddle.
With debug, it takes a minute. So only release builds create the projection by default.
This can be overridden by explicitly setting the BuildTestProjection property.
This project assumes a private nuget source has been created, pointing to:
https://microsoft.pkgs.visualstudio.com/_packaging/WinUI-Xaml-CI@IXP/nuget/v3/index.json
For usability (until the cswinrt nuget has msbulid support), this and the UnitTest projects
For usability (until the cswinrt nuget has msbuild support), this and the UnitTest projects
both make use of Directory.Build.* files to create the projection, stage binaries, etc.
WinUITest uses a response file to generate the projection, which can be supplied as a

Просмотреть файл

@ -14,6 +14,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cswinrt", "cswinrt\cswinrt.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinUITest", "WinUITest\WinUITest.csproj", "{AD0BD44A-D9B5-419C-90D0-B017AEE09C85}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Files", "Build Files", "{96495AB4-2D86-47D1-A174-27D0B436DC98}"
ProjectSection(SolutionItems) = preProject
build.cmd = build.cmd
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU