Skip to content

Commit

Permalink
Basics of net8.0. Breaking unit tests expected.
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwille committed Jun 20, 2023
1 parent d57b08c commit f642dd7
Show file tree
Hide file tree
Showing 19 changed files with 42 additions and 35 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-frontends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: '8.0.x'
dotnet-quality: 'preview'

- name: Install dependencies
run: dotnet restore ILSpy.XPlat.slnf
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/build-ilspy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
submodules: true
fetch-depth: 0

- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
dotnet-quality: 'preview'

- name: Add msbuild to PATH
uses: microsoft/[email protected]

Expand All @@ -48,9 +53,9 @@ jobs:
- name: Execute unit tests
run: dotnet test --logger "junit;LogFileName=${{ matrix.configuration }}.xml" --results-directory test-results $env:Tests1 $env:Tests2 $env:Tests3
env:
Tests1: ICSharpCode.Decompiler.Tests\bin\${{ matrix.configuration }}\net6.0-windows\win-x64\ICSharpCode.Decompiler.Tests.dll
Tests2: ILSpy.Tests\bin\${{ matrix.configuration }}\net6.0-windows\ILSpy.Tests.dll
Tests3: ILSpy.BamlDecompiler.Tests\bin\${{ matrix.configuration }}\net6.0-windows\win-x64\ILSpy.BamlDecompiler.Tests.dll
Tests1: ICSharpCode.Decompiler.Tests\bin\${{ matrix.configuration }}\net8.0-windows\win-x64\ICSharpCode.Decompiler.Tests.dll
Tests2: ILSpy.Tests\bin\${{ matrix.configuration }}\net8.0-windows\ILSpy.Tests.dll
Tests3: ILSpy.BamlDecompiler.Tests\bin\${{ matrix.configuration }}\net8.0-windows\win-x64\ILSpy.BamlDecompiler.Tests.dll

- name: Upload Test Logs
uses: actions/upload-artifact@v3
Expand All @@ -76,19 +81,19 @@ jobs:
git diff --exit-code
- name: Zip ILSpy (framework-dependent)
run: 7z a -tzip $env:StagingDirectory\ILSpy_binaries.zip .\ILSpy\bin\${{ matrix.configuration }}\net6.0-windows\*.dll .\ILSpy\bin\${{ matrix.configuration }}\net6.0-windows\*.exe .\ILSpy\bin\${{ matrix.configuration }}\net6.0-windows\*.config .\ILSpy\bin\${{ matrix.configuration }}\net6.0-windows\*.json .\ILSpy\bin\${{ matrix.configuration }}\net6.0-windows\*\ILSpy.resources.dll .\ILSpy\bin\${{ matrix.configuration }}\net6.0-windows\*\ILSpy.ReadyToRun.Plugin.resources.dll
run: 7z a -tzip $env:StagingDirectory\ILSpy_binaries.zip .\ILSpy\bin\${{ matrix.configuration }}\net8.0-windows\*.dll .\ILSpy\bin\${{ matrix.configuration }}\net8.0-windows\*.exe .\ILSpy\bin\${{ matrix.configuration }}\net8.0-windows\*.config .\ILSpy\bin\${{ matrix.configuration }}\net8.0-windows\*.json .\ILSpy\bin\${{ matrix.configuration }}\net8.0-windows\*\ILSpy.resources.dll .\ILSpy\bin\${{ matrix.configuration }}\net8.0-windows\*\ILSpy.ReadyToRun.Plugin.resources.dll

- name: Publish x64/arm64 framework-dependent/self-contained
shell: pwsh
run: .\publish.ps1

- name: Zip ILSpy Release (x64 self-contained)
if: matrix.configuration == 'release'
run: 7z a -tzip $env:StagingDirectory\ILSpy_selfcontained_x64.zip .\ILSpy\bin\Release\net6.0-windows\win-x64\publish\selfcontained\*
run: 7z a -tzip $env:StagingDirectory\ILSpy_selfcontained_x64.zip .\ILSpy\bin\Release\net8.0-windows\win-x64\publish\selfcontained\*

