Skip to content

Commit 1d60f87

Browse files
committedMar 26, 2024
Target net8 and net9, use CPM
1 parent b0dc714 commit 1d60f87

15 files changed

+219
-22
lines changed
 

‎Directory.Packages.props

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
8+
<PackageVersion Include="System.Text.RegularExpressions" Version="8.0.0" />
9+
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
10+
<PackageVersion Include="System.Reflection.Metadata" Version="8.0.0" />
11+
<PackageVersion Include="Microsoft.CodeAnalysis.PooledObjects" Version="4.11.0-1.24176.7" />
12+
<PackageVersion Include="Microsoft.CodeAnalysis.Debugging" Version="4.11.0-1.24176.7" />
13+
</ItemGroup>
14+
</Project>

‎NuGet.config

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
<configuration>
33
<packageSources>
44
<clear />
5-
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
6-
<add key="dotnet5-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json" />
75
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
86
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
97
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
8+
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
9+
<add key="dotnet9-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9-transport/nuget/v3/index.json" />
10+
<!-- Feeds for command-line-api -->
11+
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
1012
</packageSources>
1113
<disabledPackageSources>
1214
<clear />

‎eng/Versions.props

+2-10
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,8 @@
33
<Project>
44
<PropertyGroup>
55
<!-- This repo version -->
6-
<VersionPrefix>1.0.0</VersionPrefix>
7-
<PreReleaseVersionLabel>beta3</PreReleaseVersionLabel>
6+
<VersionPrefix>2.0.0</VersionPrefix>
7+
<PreReleaseVersionLabel>beta1</PreReleaseVersionLabel>
88
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
9-
<!-- Libs -->
10-
<MicrosoftCodeAnalysisPooledObjectsVersion>3.6.0-beta1-20111-10</MicrosoftCodeAnalysisPooledObjectsVersion>
11-
<MicrosoftCodeAnalysisDebuggingVersion>3.6.0-beta1-20111-10</MicrosoftCodeAnalysisDebuggingVersion>
12-
<!-- CoreFX -->
13-
<SystemCollectionsImmutableVersion>1.5.0</SystemCollectionsImmutableVersion>
14-
<SystemReflectionMetadataVersion>1.6.0</SystemReflectionMetadataVersion>
15-
<SystemTextRegularExpressionsVersion>4.3.0</SystemTextRegularExpressionsVersion>
16-
<SystemValueTupleVersion>4.5.0</SystemValueTupleVersion>
179
</PropertyGroup>
1810
</Project>

‎src/Directory.Build.props

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
<PropertyGroup>
77
<LangVersion>Preview</LangVersion>
88
<PackageLicenseExpression>MIT</PackageLicenseExpression>
9-
</PropertyGroup>
9+
10+
<!-- TODO: https://github.com/dotnet/roslyn/issues/71667 -->
11+
<NoWarn>$(NoWarn);NU1507</NoWarn>
12+
</PropertyGroup>
1013
</Project>

‎src/Microsoft.Metadata.Visualizer.Tests/Microsoft.Metadata.Visualizer.UnitTests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!-- 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.txt file in the project root for more information. -->
33
<Project Sdk="Microsoft.NET.Sdk">
44
<PropertyGroup>
5-
<TargetFramework>net472</TargetFramework>
5+
<TargetFrameworks>net472;$(NetCurrent)</TargetFrameworks>
66
</PropertyGroup>
77
<ItemGroup>
88
<ProjectReference Include="..\Microsoft.Metadata.Visualizer\Microsoft.Metadata.Visualizer.csproj" />

‎src/Microsoft.Metadata.Visualizer/ILVisualizer.cs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the License.txt file in the project root for more information.
44

5+
#nullable disable
6+
57
using System.Collections.Immutable;
68
using System;
79
using System.Collections.Generic;

‎src/Microsoft.Metadata.Visualizer/MetadataVisualizer.ILVisualizer.cs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the License.txt file in the project root for more information.
44

5+
#nullable disable
6+
57
using System.Reflection.Emit;
68
using System.Reflection.Metadata;
79
using System.Reflection.Metadata.Ecma335;

‎src/Microsoft.Metadata.Visualizer/MetadataVisualizer.SignatureVisualizer.cs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the License.txt file in the project root for more information.
44

5+
#nullable disable
6+
57
using System.Collections.Immutable;
68
using System.Reflection.Metadata;
79
using System.Text;

‎src/Microsoft.Metadata.Visualizer/MetadataVisualizer.cs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the License.txt file in the project root for more information.
44

5+
#nullable disable
6+
57
using System;
68
using System.Collections.Generic;
79
using System.Collections.Immutable;

