|
12 | 12 | Version="$(MicrosoftNETCorePlatformsVersion)"
|
13 | 13 | Condition="'$(ManagedCxx)'=='true'"/>
|
14 | 14 |
|
15 |
| - <FrameworkReference Update="Microsoft.NETCore.App" |
16 |
| - Condition="'$(MicrosoftNETCoreAppRefVersion)'!='' |
17 |
| - And '$(NoTargets)'!='true' |
18 |
| - And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' |
19 |
| - And $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '3.0')) |
20 |
| - And '$(MSBuildProjectExtension)'!='.vcxproj'"> |
21 |
| - <TargetingPackVersion>$(MicrosoftNETCoreAppRefVersion)</TargetingPackVersion> |
22 |
| - </FrameworkReference> |
23 |
| - |
24 | 15 | <!--
|
25 | 16 | Workaround - this should be removed when our tests are converted from Microsoft.NET.Sdk.WindowsDesktop => Microsoft.NET.Sdk
|
26 | 17 | project
|
27 | 18 | -->
|
28 | 19 | <KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
|
29 | 20 | </ItemGroup>
|
30 | 21 |
|
| 22 | + <!-- The below logic intentionally doesn't consider multiple .NETCoreApp TFMs as that isn't necessary at this point. --> |
| 23 | + <PropertyGroup> |
| 24 | + <UseOOBNETCoreAppTargetingPack Condition="'$(UseOOBNETCoreAppTargetingPack)' == '' and '$(MicrosoftNETCoreAppRefVersion)' != ''">true</UseOOBNETCoreAppTargetingPack> |
| 25 | + <UseOOBNETCoreAppRuntimePack Condition="'$(UseOOBNETCoreAppRuntimePack)' == '' and '$(MicrosoftNETCoreAppRuntimewinx64Version)' != ''">true</UseOOBNETCoreAppRuntimePack> |
| 26 | + <UseOOBNETCoreAppAppHostPack Condition="'$(UseOOBNETCoreAppAppHostPack)' == '' and '$(MicrosoftNETCoreAppRuntimewinx64Version)' != ''">true</UseOOBNETCoreAppAppHostPack> |
| 27 | + </PropertyGroup> |
| 28 | + |
| 29 | + <ItemGroup> |
| 30 | + <KnownFrameworkReference Update="Microsoft.NETCore.App"> |
| 31 | + <TargetingPackVersion Condition="'$(UseOOBNETCoreAppTargetingPack)' == 'true'">$(MicrosoftNETCoreAppRefVersion)</TargetingPackVersion> |
| 32 | + <DefaultRuntimeFrameworkVersion Condition="'$(UseOOBNETCoreAppRuntimePack)' == 'true'">$(MicrosoftNETCoreAppRuntimewinx64Version)</DefaultRuntimeFrameworkVersion> |
| 33 | + <LatestRuntimeFrameworkVersion Condition="'$(UseOOBNETCoreAppRuntimePack)' == 'true'">$(MicrosoftNETCoreAppRuntimewinx64Version)</LatestRuntimeFrameworkVersion> |
| 34 | + </KnownFrameworkReference> |
| 35 | + |
| 36 | + <KnownRuntimePack Update="Microsoft.NETCore.App" |
| 37 | + LatestRuntimeFrameworkVersion="$(MicrosoftNETCoreAppRuntimewinx64Version)" |
| 38 | + Condition="'$(UseOOBNETCoreAppRuntimePack)' == 'true'" /> |
| 39 | + |
| 40 | + <KnownAppHostPack Update="Microsoft.NETCore.App" |
| 41 | + AppHostPackVersion="$(MicrosoftNETCoreAppRuntimewinx64Version)" |
| 42 | + Condition="'$(UseOOBNETCoreAppAppHostPack)' == 'true'" /> |
| 43 | + </ItemGroup> |
| 44 | + |
| 45 | + <!-- These properties can be removed when vcxproj's NuGet support gets enabled. --> |
31 | 46 | <PropertyGroup>
|
32 |
| - <RuntimeFrameworkVersion Condition="'$(MicrosoftNETCoreAppRuntimewinx64Version)'!='' And |
33 |
| - '$(NoTargets)'!='true' And |
34 |
| - '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And |
35 |
| - $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '3.0')) And |
36 |
| - '$(MSBuildProjectExtension)'!='.vcxproj'">$(MicrosoftNETCoreAppRuntimewinx64Version)</RuntimeFrameworkVersion> |
| 47 | + <EnableTargetingPackDownload Condition="'$(UseOOBNETCoreAppTargetingPack)' == 'true' and '$(MSBuildProjectExtension)' == '.vcxproj'">false</EnableTargetingPackDownload> |
| 48 | + <EnableRuntimePackDownload Condition="'$(UseOOBNETCoreAppRuntimePack)' == 'true' and '$(MSBuildProjectExtension)' == '.vcxproj'">false</EnableRuntimePackDownload> |
| 49 | + <GenerateErrorForMissingTargetingPacks Condition="'$(EnableTargetingPackDownload)' == 'false'">false</GenerateErrorForMissingTargetingPacks> |
| 50 | + |
| 51 | + <EnableAppHostPackDownload Condition="'$(UseOOBNETCoreAppAppHostPack)' == 'true' and '$(MSBuildProjectExtension)' == '.vcxproj'">false</EnableAppHostPackDownload> |
37 | 52 | </PropertyGroup>
|
| 53 | + |
| 54 | + <!-- Update paths for resolved packs which is necessary when the packs couldn't be resolved. |
| 55 | + This happens when package download is disabled and the package isn't available in the SDK's packs folder. |
| 56 | + This entire target can be removed when vcxproj's NuGet support gets enabled. --> |
| 57 | + <Target Name="UpdateOOBPacks" |
| 58 | + Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" |
| 59 | + AfterTargets="ResolveFrameworkReferences"> |
| 60 | + <ItemGroup> |
| 61 | + <Error Text="'MicrosoftNETCoreAppRefVersion' is not set. Please set it to the version of the targeting pack you want to use." Condition="'$(UseOOBNETCoreAppTargetingPack)' == 'true' and '$(MicrosoftNETCoreAppRefVersion)' == ''" /> |
| 62 | + <Error Text="'MicrosoftNETCoreAppRuntimewinx64Version' is not set. Please set it to the version of the runtime pack you want to use." Condition="('$(UseOOBNETCoreAppRuntimePack)' == 'true' or '$(UseOOBNETCoreAppAppHostPack)' == 'true') and '$(MicrosoftNETCoreAppRuntimewinx64Version)' == ''" /> |
| 63 | + |
| 64 | + <ResolvedTargetingPack Path="$(NuGetPackageRoot)microsoft.netcore.app.ref\$(MicrosoftNETCoreAppRefVersion)" |
| 65 | + NuGetPackageVersion="$(MicrosoftNETCoreAppRefVersion)" |
| 66 | + PackageDirectory="$(NuGetPackageRoot)microsoft.netcore.app.ref\$(MicrosoftNETCoreAppRefVersion)" |
| 67 | + Condition="'$(UseOOBNETCoreAppTargetingPack)' == 'true' and '$(EnableTargetingPackDownload)' == 'false' and '%(ResolvedTargetingPack.RuntimeFrameworkName)' == 'Microsoft.NETCore.App'" /> |
| 68 | + |
| 69 | + <ResolvedRuntimePack PackageDirectory="$(NuGetPackageRoot)microsoft.netcore.app.runtime.%(RuntimeIdentifier)\$(MicrosoftNETCoreAppRuntimewinx64Version)" |
| 70 | + NuGetPackageVersion="$(MicrosoftNETCoreAppRuntimewinx64Version)" |
| 71 | + Condition="'$(UseOOBNETCoreAppRuntimePack)' == 'true' and '$(EnableRuntimePackDownload)' == 'false' and '%(ResolvedRuntimePack.FrameworkName)' == 'Microsoft.NETCore.App'" /> |
| 72 | + </ItemGroup> |
| 73 | + |
| 74 | + <PropertyGroup> |
| 75 | + <_ResolvedRuntimePackPath>@(ResolvedRuntimePack->WithMetadataValue('FrameworkName', 'Microsoft.NETCore.App')->Metadata('Path'))</_ResolvedRuntimePackPath> |
| 76 | + </PropertyGroup> |
| 77 | + |
| 78 | + <ItemGroup> |
| 79 | + <ResolvedFrameworkReference Condition="'%(Identity)' == 'Microsoft.NETCore.App'"> |
| 80 | + <TargetingPackPath Condition="'$(UseOOBNETCoreAppTargetingPack)' == 'true' and '$(EnableTargetingPackDownload)' == 'false'">$(NuGetPackageRoot)microsoft.netcore.app.ref\$(MicrosoftNETCoreAppRefVersion)</TargetingPackPath> |
| 81 | + <TargetingPackVersion Condition="'$(UseOOBNETCoreAppTargetingPack)' == 'true' and '$(EnableTargetingPackDownload)' == 'false'">$(MicrosoftNETCoreAppRefVersion)</TargetingPackVersion> |
| 82 | + <RuntimePackPath Condition="'$(UseOOBNETCoreAppRuntimePack)' == 'true' and '$(EnableRuntimePackDownload)' == 'false'">$(_ResolvedRuntimePackPath)</RuntimePackPath> |
| 83 | + <RuntimePackVersion Condition="'$(UseOOBNETCoreAppRuntimePack)' == 'true' and '$(EnableRuntimePackDownload)' == 'false'">$(MicrosoftNETCoreAppRuntimewinx64Version)</RuntimePackVersion> |
| 84 | + </ResolvedFrameworkReference> |
| 85 | + |
| 86 | + <ResolvedAppHostPack Path="$(NuGetPackageRoot)microsoft.netcore.app.host.%(RuntimeIdentifier)\$(MicrosoftNETCoreAppRuntimewinx64Version)\%(ResolvedAppHostPack.PathInPackage)" |
| 87 | + PackageDirectory="$(NuGetPackageRoot)microsoft.netcore.app.host.%(RuntimeIdentifier)\$(MicrosoftNETCoreAppRuntimewinx64Version)" |
| 88 | + Condition="'$(UseOOBNETCoreAppAppHostPack)' == 'true' and '$(EnableAppHostPackDownload)' == 'false'" /> |
| 89 | + |
| 90 | + <ResolvedIjwHostPack Path="$(NuGetPackageRoot)microsoft.netcore.app.host.%(RuntimeIdentifier)\$(MicrosoftNETCoreAppRuntimewinx64Version)\%(ResolvedIjwHostPack.PathInPackage)" |
| 91 | + PackageDirectory="$(NuGetPackageRoot)microsoft.netcore.app.host.%(RuntimeIdentifier)\$(MicrosoftNETCoreAppRuntimewinx64Version)" |
| 92 | + Condition="'$(UseOOBNETCoreAppAppHostPack)' == 'true' and '$(EnableAppHostPackDownload)' == 'false'" /> |
| 93 | + </ItemGroup> |
| 94 | + |
| 95 | + <PropertyGroup Condition="'@(ResolvedAppHostPack)' != '' And '$(AppHostSourcePath)' == ''"> |
| 96 | + <AppHostSourcePath>@(ResolvedAppHostPack->'%(Path)')</AppHostSourcePath> |
| 97 | + </PropertyGroup> |
| 98 | + |
| 99 | + <PropertyGroup Condition="'@(ResolvedIjwHostPack)' != '' And '$(IjwHostSourcePath)' == ''"> |
| 100 | + <IjwHostSourcePath>@(ResolvedIjwHostPack->'%(Path)')</IjwHostSourcePath> |
| 101 | + </PropertyGroup> |
| 102 | + </Target> |
| 103 | + |
38 | 104 | </Project>
|
0 commit comments