- name: Zip ILSpy Release (arm64 framework-dependent)
if: matrix.configuration == 'release'
run: 7z a -tzip $env:StagingDirectory\ILSpy_binaries_arm64.zip .\ILSpy\bin\Release\net6.0-windows\win-arm64\publish\fwdependent\*
run: 7z a -tzip $env:StagingDirectory\ILSpy_binaries_arm64.zip .\ILSpy\bin\Release\net8.0-windows\win-arm64\publish\fwdependent\*

- name: Build Installer (x64 and arm64, framework-dependent)
if: matrix.configuration == 'release'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
with:
languages: ${{ matrix.language }}

- name: Setup .NET
uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: '8.0.x'
dotnet-quality: 'preview'

- name: Build
run: dotnet build ILSpy.XPlat.slnf --configuration Release
Expand Down
12 changes: 7 additions & 5 deletions ICSharpCode.Decompiler.Tests/Helpers/Tester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ static Tester()
TesterPath = Path.GetDirectoryName(typeof(Tester).Assembly.Location);
TestCasePath = Path.Combine(TesterPath, "../../../../TestCases");
#if DEBUG
testRunnerBasePath = Path.Combine(TesterPath, "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Debug/net7.0");
testRunnerBasePath = Path.Combine(TesterPath, "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Debug/net8.0");
#else
testRunnerBasePath = Path.Combine(TesterPath, "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Release/net7.0");
testRunnerBasePath = Path.Combine(TesterPath, "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Release/net8.0");
#endif
packagesPropsFile = Path.Combine(TesterPath, "../../../../../packages.props");
roslynLatestVersion = XDocument.Load(packagesPropsFile).XPathSelectElement("//RoslynVersion").Value;
Expand Down Expand Up @@ -270,8 +270,8 @@ private static string ReplacePrivImplDetails(string il)
}

static readonly string coreRefAsmPath = new DotNetCorePathFinder(TargetFrameworkIdentifier.NET,
new Version(7, 0), "Microsoft.NETCore.App")
.GetReferenceAssemblyPath(".NETCoreApp,Version=v7.0");
new Version(8, 0), "Microsoft.NETCore.App")
.GetReferenceAssemblyPath(".NETCoreApp,Version=v8.0");

public static readonly string RefAsmPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86),
@"Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2");
Expand Down Expand Up @@ -308,7 +308,7 @@ private static string ReplacePrivImplDetails(string il)