‎src/Microsoft.Metadata.Visualizer/Microsoft.Metadata.Visualizer.csproj

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<!-- 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.txt file in the project root for more information. -->
33
<Project Sdk="Microsoft.NET.Sdk">
44
<PropertyGroup>
5-
<TargetFramework>netstandard2.0</TargetFramework>
5+
<TargetFrameworks>net472;$(NetCurrent);$(NetMinimum)</TargetFrameworks>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
7+
<Nullable>enable</Nullable>
78
<GenerateDocumentationFile>true</GenerateDocumentationFile>
9+
810
<IsPackable>true</IsPackable>
911
<Description>Tool for diagnosing and displaying content of ECMA335 metadata files and Portable PDBs.</Description>
1012
<PackageReleaseNotes></PackageReleaseNotes>
1113
<PackageTags>EMCA-335 metadata Portable PDB visualizer</PackageTags>
1214
</PropertyGroup>
1315
<ItemGroup>
14-
<PackageReference Include="Microsoft.CodeAnalysis.PooledObjects" Version="$(MicrosoftCodeAnalysisPooledObjectsVersion)" PrivateAssets="all" />
15-
<PackageReference Include="Microsoft.CodeAnalysis.Debugging" Version="$(MicrosoftCodeAnalysisDebuggingVersion)" PrivateAssets="all" />
16-
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutableVersion)" />
17-
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
18-
<PackageReference Include="System.ValueTuple" Version="$(SystemValueTupleVersion)" />
16+
<PackageReference Include="Microsoft.CodeAnalysis.PooledObjects" PrivateAssets="all" />
17+
<PackageReference Include="Microsoft.CodeAnalysis.Debugging" PrivateAssets="all" />
18+
<PackageReference Include="System.Collections.Immutable" />
19+
<PackageReference Include="System.Reflection.Metadata" />
20+
<PackageReference Include="System.ValueTuple" />
1921
</ItemGroup>
2022

2123
<!-- Workaround for https://github.com/NuGet/Home/issues/4856 -->

‎src/Microsoft.Metadata.Visualizer/StringUtilities.cs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the License.txt file in the project root for more information.
44

5+
#nullable disable
6+
57
using System.Globalization;
68
using System.Text;
79

‎src/Microsoft.Metadata.Visualizer/Utilities/Hash.cs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the License.txt file in the project root for more information.
44

