Browse Source

Merge pull request #2427 from icsharpcode/net50-buildtools

Net50 buildtools
issue1638
Siegfried Pammer 4 years ago committed by GitHub
parent
commit
aa1906b8f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .github/workflows/build-frontends.yml
  2. 4
      .github/workflows/build-ilspy.yml
  3. 4
      .github/workflows/codeql-analysis.yml
  4. 2
      .vsconfig
  5. 8
      ICSharpCode.Decompiler.Tests/Helpers/Tester.cs
  6. 2
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS9_ExtensionGetEnumerator.cs
  7. 4
      ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs
  8. 7
      ICSharpCode.Decompiler/Metadata/UniversalAssemblyResolver.cs
  9. 7
      ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj
  10. 11
      README.md
  11. 2
      global.json

4
.github/workflows/build-frontends.yml

@ -15,10 +15,10 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup .NET Core - name: Setup .NET
uses: actions/setup-dotnet@v1 uses: actions/setup-dotnet@v1
with: with:
dotnet-version: 3.1.x dotnet-version: 5.0.x
- name: Install dependencies - name: Install dependencies
run: dotnet restore Frontends.sln run: dotnet restore Frontends.sln
- name: Build - name: Build

4
.github/workflows/build-ilspy.yml

@ -39,10 +39,10 @@ jobs:
submodules: true submodules: true
fetch-depth: 0 fetch-depth: 0
- name: Setup .NET Core 3.1 - name: Setup .NET
uses: actions/setup-dotnet@v1 uses: actions/setup-dotnet@v1
with: with:
dotnet-version: '3.1.x' dotnet-version: 5.0.x
- name: Add msbuild to PATH - name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2 uses: microsoft/setup-msbuild@v1.0.2

4
.github/workflows/codeql-analysis.yml

@ -27,10 +27,10 @@ jobs:
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
- name: Setup .NET Core - name: Setup .NET
uses: actions/setup-dotnet@v1 uses: actions/setup-dotnet@v1
with: with:
dotnet-version: 3.1.x dotnet-version: 5.0.x
- name: Build - name: Build
run: dotnet build Frontends.sln --configuration Release run: dotnet build Frontends.sln --configuration Release

2
.vsconfig

