Skip to content
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

Move ILSpy to .NET 6.0 #2642

Merged
merged 41 commits into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9e54b44
Move ILSpy to net6.0-windows
siegfriedpammer Feb 6, 2022
9a4f5bc
Minimal changes for building on .NET 6.0
christophwille Feb 7, 2022
ce7f594
Remove outdated build tools
christophwille Feb 7, 2022
379cc76
Fix ILSpyBuildPath and .exe.config -> .dll.config. Note: should use o…
christophwille Feb 7, 2022
15ad025
Fix buildOutputDir. Note: should use output from dotnet publish!
christophwille Feb 7, 2022
df89c14
matrix.channel leftover in zip task
christophwille Feb 7, 2022
1ac5881
Remove MSIX project
christophwille Feb 7, 2022
76bc5a3
Set TFM to TargetFramework to match other unit test projects
christophwille Feb 7, 2022
9d08e76
Fix path in unit test task
christophwille Feb 7, 2022
c6641d5
Switch to vstest.console (and go back to net6.0 for ics.d.test re:xplat)
christophwille Feb 7, 2022
16cc80a
Test .dll instead of .exe (to resolve: couldn't we OutputType Library…
christophwille Feb 7, 2022
a4ecc5e
Remove MSIX-specific code paths in ILSpy
christophwille Feb 7, 2022
b5b7396
Fix up ics.d.tests to look like a File New/NUnit project
christophwille Feb 7, 2022
d68cc56
Fix up Baml decompiler unit test project
christophwille Feb 7, 2022
4b5f4c6
Remove Stub
christophwille Feb 7, 2022
a794a56
Fix up ILSpy.Tests + <Project> tag for all projects
christophwille Feb 7, 2022
52b1c49
Tests need to be platform specific for ilasm.exe to be extracted corr…
christophwille Feb 7, 2022
f5cfff8
Add RIDs for self-contained publishing
christophwille Feb 8, 2022
9a5bcf2
ilspycmd will only target net60 going forward (it might start dependi…
christophwille Feb 8, 2022
2e706df
Add self-contained zip creation
christophwille Feb 10, 2022
e4b63f7
- Make all tests async.
siegfriedpammer Feb 21, 2022
266ce4c
Use ExecuteBufferedAsync from CliWrap
christophwille Feb 23, 2022
9e46b9d
Update WellKnownConstants test for net6.0
siegfriedpammer Feb 24, 2022
d85759f
Force StackTests to use 32-bit runner
siegfriedpammer Feb 24, 2022
00edcad
Use .NET 4.7.2 assemblies for our type system tests.
siegfriedpammer Feb 24, 2022
fe91578
Add AssemblyVersion to IModule
siegfriedpammer Feb 24, 2022
2de6e1f
Ignore nullability annotations when comparing types in the case of im…
siegfriedpammer Feb 24, 2022
3a04963
Fix BAML tests
siegfriedpammer Feb 24, 2022
7c85d0f
Go back to using dotnet test
christophwille Feb 25, 2022
ce63410
Add test-reporter
siegfriedpammer Feb 25, 2022
e24b901
Build self-contained test runners before running tests.
siegfriedpammer Feb 25, 2022
50cfcc2
DecompilerTypeSystem: Add support for implicit references
siegfriedpammer Feb 27, 2022
272db61
Fix DebugSteps not working when changing to ILAstLanguage.
siegfriedpammer Feb 27, 2022
e726ae2
Fix type equality check in TransformCollectionAndObjectInitializers
siegfriedpammer Feb 27, 2022
5f73bfb
Fix Deconstruction for Deconstruct instance methods of value-types.
siegfriedpammer Feb 27, 2022
44dee6e
Add additional tests for .NET 4.0
siegfriedpammer Mar 4, 2022
406f537
Ditch nuspec.template
siegfriedpammer Mar 5, 2022
cbcfcf6
IntroduceQueryExpressions: Do not ignore attributes on lambdas
siegfriedpammer Mar 5, 2022
f98012e
DetectPinnedRegions: Support special case where pinned pointer is unu…
siegfriedpammer Mar 5, 2022
3c2e528
DetectPinnedRegions: Inline the stack-slot involved in CustomRefPinPa…
siegfriedpammer Mar 5, 2022
db034d3
Remove incomplete/wrong support for null-forgiving operator.
siegfriedpammer Mar 5, 2022
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
84 changes: 43 additions & 41 deletions .github/workflows/build-ilspy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- configuration: debug
solution: ilspy.sln
channel: zip
- configuration: release
solution: ilspy.sln
channel: zip
- configuration: release
solution: ilspy.withpackage.sln
channel: ci
- configuration: release
solution: ilspy.withpackage.sln
channel: store
Configuration: [ Debug, Release ]
env:
BuildPlatform: Any CPU
StagingDirectory: buildartifacts
Expand Down Expand Up @@ -58,76 +46,90 @@ jobs:
Get-ChildItem Env: | Where-Object {$_.Name -Match "^ILSPY_"} | %{ echo "::set-output name=$($_.Name)::$($_.Value)" }

- name: Restore the application
run: msbuild ${{ matrix.solution }} /t:Restore /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform
run: msbuild ILSpy.sln /t:Restore /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform

- name: Build
run: msbuild ${{ matrix.solution }} /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform /p:AppxPackageDir="${{ github.workspace }}\${{ env.StagingDirectory }}\${{ matrix.channel }}\"
env:
ReleaseChannel: ${{ matrix.channel }}
run: msbuild ILSpy.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform

- name: Execute unit tests
run: dotnet test $env:Tests1 $env:Tests2 $env:Tests3
run: dotnet test --logger "trx;LogFileName=${{ matrix.configuration }}-test-results.trx" $env:Tests1 $env:Tests2 $env:Tests3
env:
Tests1: ICSharpCode.Decompiler.Tests\bin\${{ matrix.configuration }}\net472\ICSharpCode.Decompiler.Tests.exe
Tests2: ILSpy.Tests\bin\${{ matrix.configuration }}\net472\ILSpy.Tests.exe
Tests3: ILSpy.BamlDecompiler.Tests\bin\${{ matrix.configuration }}\net472\ILSpy.BamlDecompiler.Tests.exe
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

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Unit Test Results (${{ matrix.configuration }})
path: '**/*.trx'
reporter: dotnet-trx
list-suites: 'all'
list-tests: 'failed'

- name: Style - tab check
run: python BuildTools\tidy.py

- name: Zip ILSpy Release
if: matrix.channel == 'zip'
# run: 7z a -tzip $env:StagingDirectory\ILSpy_binaries.zip .\ILSpy\bin\${{ matrix.configuration }}\net472\*
run: 7z a -tzip $env:StagingDirectory\ILSpy_binaries.zip .\ILSpy\bin\${{ matrix.configuration }}\net472\*.dll .\ILSpy\bin\${{ matrix.configuration }}\net472\*.exe .\ILSpy\bin\${{ matrix.configuration }}\net472\*.config .\ILSpy\bin\${{ matrix.configuration }}\net472\*\ILSpy.resources.dll .\ILSpy\bin\${{ matrix.configuration }}\net472\*\ILSpy.ReadyToRun.Plugin.resources.dll

# https://github.com/actions/upload-artifact
- name: Upload Store build artifacts
if: matrix.channel == 'store'
uses: actions/upload-artifact@v2
with:
name: MSIX Store Package
path: ${{ env.StagingDirectory }}\${{ matrix.channel }}\*.*
if-no-files-found: error
- 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\*\ILSpy.resources.dll .\ILSpy\bin\${{ matrix.configuration }}\net6.0-windows\*\ILSpy.ReadyToRun.Plugin.resources.dll

- name: Zip ILSpy Release (self-contained win-x64)
if: matrix.configuration == 'release'
shell: pwsh
run: |
dotnet publish ./ILSpy/ILSpy.csproj -c Release --no-restore --self-contained -r win-x64
dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c Release --no-restore --self-contained -r win-x64
dotnet publish ./ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj -c Release --no-restore --self-contained -r win-x64
7z a -tzip $env:StagingDirectory\ILSpy_selfcontained_x64.zip .\ILSpy\bin\Release\net6.0-windows\win-x64\publish\*

# https://github.com/actions/upload-artifact
- name: Upload VSIX (VS 2019) release build artifacts
if: matrix.channel == 'zip' && matrix.configuration == 'release'
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v2
with:
name: ILSpy VS Addin for VS 2017-2019 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ILSpy.AddIn\bin\${{ matrix.configuration }}\net472\*.vsix
if-no-files-found: error

- name: Upload VSIX (VS 2022) release build artifacts
if: matrix.channel == 'zip' && matrix.configuration == 'release'
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v2
with:
name: ILSpy VS Addin for VS 2022 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ILSpy.AddIn.VS2022\bin\${{ matrix.configuration }}\net472\*.vsix
if-no-files-found: error

- name: Upload NuGet release build artifacts
if: matrix.channel == 'zip' && matrix.configuration == 'release'
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v2
with:
name: ICSharpCode.Decompiler NuGet Package (${{ matrix.configuration }})
path: ICSharpCode.Decompiler\bin\Release\ICSharpCode.Decompiler*.nupkg
if-no-files-found: error

- name: Publish NuGet
if: github.ref == 'refs/heads/master' && matrix.channel == 'zip' && matrix.configuration == 'release'
if: github.ref == 'refs/heads/master' && matrix.configuration == 'release'
run: |
dotnet nuget push "ICSharpCode.Decompiler\bin\Release\ICSharpCode.Decompiler*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}

- name: Upload zip release build artifacts
if: matrix.channel == 'zip'
- name: Upload zip binaries build artifacts
uses: actions/upload-artifact@v2
with:
name: ILSpy ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ${{ env.StagingDirectory }}\ILSpy_binaries.zip
if-no-files-found: error

- name: Upload self-contained zip build artifacts (Release-only)
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v2
with:
name: ILSpy self-contained x64 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ${{ env.StagingDirectory }}\ILSpy_selfcontained_x64.zip
if-no-files-found: error

- name: Upload installer artifact
if: matrix.channel == 'zip' && matrix.configuration == 'release'
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v2
with:
name: ILSpy Installer ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ _ReSharper*/
multitargeting.props
ILSpy.Installer/wix/
ILSpy.Installer/AppPackage.cs
/VERSION
34 changes: 0 additions & 34 deletions BuildTools/appveyor-ilspycmd-install.ps1

This file was deleted.

41 changes: 0 additions & 41 deletions BuildTools/appveyor-install.ps1

This file was deleted.

41 changes: 0 additions & 41 deletions BuildTools/pipelines-install.ps1

This file was deleted.

34 changes: 3 additions & 31 deletions BuildTools/update-assemblyinfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,12 @@ function gitBranch() {
$templateFiles = (
@{Input=$globalAssemblyInfoTemplateFile; Output="ILSpy/Properties/AssemblyInfo.cs"},
@{Input="ICSharpCode.Decompiler/Properties/AssemblyInfo.template.cs"; Output="ICSharpCode.Decompiler/Properties/AssemblyInfo.cs"},
@{Input="ICSharpCode.Decompiler/ICSharpCode.Decompiler.nuspec.template"; Output="ICSharpCode.Decompiler/ICSharpCode.Decompiler.nuspec"},
@{Input="ILSpy/Properties/app.config.template"; Output = "ILSpy/app.config"},
@{Input="ILSpy.AddIn/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn/source.extension.vsixmanifest"},
@{Input="ILSpy.AddIn.VS2022/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn.VS2022/source.extension.vsixmanifest"},
@{Input="ILSpy.Installer/AppPackage.cs.template"; Output = "ILSpy.Installer/AppPackage.cs"}
);

$appxmanifestFiles = (
@{Input="ILSpy.Package/Package.appxmanifest"; Output="ILSpy.Package/Package.appxmanifest"},
@{Input="ILSpy.Package/Package-CI.appxmanifest"; Output="ILSpy.Package/Package-CI.appxmanifest"}
);

[string]$mutexId = "ILSpyUpdateAssemblyInfo" + (Get-Location).ToString().GetHashCode();
Write-Host $mutexId;
[bool]$createdNew = $false;
Expand Down Expand Up @@ -143,6 +137,9 @@ try {
}

$fullVersionNumber = "$major.$minor.$build.$revision";
if ((-not (Test-File "VERSION")) -or (((Get-Content "VERSION") -Join [System.Environment]::NewLine) -ne "$fullVersionNumber$postfixVersionName")) {
"$fullVersionNumber$postfixVersionName" | Out-File -Encoding utf8 -NoNewLine "VERSION";
}

foreach ($file in $templateFiles) {
[string]$in = (Get-Content $file.Input) -Join [System.Environment]::NewLine;
Expand All @@ -164,31 +161,6 @@ try {
$out | Out-File -Encoding utf8 $file.Output;
}
}

# Only update these on the Build Agent when ReleaseChannel is set
if($Env:ReleaseChannel -ne '' -and $Env:ReleaseChannel -ne $null) {
foreach ($file in $appxmanifestFiles) {
[string]$in = (Get-Content $file.Input) -Join [System.Environment]::NewLine;

$out = $in.Replace('$INSERTVERSION$', $fullVersionNumber);
$out = $out.Replace('$INSERTMAJORVERSION$', $major);
$out = $out.Replace('$INSERTMINORVERSION$', $minor);
$out = $out.Replace('$INSERTREVISION$', $revision);
$out = $out.Replace('$INSERTCOMMITHASH$', $gitCommitHash);
$out = $out.Replace('$INSERTSHORTCOMMITHASH$', $gitCommitHash.Substring(0, 8));
$out = $out.Replace('$INSERTDATE$', [System.DateTime]::Now.ToString("MM/dd/yyyy"));
$out = $out.Replace('$INSERTYEAR$', [System.DateTime]::Now.Year.ToString());
$out = $out.Replace('$INSERTBRANCHNAME$', $branchName);
$out = $out.Replace('$INSERTBRANCHPOSTFIX$', $postfixBranchName);
$out = $out.Replace('$INSERTVERSIONNAME$', $versionName);
$out = $out.Replace('$INSERTVERSIONNAMEPOSTFIX$', $postfixVersionName);
$out = $out.Replace('$INSERTBUILDCONFIG$', $buildConfig);

if ((-not (Test-File $file.Output)) -or (((Get-Content $file.Output) -Join [System.Environment]::NewLine) -ne $out)) {
$out | Out-File -Encoding utf8 $file.Output;
}
}
}

} finally {
$mutex.ReleaseMutex();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFramework>net6.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>true</IsPackable>
<PackAsTool>true</PackAsTool>
<InvariantGlobalization>true</InvariantGlobalization>
<AssemblyName>ilspycmd</AssemblyName>
<ToolCommandName>ilspycmd</ToolCommandName>
<Version>7.2.0.6791-preview3</Version>
<AssemblyVersion>7.2.0.0</AssemblyVersion>
<FileVersion>7.2.0.0</FileVersion>
<Version>8.0.0.0-alpha1</Version>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<FileVersion>8.0.0.0</FileVersion>
<Description>Command-line decompiler using the ILSpy decompilation engine</Description>
<Copyright>Copyright 2011-2022 AlphaSierraPapa</Copyright>
<PackageProjectUrl>https://github.com/icsharpcode/ILSpy/</PackageProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Loading