Skip to content

Fix build failures (issue #638) and remove private C++ toolset workaround #640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<RuntimeFrameworkVersion Condition="'$(MicrosoftNETCoreAppVersion)'!='' And '$(NoTargets)'!='true' And $(TargetFramework.StartsWith('netcoreapp3.')) ">$(MicrosoftNETCoreAppVersion)</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion Condition="'$(MicrosoftNETCoreAppVersion)'!='' And '$(NoTargets)'!='true' And $(TargetFramework.StartsWith('netcoreapp3.')) And '$(WpfTest)'!='true'">$(MicrosoftNETCoreAppVersion)</RuntimeFrameworkVersion>
</PropertyGroup>

<!-- workaround for package downgrade in Microsoft.NetCore.Platforms -->
Expand Down
7 changes: 7 additions & 0 deletions eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
Condition="'$(MicrosoftNETCoreAppVersion)'!='' And '$(NoTargets)'!='true' And $(TargetFramework.StartsWith('netcoreapp3.')) And '$(MSBuildProjectExtension)'!='.vcxproj' And '$(WpfTest)'!='true'">
<TargetingPackVersion>$(MicrosoftNETCoreAppVersion)</TargetingPackVersion>
</FrameworkReference>

<!--
Workaround - this should be removed when our tests are converted from Microsoft.NET.Sdk.WindowsDesktop => Microsoft.NET.Sdk
project
-->
<KnownFrameworkReference Remove="Microsoft.AspNetCore.App"
Condition="'$(WpfTest)'=='true'" />
</ItemGroup>

<PropertyGroup>
Expand Down
36 changes: 20 additions & 16 deletions eng/WpfArcadeSdk/tools/SdkReferences.targets
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,25 @@

<Target
Name="LimitNetCoreAppReferences"
AfterTargets="ResolveAssemblyReferences"
Returns="@(ReferencePath)"
Condition="'$(PkgMicrosoft_NETCore_App)'=='' And '@(NetCoreReference)'!='' and '@(ReferencePath)' != ''">
AfterTargets="ResolveTargetingPacks"
Returns="@(Reference)"
Condition="'$(PkgMicrosoft_NETCore_App)'=='' And '@(NetCoreReference)'!='' and '@(Reference)' != ''">
<!--
Example
<NetCoreReference Include="Microsoft.CSharp" />
-->

<!--
Save Microsoft.NETCore.App.Ref assemblies, and remove those from @(ReferencePath)
Save Microsoft.NETCore.App.Ref assemblies, and remove those from @(Reference)
-->
<ItemGroup>
<_netCoreAppSdkReference Remove="@(_netCoreAppSdkReference)" />
<_netCoreAppSdkReference Include="@(ReferencePath)"
Condition="'%(ReferencePath.NuGetPackageId)'=='Microsoft.NETCore.App.Ref'" />
<_netCoreAppSdkReference Include="@(Reference)"
Condition="'%(Reference.NuGetPackageId)'=='Microsoft.NETCore.App.Ref'">
<OriginalPath>%(Reference.Identity)</OriginalPath>
</_netCoreAppSdkReference>

<ReferencePath Remove="@(_netCoreAppSdkReference)" />
<Reference Remove="@(_netCoreAppSdkReference)" />
</ItemGroup>

<ItemGroup>
Expand All @@ -94,7 +96,7 @@
</FilterItem1ByItem2>

<ItemGroup>
<ReferencePath Include="@(_netCoreAppReferences->'%(OriginalItemSpec)')" />
<Reference Include="@(_netCoreAppReferences->'%(OriginalPath)')" />
</ItemGroup>
</Target>

Expand All @@ -115,23 +117,25 @@
</Target>

<Target Name="LimitWindowsDesktopAppReferences"
AfterTargets="ResolveAssemblyReferences"
Returns="@(ReferencePath)"
Condition="'$(PkgMicrosoft_WindowsDesktop_App)'=='' And '@(WindowsDesktopReference)'!='' and '@(ReferencePath)' != ''">
AfterTargets="ResolveTargetingPacks"
Returns="@(Reference)"
Condition="'$(PkgMicrosoft_WindowsDesktop_App)'=='' And '@(WindowsDesktopReference)'!='' and '@(Reference)' != ''">
<!--
Example
<WindowsDesktopReference Include="PresentationCore" />
-->

<!--
Save Microsoft.WindowsDesktop.App.Ref assemblies, and remove those from @(ReferencePath)
Save Microsoft.WindowsDesktop.App.Ref assemblies, and remove those from @(Reference)
-->
<ItemGroup>
<_windowsDesktopAppSdkReference Remove="@(_windowsDesktopAppSdkReference)" />
<_windowsDesktopAppSdkReference Include="@(ReferencePath)"
Condition="'%(ReferencePath.NuGetPackageId)'=='Microsoft.WindowsDesktop.App.Ref'" />
<_windowsDesktopAppSdkReference Include="@(Reference)"
Condition="'%(Reference.NuGetPackageId)'=='Microsoft.WindowsDesktop.App.Ref'">
<OriginalPath>%(Reference.Identity)</OriginalPath>
</_windowsDesktopAppSdkReference>

<ReferencePath Remove="@(_windowsDesktopAppSdkReference)" />
<Reference Remove="@(_windowsDesktopAppSdkReference)" />
</ItemGroup>

<ItemGroup>
Expand All @@ -145,7 +149,7 @@
</FilterItem1ByItem2>

<ItemGroup>
<ReferencePath Include="@(_windowsDesktopAppReferences->'%(OriginalItemSpec)')" />
<Reference Include="@(_windowsDesktopAppReferences->'%(OriginalPath)')" />
</ItemGroup>
</Target>

Expand Down
17 changes: 13 additions & 4 deletions eng/WpfArcadeSdk/tools/Wpf.Cpp.props
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,20 @@
</PropertyGroup>

<PropertyGroup>
<UsePrivateFrontEnd Condition="'$(UsePrivateFrontEnd)'==''">true</UsePrivateFrontEnd>
<!--
If there is ever need to use a private C++ compiler front-end, use the logic in the commented section below,
and update global.json with the corresponding version of msvcurt-c1xx

There is also a corresponding section (also commented out) in Wpf.Cpp.targets.

msvcurt-c1xx should reference a blob hosted in azure storage that contains
msvcurt[d]_netcore.lib and c1xx.dll
-->
<!-- <UsePrivateFrontEnd Condition="'$(UsePrivateFrontEnd)'==''">true</UsePrivateFrontEnd> -->
<!-- Also update in global.json -->
<MsvcurtC1xxVersion>0.0.0.4</MsvcurtC1xxVersion>
<MsvcurtC1xxToolsPath>$(RepoRoot).tools\native\bin\msvcurt-c1xx\$(MsvcurtC1xxVersion)\$(Architecture)\</MsvcurtC1xxToolsPath>
<MsvcurtNetCoreLib>$(MsvcurtC1xxToolsPath)msvcurt$(LibSuffix)_netcore.lib</MsvcurtNetCoreLib>
<!--<MsvcurtC1xxVersion>0.0.0.4</MsvcurtC1xxVersion>-->
<!--<MsvcurtC1xxToolsPath>$(RepoRoot).tools\native\bin\msvcurt-c1xx\$(MsvcurtC1xxVersion)\$(Architecture)\</MsvcurtC1xxToolsPath>-->
<!--<MsvcurtNetCoreLib>$(MsvcurtC1xxToolsPath)msvcurt$(LibSuffix)_netcore.lib</MsvcurtNetCoreLib>-->
</PropertyGroup>

<ItemDefinitionGroup Condition="'$(UsePrivateFrontEnd)'=='true' And '$(ManagedCxx)'=='true' and '$(ExplicitCrts)'=='true'">
Expand Down
6 changes: 5 additions & 1 deletion eng/WpfArcadeSdk/tools/Wpf.Cpp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
</PropertyGroup>


<!--
See comment about UsePrivateFrontEnd in Wpf.Cpp.props
-->
<!--
<PropertyGroup>
<FrontEndPath Condition="'$(VCToolArchitecture)'=='Native32Bit'">$(MsvcurtC1xxToolsPath)HostX86\c1xx.dll</FrontEndPath>
<FrontEndPath Condition="'$(VCToolArchitecture)'=='Native64Bit'">$(MsvcurtC1xxToolsPath)HostX64\c1xx.dll</FrontEndPath>
Expand All @@ -17,7 +21,7 @@
<AdditionalOptions>%(AdditionalOptions) /fe:"$(FrontEndPath)"</AdditionalOptions>
</Link>
</ItemDefinitionGroup>

-->

<ItemDefinitionGroup>
<ClCompile>
Expand Down
9 changes: 4 additions & 5 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
{
"tools": {
"dotnet": "3.0.100-preview-010024",
"dotnet": "3.0.100-preview5-011568",
"vs": {
"version": "16.0"
"version": "16.1"
}
},
"sdk": {
"version": "3.0.100-preview-010024"
"version": "3.0.100-preview5-011568"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19252.2"
},
"native-tools": {
"strawberry-perl": "5.28.1.1-1",
"msvcurt-c1xx": "0.0.0.4"
"strawberry-perl": "5.28.1.1-1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,25 @@ private static TestKnownFailureAttribute GetTestKnownFailureAttribute(FieldInfo

public static bool IsATestType(Type type)
{
if (!type.GetCustomAttributes(typeof(TestClassAttribute), false).Any())
try
{
return false;
}
if (!type.GetCustomAttributes(typeof(TestClassAttribute), false).Any())
{
return false;
}

if (type.GetCustomAttributes(typeof(TestDisabledAttribute), false).Any())
{
return false;
}

if (type.GetCustomAttributes(typeof(TestDisabledAttribute), false).Any())
return true;
}
catch (TypeLoadException e) when (e.TypeName == "System.Runtime.CompilerServices.SuppressMergeCheckAttribute")
{
// Temporary workaround for missing type in System.Runtime
return false;
}

return true;
}

public static bool IsTestMethod(MethodInfo method)
Expand Down