const string targetFrameworkAttributeSnippet = @"
[assembly: System.Runtime.Versioning.TargetFramework("".NETCoreApp,Version=v7.0"", FrameworkDisplayName = """")]
[assembly: System.Runtime.Versioning.TargetFramework("".NETCoreApp,Version=v8.0"", FrameworkDisplayName = """")]
";

Expand Down Expand Up @@ -344,6 +344,7 @@ public static List<string> GetPreprocessorSymbols(CompilerOptions flags)
preprocessorSymbols.Add("NETCORE");
preprocessorSymbols.Add("NET60");
preprocessorSymbols.Add("NET70");
preprocessorSymbols.Add("NET80");
}
preprocessorSymbols.Add("ROSLYN");
preprocessorSymbols.Add("CS60");
Expand Down Expand Up @@ -373,6 +374,7 @@ public static List<string> GetPreprocessorSymbols(CompilerOptions flags)
preprocessorSymbols.Add("ROSLYN4");
preprocessorSymbols.Add("CS100");
preprocessorSymbols.Add("CS110");
preprocessorSymbols.Add("CS120");
}
}
else if ((flags & CompilerOptions.UseMcsMask) != 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<IsPackable>false</IsPackable>
<StartupObject>AutoGeneratedProgram</StartupObject>
Expand Down
2 changes: 1 addition & 1 deletion ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>true</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<WarningsAsErrors>nullable</WarningsAsErrors>
Expand Down
4 changes: 2 additions & 2 deletions ILSpy.AddIn.VS2022/ILSpy.AddIn.VS2022.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
</ItemGroup>

<PropertyGroup>
<ILSpyBuildPathX64>..\ILSpy\bin\$(Configuration)\net6.0-windows\win-x64\publish\fwdependent\</ILSpyBuildPathX64>
<ILSpyBuildPathArm64>..\ILSpy\bin\$(Configuration)\net6.0-windows\win-arm64\publish\fwdependent\</ILSpyBuildPathArm64>
<ILSpyBuildPathX64>..\ILSpy\bin\$(Configuration)\net8.0-windows\win-x64\publish\fwdependent\</ILSpyBuildPathX64>
<ILSpyBuildPathArm64>..\ILSpy\bin\$(Configuration)\net8.0-windows\win-arm64\publish\fwdependent\</ILSpyBuildPathArm64>
</PropertyGroup>

<Target Name="IncludeILSpyDistributionInVSIXSubFolder" AfterTargets="ResolveProjectReferences">
Expand Down
2 changes: 1 addition & 1 deletion ILSpy.AddIn/ILSpy.AddIn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
</ItemGroup>

<PropertyGroup>
<ILSpyBuildPath>..\ILSpy\bin\$(Configuration)\net6.0-windows\win-x64\publish\fwdependent\</ILSpyBuildPath>
<ILSpyBuildPath>..\ILSpy\bin\$(Configuration)\net8.0-windows\win-x64\publish\fwdependent\</ILSpyBuildPath>
</PropertyGroup>

<Target Name="IncludeILSpyDistributionInVSIXSubFolder" AfterTargets="ResolveProjectReferences">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<IsPackable>false</IsPackable>
<StartupObject>AutoGeneratedProgram</StartupObject>
Expand Down
2 changes: 1 addition & 1 deletion ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>ILSpy.BamlDecompiler.Plugin</AssemblyName>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<IsPackable>false</IsPackable>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
Expand Down
2 changes: 1 addition & 1 deletion ILSpy.Installer/setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static public void Main()
#else
var buildPlatform = "x64";
#endif
var buildOutputDir = $@"ILSpy\bin\{buildConfiguration}\net6.0-windows\win-{buildPlatform}\publish\fwdependent";
var buildOutputDir = $@"ILSpy\bin\{buildConfiguration}\net8.0-windows\win-{buildPlatform}\publish\fwdependent";

var project = new Project("ILSpy",
new InstallDir(@"%LocalAppData%\Programs\ILSpy",
Expand Down
2 changes: 1 addition & 1 deletion ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<AssemblyName>ILSpy.ReadyToRun.Plugin</AssemblyName>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<NeutralResourcesLanguage>en-US</NeutralResourcesLanguage>
Expand Down
2 changes: 1 addition & 1 deletion ILSpy.Tests/ILSpy.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<IsPackable>false</IsPackable>
<StartupObject>AutoGeneratedProgram</StartupObject>

Expand Down
2 changes: 1 addition & 1 deletion ILSpy/ILSpy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
Expand Down
2 changes: 1 addition & 1 deletion SharpTreeView/ICSharpCode.TreeView.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<UseWpf>true</UseWpf>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<SignAssembly>True</SignAssembly>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<AssemblyOriginatorKeyFile>..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.snk</AssemblyOriginatorKeyFile>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion TestPlugin/TestPlugin.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<AssemblyName>Test.Plugin</AssemblyName>
<UseWpf>true</UseWpf>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"version": "8.0.100-preview.5",
"rollForward": "major",
"allowPrerelease": true
}
Expand Down
6 changes: 3 additions & 3 deletions publish.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$output_arm64 = "./ILSpy/bin/Release/net6.0-windows/win-arm64/publish/fwdependent"
$output_x64 = "./ILSpy/bin/Release/net6.0-windows/win-x64/publish/fwdependent"
$output_x64_selfcontained = "./ILSpy/bin/Release/net6.0-windows/win-x64/publish/selfcontained"
$output_arm64 = "./ILSpy/bin/Release/net8.0-windows/win-arm64/publish/fwdependent"
$output_x64 = "./ILSpy/bin/Release/net8.0-windows/win-x64/publish/fwdependent"
$output_x64_selfcontained = "./ILSpy/bin/Release/net8.0-windows/win-x64/publish/selfcontained"

dotnet publish ./ILSpy/ILSpy.csproj -c Release --no-restore --no-self-contained -r win-arm64 -o $output_arm64
dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c Release --no-restore --no-self-contained -r win-arm64 -o $output_arm64
Expand Down

0 comments on commit f642dd7

Please sign in to comment.