Skip to content

Commit e72b1f9

Browse files
Merge branch 'master' into feature/ReferenceAssemblyOverly
2 parents 65f546d + a9eccdb commit e72b1f9

File tree

144 files changed

+4107
-1194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+4107
-1194
lines changed

.github/workflows/build-frontends.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0
1717
- name: Setup .NET

.github/workflows/build-ilspy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- run: mkdir -p $env:StagingDirectory
2222

2323

24-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2525
with:
2626
submodules: true
2727
fetch-depth: 0
@@ -95,7 +95,7 @@ jobs:
9595
run: |
9696
msbuild ILSpy.Installer.sln /t:Restore /p:Configuration="Release" /p:Platform="Any CPU"
9797
msbuild ILSpy.Installer.sln /p:Configuration="Release" /p:Platform="Any CPU"
98-
msbuild ILSpy.Installer.sln /p:Configuration="Release" /p:Platform="Any CPU" /p:DefineConstants="ARM64"
98+
msbuild ILSpy.Installer.sln /p:Configuration="Release" /p:Platform="Any CPU" /p:PlatformForInstaller="ARM64"
9999
100100
- name: Build VS Extensions (for 2017-2019 and 2022)
101101
if: matrix.configuration == 'release'

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
steps:
2020
- name: Checkout repository
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 0
2424

.github/workflows/generate-bom.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
run: git config --global core.autocrlf true
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
with:
1616
submodules: true
1717

ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
</ItemGroup>
2727

