Skip to content

Commit

Permalink
Merge pull request #48404 from jasonmalinowski/fix-integration-tests
Browse files Browse the repository at this point in the history
Upgrade our .NET SDK to 5.0 RC 1
  • Loading branch information
jasonmalinowski authored Oct 8, 2020
2 parents f21b5ea + 1cb96c5 commit f3ef882
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 6 deletions.
6 changes: 6 additions & 0 deletions eng/targets/Imports.targets
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,10 @@
</ItemGroup>
</Target>

<!-- Override this to work around https://github.com/dotnet/sdk/issues/13427. The property doesn't
appear to be used for anything other than controlling the warning. -->
<PropertyGroup>
<_MicrosoftWindowsDesktopSdkImported>false</_MicrosoftWindowsDesktopSdkImported>
</PropertyGroup>

</Project>
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"sdk": {
"version": "5.0.100-preview.8.20417.9",
"version": "5.0.100-rc.1.20452.10",
"allowPrerelease": true,
"rollForward": "major"
},
"tools": {
"dotnet": "5.0.100-preview.8.20417.9",
"dotnet": "5.0.100-rc.1.20452.10",
"vs": {
"version": "16.8"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#nullable enable

#if !NET5_0

namespace System.Runtime.Versioning
{
/// <summary>
/// Base type for all platform-specific API attributes.
/// </summary>
internal abstract class OSPlatformAttribute : Attribute
{
private protected OSPlatformAttribute(string platformName)
{
PlatformName = platformName;
}

public string PlatformName { get; }
}

/// <summary>
/// Records the platform that the project targeted.
/// </summary>
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)]
internal sealed class TargetPlatformAttribute : OSPlatformAttribute
{
public TargetPlatformAttribute(string platformName)
: base(platformName)
{
}
}

/// <summary>
/// Records the operating system (and minimum version) that supports an API. Multiple attributes can be
/// applied to indicate support on multiple operating systems.
/// </summary>
/// <remarks>
/// <para>Callers can apply a <see cref="SupportedOSPlatformAttribute" />
/// or use guards to prevent calls to APIs on unsupported operating systems.</para>
///
/// <para>A given platform should only be specified once.</para>
/// </remarks>
[AttributeUsage(
AttributeTargets.Assembly
| AttributeTargets.Class
| AttributeTargets.Constructor
| AttributeTargets.Enum
| AttributeTargets.Event
| AttributeTargets.Field
| AttributeTargets.Method
| AttributeTargets.Module
| AttributeTargets.Property
| AttributeTargets.Struct,
AllowMultiple = true, Inherited = false)]
internal sealed class SupportedOSPlatformAttribute : OSPlatformAttribute
{
public SupportedOSPlatformAttribute(string platformName)
: base(platformName)
{
}
}

/// <summary>
/// Marks APIs that were removed in a given operating system version.
/// </summary>
/// <remarks>
/// Primarily used by OS bindings to indicate APIs that are only available in
/// earlier versions.
/// </remarks>
[AttributeUsage(
AttributeTargets.Assembly
| AttributeTargets.Class
| AttributeTargets.Constructor
| AttributeTargets.Enum
| AttributeTargets.Event
| AttributeTargets.Field
| AttributeTargets.Method
| AttributeTargets.Module
| AttributeTargets.Property
| AttributeTargets.Struct,
AllowMultiple = true, Inherited = false)]
internal sealed class UnsupportedOSPlatformAttribute : OSPlatformAttribute
{
public UnsupportedOSPlatformAttribute(string platformName)
: base(platformName)
{
}
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
#If DEBUG Then
' Compile time asserts.
Private Const s_delegateRelaxationLevelMask_AssertZero = SmallFieldMask.DelegateRelaxationLevelMask - ConversionKind.DelegateRelaxationLevelMask
Private _delegateRelaxationLevelMask_Assert1(s_delegateRelaxationLevelMask_AssertZero) As Boolean
Private _delegateRelaxationLevelMask_Assert2(-s_delegateRelaxationLevelMask_AssertZero) As Boolean
Private ReadOnly _delegateRelaxationLevelMask_Assert1(s_delegateRelaxationLevelMask_AssertZero) As Boolean
Private ReadOnly _delegateRelaxationLevelMask_Assert2(-s_delegateRelaxationLevelMask_AssertZero) As Boolean

Private Const s_inferenceLevelMask_AssertZero = CByte((SmallFieldMask.InferenceLevelMask >> SmallFieldMask.InferenceLevelShift) <> ((TypeArgumentInference.InferenceLevel.Invalid << 1) - 1))
Private _inferenceLevelMask_Assert1(s_inferenceLevelMask_AssertZero) As Boolean
Private _inferenceLevelMask_Assert2(-s_inferenceLevelMask_AssertZero) As Boolean
Private ReadOnly _inferenceLevelMask_Assert1(s_inferenceLevelMask_AssertZero) As Boolean
Private ReadOnly _inferenceLevelMask_Assert2(-s_inferenceLevelMask_AssertZero) As Boolean
#End If
Public Structure OptionalArgument
Public ReadOnly DefaultValue As BoundExpression
Expand Down
4 changes: 4 additions & 0 deletions src/Interactive/HostProcess/InteractiveHost32.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<ProjectReference Include="..\Host\Microsoft.CodeAnalysis.InteractiveHost.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\..\Compilers\Core\Portable\InternalUtilities\PlatformAttributes.cs" Link="Utilities\PlatformAttributes.cs" />
</ItemGroup>

<!--
InteractiveHost32 is deployed to the same directory as InteractiveHost64 as it shares the same dependencies.
Expand Down
4 changes: 4 additions & 0 deletions src/Interactive/HostProcess/InteractiveHost64.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<ProjectReference Include="..\Host\Microsoft.CodeAnalysis.InteractiveHost.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\..\Compilers\Core\Portable\InternalUtilities\PlatformAttributes.cs" Link="Utilities\PlatformAttributes.cs" />
</ItemGroup>

<Target Name="PublishProjectOutputGroup" DependsOnTargets="Publish" Returns="@(_PublishedFiles)">
<ItemGroup>
<!-- Need to include and then update items (https://github.com/microsoft/msbuild/issues/1053) -->
Expand Down
4 changes: 4 additions & 0 deletions src/Interactive/HostProcess/InteractiveHostEntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
Expand All @@ -13,6 +14,7 @@ namespace Microsoft.CodeAnalysis.Interactive
{
internal static class InteractiveHostEntryPoint
{
[SupportedOSPlatform("windows")]
private static async Task<int> Main(string[] args)
{
FatalError.Handler = FailFast.OnFatalException;
Expand Down Expand Up @@ -51,9 +53,11 @@ private static async Task<int> Main(string[] args)
}
}

[SupportedOSPlatform("windows")]
[DllImport("kernel32", PreserveSig = true)]
internal static extern ErrorMode SetErrorMode(ErrorMode mode);

[SupportedOSPlatform("windows")]
[DllImport("kernel32", PreserveSig = true)]
internal static extern ErrorMode GetErrorMode();

Expand Down

0 comments on commit f3ef882

Please sign in to comment.