@ -3,7 +3,7 @@
"components": [ "components": [
"Microsoft.VisualStudio.Component.CoreEditor", "Microsoft.VisualStudio.Component.CoreEditor",
"Microsoft.VisualStudio.Workload.CoreEditor", "Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.NetCore.Component.Runtime.3.1", "Microsoft.NetCore.Component.Runtime.5.0",
"Microsoft.NetCore.Component.SDK", "Microsoft.NetCore.Component.SDK",
"Microsoft.VisualStudio.Component.NuGet", "Microsoft.VisualStudio.Component.NuGet",
"Microsoft.VisualStudio.Component.Roslyn.Compiler", "Microsoft.VisualStudio.Component.Roslyn.Compiler",

8
ICSharpCode.Decompiler.Tests/Helpers/Tester.cs

@ -219,9 +219,9 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
static readonly RoslynToolset roslynToolset = new RoslynToolset(); static readonly RoslynToolset roslynToolset = new RoslynToolset();
static readonly string coreRefAsmPath = new DotNetCorePathFinder(TargetFrameworkIdentifier.NETCoreApp, static readonly string coreRefAsmPath = new DotNetCorePathFinder(TargetFrameworkIdentifier.NET,
new Version(3, 1), "Microsoft.NETCore.App") new Version(5, 0), "Microsoft.NETCore.App")
.GetReferenceAssemblyPath(".NETCoreApp, Version = v3.1"); .GetReferenceAssemblyPath(".NETCoreApp, Version = v5.0");
static readonly string refAsmPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), static readonly string refAsmPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86),
@"Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2"); @"Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2");
@ -257,7 +257,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
const string targetFrameworkAttributeSnippet = @" const string targetFrameworkAttributeSnippet = @"
[assembly: System.Runtime.Versioning.TargetFramework("".NETCoreApp, Version = v3.1"", FrameworkDisplayName = """")] [assembly: System.Runtime.Versioning.TargetFramework("".NETCoreApp, Version = v5.0"", FrameworkDisplayName = """")]
"; ";

2
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS9_ExtensionGetEnumerator.cs

@ -16,7 +16,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void Test(NonGeneric c) public void Test(NonGeneric c)
{ {
foreach (object? item in c) foreach (object item in c)
{ {
Console.WriteLine(item); Console.WriteLine(item);
} }

4
ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs

@ -168,6 +168,10 @@ namespace ICSharpCode.Decompiler.Metadata
identifier = "NETStandard.Library"; identifier = "NETStandard.Library";
identifierExt = "netstandard" + version.Major + "." + version.Minor; identifierExt = "netstandard" + version.Major + "." + version.Minor;
break; break;
case TargetFrameworkIdentifier.NET:
identifier = "Microsoft.NETCore.App";
identifierExt = "net" + version.Major + "." + version.Minor;
break;
default: default:
throw new NotSupportedException(); throw new NotSupportedException();
} }

7
ICSharpCode.Decompiler/Metadata/UniversalAssemblyResolver.cs

@ -36,7 +36,8 @@ namespace ICSharpCode.Decompiler.Metadata
NETFramework, NETFramework,
NETCoreApp, NETCoreApp,
NETStandard, NETStandard,
Silverlight Silverlight,
NET
} }
enum DecompilerRuntime enum DecompilerRuntime
@ -186,6 +187,9 @@ namespace ICSharpCode.Decompiler.Metadata
} }
if (!Version.TryParse(versionString, out version)) if (!Version.TryParse(versionString, out version))
version = null; version = null;
// .NET 5 or greater still use ".NETCOREAPP" as TargetFrameworkAttribute value...
if (version?.Major >= 5 && identifier == TargetFrameworkIdentifier.NETCoreApp)
identifier = TargetFrameworkIdentifier.NET;
break; break;
} }
} }
@ -260,6 +264,7 @@ namespace ICSharpCode.Decompiler.Metadata
string? file; string? file;
switch (targetFrameworkIdentifier) switch (targetFrameworkIdentifier)
{ {
case TargetFrameworkIdentifier.NET:
case TargetFrameworkIdentifier.NETCoreApp: case TargetFrameworkIdentifier.NETCoreApp:
case TargetFrameworkIdentifier.NETStandard: case TargetFrameworkIdentifier.NETStandard:
if (IsZeroOrAllOnes(targetFrameworkVersion)) if (IsZeroOrAllOnes(targetFrameworkVersion))

7
ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj

@ -2,8 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net472</TargetFramework>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo> <GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<EnableDefaultItems>false</EnableDefaultItems> <EnableDefaultItems>false</EnableDefaultItems>
@ -16,6 +14,11 @@
<AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects>
</PropertyGroup> </PropertyGroup>
<Import Project="..\multitargeting.props" Condition="Exists('..\multitargeting.props')" />
<PropertyGroup Condition="!Exists('..\multitargeting.props')">
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'"> <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>full</DebugType> <DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>

11
README.md

@ -49,7 +49,7 @@ How to build
- Follow Microsoft's instructions for [importing a configuration](https://docs.microsoft.com/en-us/visualstudio/install/import-export-installation-configurations?view=vs-2019#import-a-configuration), and import the .vsconfig file located at the root of the solution. - Follow Microsoft's instructions for [importing a configuration](https://docs.microsoft.com/en-us/visualstudio/install/import-export-installation-configurations?view=vs-2019#import-a-configuration), and import the .vsconfig file located at the root of the solution.
- Alternatively, you can open the ILSpy solution (ILSpy.sln) and Visual Studio will [prompt you to install the missing components](https://docs.microsoft.com/en-us/visualstudio/install/import-export-installation-configurations?view=vs-2019#automatically-install-missing-components). - Alternatively, you can open the ILSpy solution (ILSpy.sln) and Visual Studio will [prompt you to install the missing components](https://docs.microsoft.com/en-us/visualstudio/install/import-export-installation-configurations?view=vs-2019#automatically-install-missing-components).
- Finally, you can manually install the necessary components via the Visual Studio Installer. The workloads/components are as follows: - Finally, you can manually install the necessary components via the Visual Studio Installer. The workloads/components are as follows:
- Workload ".NET Desktop Development". This workload includes the .NET Framework 4.8 SDK and the .NET Framework 4.7.2 targeting pack, as well as the [.NET Core 3.1 SDK](https://dotnet.microsoft.com/download/dotnet-core/3.1) (ILSpy.csproj targets .NET 4.7.2, and ILSpy.sln uses SDK-style projects). _Note: The optional components of this workload are not required for ILSpy_ - Workload ".NET Desktop Development". This workload includes the .NET Framework 4.8 SDK and the .NET Framework 4.7.2 targeting pack, as well as the [.NET 5.0 SDK](https://dotnet.microsoft.com/download/dotnet/5.0) (ILSpy.csproj targets .NET 4.7.2, and ILSpy.sln uses SDK-style projects). _Note: The optional components of this workload are not required for ILSpy_
- Workload "Visual Studio extension development" (ILSpy.sln contains a VS extension project) _Note: The optional components of this workload are not required for ILSpy_ - Workload "Visual Studio extension development" (ILSpy.sln contains a VS extension project) _Note: The optional components of this workload are not required for ILSpy_
- Individual Component "MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.23)" (or similar) - Individual Component "MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.23)" (or similar)
- _The VC++ toolset is optional_; if present it is used for `editbin.exe` to modify the stack size used by ILSpy.exe from 1MB to 16MB, because the decompiler makes heavy use of recursion, where small stack sizes lead to problems in very complex methods. - _The VC++ toolset is optional_; if present it is used for `editbin.exe` to modify the stack size used by ILSpy.exe from 1MB to 16MB, because the decompiler makes heavy use of recursion, where small stack sizes lead to problems in very complex methods.
@ -58,14 +58,13 @@ How to build
- Run project "ILSpy" for the ILSpy UI - Run project "ILSpy" for the ILSpy UI
- Use the Visual Studio "Test Explorer" to see/run the tests - Use the Visual Studio "Test Explorer" to see/run the tests
**Note:** Visual Studio 16.3 and later include a version of the .NET Core SDK that is managed by the Visual Studio installer - once you update, it may get upgraded too. **Note:** Visual Studio 16.3 and later include a version of the .NET (Core) SDK that is managed by the Visual Studio installer - once you update, it may get upgraded too.
Please note that ILSpy is only compatible with the .NET Core 3.1 SDK and Visual Studio will refuse to load some projects in the solution (and unit tests will fail). Please note that ILSpy is only compatible with the .NET 5.0 SDK and Visual Studio will refuse to load some projects in the solution (and unit tests will fail).
If this problem occurs, please manually install the .NET Core 3.1 SDK from [here](https://dotnet.microsoft.com/download/dotnet-core/3.1). If this problem occurs, please manually install the .NET 5.0 SDK from [here](https://dotnet.microsoft.com/download/dotnet/5.0).
#### Unix / Mac: #### Unix / Mac:
- Make sure .NET Core 2.1 LTS Runtime is installed (you can get it here: https://get.dot.net). - Make sure [.NET 5.0 SDK](https://dotnet.microsoft.com/download/dotnet/5.0) is installed.
- Make sure [.NET Core 3.1 SDK](https://dotnet.microsoft.com/download/dotnet-core/3.1) is installed.
- Make sure [PowerShell](https://github.com/PowerShell/PowerShell) is installed (formerly known as PowerShell Core) - Make sure [PowerShell](https://github.com/PowerShell/PowerShell) is installed (formerly known as PowerShell Core)
- Clone the repository using git. - Clone the repository using git.
- Execute `git submodule update --init --recursive` to download the ILSpy-Tests submodule (used by some test cases). - Execute `git submodule update --init --recursive` to download the ILSpy-Tests submodule (used by some test cases).

2
global.json

@ -1,6 +1,6 @@
{ {
"sdk": { "sdk": {
"version": "3.1.100", "version": "5.0.0",
"rollForward": "major", "rollForward": "major",
"allowPrerelease": true "allowPrerelease": true
} }

Loading…
Cancel
Save