2828
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
29-
<Exec Command="pwsh -Command &quot;Copy-Item $(ProjectDir)manifest.psd1 $(TargetDir)$(TargetName).psd1&quot;" />
29+
<Exec Condition=" '$(OS)' == 'Windows_NT' " Command="powershell -Command &quot;Copy-Item $(ProjectDir)manifest.psd1 $(TargetDir)$(TargetName).psd1&quot;" />
30+
<Exec Condition=" '$(OS)' != 'Windows_NT' " Command="pwsh -Command &quot;Copy-Item $(ProjectDir)manifest.psd1 $(TargetDir)$(TargetName).psd1&quot;" />
3031
</Target>
3132
</Project>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,16 @@ public static async Task<CompilerResults> CompileVB(string sourceFileName, Compi
6060
var vbcPath = roslynToolset.GetVBCompiler(roslynVersion);
6161

6262
IEnumerable<string> references;
63+
string libPath;
6364
if ((flags & CompilerOptions.UseRoslynMask) != 0 && (flags & CompilerOptions.TargetNet40) == 0)
6465
{
6566
references = coreDefaultReferences.Select(r => "-r:\"" + r + "\"");
67+
libPath = coreRefAsmPath;
6668
}
6769
else
6870
{
6971
references = defaultReferences.Select(r => "-r:\"" + r + "\"");
72+
libPath = RefAsmPath;
7073
}
7174
if (flags.HasFlag(CompilerOptions.ReferenceVisualBasic))
7275
{
@@ -116,7 +119,7 @@ public static async Task<CompilerResults> CompileVB(string sourceFileName, Compi
116119
}
117120

118121
var command = Cli.Wrap(vbcPath)
119-
.WithArguments($"{otherOptions}{string.Join(" ", references)} -out:\"{Path.GetFullPath(results.PathToAssembly)}\" {string.Join(" ", sourceFileNames.Select(fn => '"' + Path.GetFullPath(fn) + '"'))}")
122+
.WithArguments($"{otherOptions}-libpath:\"{libPath}\" {string.Join(" ", references)} -out:\"{Path.GetFullPath(results.PathToAssembly)}\" {string.Join(" ", sourceFileNames.Select(fn => '"' + Path.GetFullPath(fn) + '"'))}")
120123
.WithValidation(CommandResultValidation.None);
121124
Console.WriteLine($"\"{command.TargetFilePath}\" {command.Arguments}");
122125

ICSharpCode.Decompiler.Tests/Helpers/Tester.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ private static string ReplacePrivImplDetails(string il)
295295
"System.Linq.Expressions.dll",
296296
"System.Linq.Queryable.dll",
297297
"System.IO.FileSystem.Watcher.dll",
298+
"System.Memory.dll",
298299
"System.Threading.dll",
299300
"System.Threading.Thread.dll",
300301
"System.Runtime.dll",

ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<EnableDefaultItems>false</EnableDefaultItems>
1818

1919
<AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects>
20+
<EnableUnsafeBinaryFormatterSerialization>True</EnableUnsafeBinaryFormatterSerialization>
2021

2122
<SignAssembly>True</SignAssembly>
2223
<AssemblyOriginatorKeyFile>..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.snk</AssemblyOriginatorKeyFile>
@@ -61,6 +62,7 @@
6162
<PackageReference Include="Mono.Cecil" Version="$(MonoCecilVersion)" />
6263
<PackageReference Include="Microsoft.NETCore.ILAsm" Version="$(ILAsmVersion)" />
6364
<PackageReference Include="Microsoft.NETCore.ILDAsm" Version="$(ILDAsmVersion)" />
65+
<PackageReference Include="System.Resources.Extensions" Version="6.0.0" />
6466
</ItemGroup>
6567

6668
<ItemGroup>
@@ -113,6 +115,7 @@
113115
<Compile Include="Output\InsertParenthesesVisitorTests.cs" />
114116
<Compile Include="ProjectDecompiler\TargetFrameworkTests.cs" />
115117
<Compile Include="TestAssemblyResolver.cs" />
118+
<Compile Include="Util\ResourceReaderWriterTests.cs" />
116119
<None Include="TestCases\VBPretty\VBAutomaticEvents.vb" />
117120
<Compile Include="TestCases\VBPretty\VBAutomaticEvents.cs" />
118121
<Compile Include="TestCases\VBPretty\VBNonGenericForEach.cs" />
@@ -322,6 +325,7 @@
322325
</ItemGroup>
323326

324327
<ItemGroup>
328+
<Content Include="TestCases\PdbGen\Members.xml" />
325329
<Content Include="TestCases\PdbGen\ProgressReporting.xml" />
326330
<Content Include="TestCases\PdbGen\ForLoopTests.xml" />
327331
<Content Include="TestCases\PdbGen\CustomPdbId.xml" />
@@ -337,6 +341,7 @@
337341
<None Include="TestCases\VBPretty\VBCompoundAssign.vb" />
338342
<None Include="TestCases\VBPretty\Async.vb" />
339343
<None Include="TestCases\VBPretty\VBPropertiesTest.vb" />
344+
<EmbeddedResource Include="Util\Test.resources" />
340345
</ItemGroup>
341346

342347
</Project>

ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
2-
//
2+
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
44
// software and associated documentation files (the "Software"), to deal in the Software
55
// without restriction, including without limitation the rights to use, copy, modify, merge,
66
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
77
// to whom the Software is furnished to do so, subject to the following conditions:
8-
//
8+
//
99
// The above copyright notice and this permission notice shall be included in all copies or
1010
// substantial portions of the Software.
11-
//
11+
//
1212
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
1313
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
1414
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
@@ -269,6 +269,12 @@ public async Task EmptyBodies()
269269
await Run();
270270
}
271271

272+
[Test]
273+
public async Task MonoFixed()
274+
{
275+
await Run();
276+
}
277+
272278
async Task Run([CallerMemberName] string testName = null, DecompilerSettings settings = null,
273279
AssemblerOptions assemblerOptions = AssemblerOptions.Library)
274280
{

ICSharpCode.Decompiler.Tests/PdbGenerationTestRunner.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ public void LambdaCapturing()
4343
TestGeneratePdb();
4444
}
4545

46+
[Test]
47+
[Ignore("Duplicate sequence points for local function")]
48+
public void Members()
49+
{
50+
TestGeneratePdb();
51+
}
52+
4653
[Test]
4754
public void CustomPdbId()
4855
{
@@ -155,7 +162,7 @@ private void TestGeneratePdb([CallerMemberName] string testName = null)
155162
ProcessXmlFile(expectedFileName);
156163
string generatedFileName = Path.ChangeExtension(xmlFile, ".generated.xml");
157164
ProcessXmlFile(generatedFileName);
158-
Assert.AreEqual(Normalize(expectedFileName), Normalize(generatedFileName));
165+
CodeAssert.AreEqual(Normalize(expectedFileName), Normalize(generatedFileName));
159166
}
160167

161168
private (string peFileName, string pdbFileName) CompileTestCase(string testName)

0 commit comments

Comments
 (0)