5+
#nullable disable
6+
57
using System;
68
using System.Collections.Generic;
79
using System.Collections.Immutable;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
// This was copied from https://github.com/dotnet/runtime/blob/39b9607807f29e48cae4652cd74735182b31182e/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs
6+
// and updated to have the scope of the attributes be internal.
7+
namespace System.Diagnostics.CodeAnalysis
8+
{
9+
#if !NETCOREAPP
10+
11+
/// <summary>Specifies that null is allowed as an input even if the corresponding type disallows it.</summary>
12+
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
13+
internal sealed class AllowNullAttribute : Attribute { }
14+
15+
/// <summary>Specifies that null is disallowed as an input even if the corresponding type allows it.</summary>
16+
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
17+
internal sealed class DisallowNullAttribute : Attribute { }
18+
19+
/// <summary>Specifies that an output may be null even if the corresponding type disallows it.</summary>
20+
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
21+
internal sealed class MaybeNullAttribute : Attribute { }
22+
23+
/// <summary>Specifies that an output will not be null even if the corresponding type allows it.</summary>
24+
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
25+
internal sealed class NotNullAttribute : Attribute { }
26+
27+
/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter may be null even if the corresponding type disallows it.</summary>
28+
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
29+
internal sealed class MaybeNullWhenAttribute : Attribute
30+
{
31+
/// <summary>Initializes the attribute with the specified return value condition.</summary>
32+
/// <param name="returnValue">
33+
/// The return value condition. If the method returns this value, the associated parameter may be null.
34+
/// </param>
35+
public MaybeNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
36+
37+
/// <summary>Gets the return value condition.</summary>
38+
public bool ReturnValue { get; }
39+
}
40+
41+
/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter will not be null even if the corresponding type allows it.</summary>
42+
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
43+
internal sealed class NotNullWhenAttribute : Attribute
44+
{
45+
/// <summary>Initializes the attribute with the specified return value condition.</summary>
46+
/// <param name="returnValue">
47+
/// The return value condition. If the method returns this value, the associated parameter will not be null.
48+
/// </param>
49+
public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
50+
51+
/// <summary>Gets the return value condition.</summary>
52+
public bool ReturnValue { get; }
53+
}
54+
55+
/// <summary>Specifies that the output will be non-null if the named parameter is non-null.</summary>
56+
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
57+
internal sealed class NotNullIfNotNullAttribute : Attribute
58+
{
59+
/// <summary>Initializes the attribute with the associated parameter name.</summary>
60+
/// <param name="parameterName">
61+
/// The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null.
62+
/// </param>
63+
public NotNullIfNotNullAttribute(string parameterName) => ParameterName = parameterName;
64+
65+
/// <summary>Gets the associated parameter name.</summary>
66+
public string ParameterName { get; }
67+
}
68+
69+
/// <summary>Applied to a method that will never return under any circumstance.</summary>
70+
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
71+
internal sealed class DoesNotReturnAttribute : Attribute { }
72+
73+
/// <summary>Specifies that the method will not return if the associated Boolean parameter is passed the specified value.</summary>
74+
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
75+
internal sealed class DoesNotReturnIfAttribute : Attribute
76+
{
77+
/// <summary>Initializes the attribute with the specified parameter value.</summary>
78+
/// <param name="parameterValue">
79+
/// The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to
80+
/// the associated parameter matches this value.
81+
/// </param>
82+
public DoesNotReturnIfAttribute(bool parameterValue) => ParameterValue = parameterValue;
83+
84+
/// <summary>Gets the condition parameter value.</summary>
85+
public bool ParameterValue { get; }
86+
}
87+
88+
#endif
89+
90+
#if !NETCOREAPP || NETCOREAPP3_1
91+
92+
/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values.</summary>
93+
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
94+
internal sealed class MemberNotNullAttribute : Attribute
95+
{
96+
/// <summary>Initializes the attribute with a field or property member.</summary>
97+
/// <param name="member">
98+
/// The field or property member that is promised to be not-null.
99+
/// </param>
100+
public MemberNotNullAttribute(string member) => Members = new[] { member };
101+
102+
/// <summary>Initializes the attribute with the list of field and property members.</summary>
103+
/// <param name="members">
104+
/// The list of field and property members that are promised to be not-null.
105+
/// </param>
106+
public MemberNotNullAttribute(params string[] members) => Members = members;
107+
108+
/// <summary>Gets field or property member names.</summary>
109+
public string[] Members { get; }
110+
}
111+
112+
/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition.</summary>
113+
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
114+
internal sealed class MemberNotNullWhenAttribute : Attribute
115+
{
116+
/// <summary>Initializes the attribute with the specified return value condition and a field or property member.</summary>
117+
/// <param name="returnValue">
118+
/// The return value condition. If the method returns this value, the associated parameter will not be null.
119+
/// </param>
120+
/// <param name="member">
121+
/// The field or property member that is promised to be not-null.
122+
/// </param>
123+
public MemberNotNullWhenAttribute(bool returnValue, string member)
124+
{
125+
ReturnValue = returnValue;
126+
Members = new[] { member };
127+
}
128+
129+
/// <summary>Initializes the attribute with the specified return value condition and list of field and property members.</summary>
130+
/// <param name="returnValue">
131+
/// The return value condition. If the method returns this value, the associated parameter will not be null.
132+
/// </param>
133+
/// <param name="members">
134+
/// The list of field and property members that are promised to be not-null.
135+
/// </param>
136+
public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
137+
{
138+
ReturnValue = returnValue;
139+
Members = members;
140+
}
141+
142+
/// <summary>Gets the return value condition.</summary>
143+
public bool ReturnValue { get; }
144+
145+
/// <summary>Gets field or property member names.</summary>
146+
public string[] Members { get; }
147+
}
148+
149+
#endif
150+
}

‎src/mdv/mdv.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!-- 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.txt file in the project root for more information. -->
33
<Project Sdk="Microsoft.NET.Sdk">
44
<PropertyGroup>
5-
<TargetFramework>net60</TargetFramework>
5+
<TargetFrameworks>net8.0;$(NetCurrent)</TargetFrameworks>
66
<RootNamespace>Microsoft.Metadata.Tools</RootNamespace>
77
<OutputType>Exe</OutputType>
88
<LargeAddressAware>true</LargeAddressAware>

‎vs.cmd

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@ECHO OFF
2+
SETLOCAL
3+
4+
:: This command launches a Visual Studio solution with environment variables required to use a local version of the .NET Core SDK.
5+
6+
:: This tells .NET Core to use the same dotnet.exe that build scripts use
7+
SET DOTNET_ROOT=%~dp0.dotnet
8+
SET DOTNET_ROOT(x86)=%~dp0.dotnet\x86
9+
10+
:: This tells .NET Core not to go looking for .NET Core in other places
11+
SET DOTNET_MULTILEVEL_LOOKUP=0
12+
13+
:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
14+
SET PATH=%DOTNET_ROOT%;%PATH%
15+
16+
SET sln=%~1
17+
18+
IF "%sln%"=="" (
19+
SET sln=%~dp0MetadataTools.sln
20+
)
21+
22+
start "" "%sln%"

0 commit comments

Comments
 (0)
Please sign in to comment.