Pbt.props 2.3 KB
Newer Older
1 2
<Project>
  <PropertyGroup>
3 4 5 6
    <LocalMicrosoftWinFXTargets>$(RepoRoot)src\Microsoft.DotNet.Wpf\src\PresentationBuildTasks\Microsoft.WinFX.targets</LocalMicrosoftWinFXTargets>
  </PropertyGroup>

  <PropertyGroup Condition="Exists('$(LocalMicrosoftWinFXTargets)')">
7 8 9 10
    <PbtTfm Condition="'$(MSBuildRuntimeType)'=='Core'">netcoreapp2.1</PbtTfm>
    <PbtTfm Condition="'$(MSBuildRuntimeType)'!='Core'">net472</PbtTfm>
  </PropertyGroup>

11
  <PropertyGroup Condition="Exists('$(LocalMicrosoftWinFXTargets)')">
12 13 14
    <PbtDir>$(ArtifactsTmpDir)PresentationBuildTasks\$(PbtTfm)\</PbtDir>
  </PropertyGroup>

15 16 17
  <!--
    Local markup compilation uses $(InternalMarkupCompilation) instead of $(UseWpf). Suppress the
    corresponding SDK warning.
18 19 20 21 22
  -->
  <PropertyGroup>
    <MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);NETSDK1106</MSBuildWarningsAsMessages>
  </PropertyGroup>

23
  <!--
24
    We will use Microsoft.NET.Sdk.WindowsDesktop targets directly when local PresentationBuildTasks is not available
25 26 27
    We do not need to import Microsoft.NET.Sdk.WindowsDesktop.props from the Sdk - this only provides us with
    WPF references and Page, ApplicationDefinition globbing functionality - neither of which is used by our projects.

28
    If we had needed to use this props file, we'd have imported it like this:
29

30 31 32 33 34 35
    <PropertyGroup Condition="!Exists('$(LocalMicrosoftWinFXTargets)') And '$(InternalMarkupCompilation)'=='true'">
      <UseWpf>true</UseWpf>
    </PropertyGroup>
    <Import Sdk="Microsoft.NET.Sdk.WindowsDesktop"
            Project="../targets/Microsoft.NET.Sdk.WindowsDesktop.props"
            Condition="!Exists('$(LocalMicrosoftWinFXTargets)') And '$(InternalMarkupCompilation)'=='true'"/>
36 37

    The use of Microsoft.NET.Sdk.WindowsDesktop doesn't break the source-build promise.
38
      - Microsoft.NET.Sdk.WindowsDesktop is built from sources
39
      - It is used for compilation of assemblies in dotnet-wpf-int (the internal WPF repo), and serves as a
40
        'transport package' for PresentationBuildTasks.dll and related props+targets file.
41
      - When the corresponding projects move from dotnet-wpf-int to dotnet/wpf in the future, their build will
42
        fall back to use local PBT project outputs for their compilation (instead of using WindowsDesktop Sdk package
43
        as a convenient 'transport package').
44
  -->
45

46
</Project>