Skip to content

Commit fdb1991

Browse files
Merge branch 'master' of github.com:icsharpcode/ILSpy into string-interpolation
# Conflicts: # ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
2 parents 7358fae + b33bb70 commit fdb1991

File tree

71 files changed

+1027
-145
lines changed

Some content is hidden

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

71 files changed

+1027
-145
lines changed

BuildTools/appveyor-install.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ $ErrorActionPreference = "Stop"
33
$baseCommit = "d779383cb85003d6dabeb976f0845631e07bf463";
44
$baseCommitRev = 1;
55

6+
$masterBranches = @("master", "3.0.x");
7+
68
$globalAssemblyInfoTemplateFile = "ILSpy/Properties/AssemblyInfo.template.cs";
79

810
$versionParts = @{};
@@ -18,10 +20,10 @@ if ($versionName -ne "null") {
1820
} else {
1921
$versionName = "";
2022
}
21-
if ($env:APPVEYOR_REPO_BRANCH -ne 'master') {
22-
$branch = "-$env:APPVEYOR_REPO_BRANCH";
23-
} else {
23+
if ($masterBranches -contains $env:APPVEYOR_REPO_BRANCH) {
2424
$branch = "";
25+
} else {
26+
$branch = "-$env:APPVEYOR_REPO_BRANCH";
2527
}
2628
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
2729
$suffix = "-pr$env:APPVEYOR_PULL_REQUEST_NUMBER";

BuildTools/update-assemblyinfo.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
$baseCommit = "d779383cb85003d6dabeb976f0845631e07bf463";
44
$baseCommitRev = 1;
55

6+
$masterBranches = @("master", "3.0.x");
7+
68
$globalAssemblyInfoTemplateFile = "ILSpy/Properties/AssemblyInfo.template.cs";
79

810
function Test-File([string]$filename) {
@@ -96,10 +98,11 @@ try {
9698
$branchName = gitBranch;
9799
$gitCommitHash = gitCommitHash;
98100

99-
$postfixBranchName = "";
100-
if ($branchName -ne "master") {
101+
if ($masterBranches -contains $branchName) {
102+
$postfixBranchName = "";
103+
} else {
101104
$postfixBranchName = "-$branchName";
102-
}
105+
}
103106

104107
if ($versionName -eq "null") {
105108
$versionName = "";

DecompilerNuGetDemos.workbook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ platforms:
66
- DotNetCore
77
packages:
88
- id: ICSharpCode.Decompiler
9-
version: 3.0.0.3403-beta4
9+
version: 3.0.0.3447
1010
---
1111

1212
Setup: load the references required to work with the decompiler

ICSharpCode.Decompiler.Console/ICSharpCode.Decompiler.Console.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<ItemGroup>
1616
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.0.1" />
17-
<PackageReference Include="ICSharpCode.Decompiler" Version="3.0.0.3403-beta4" />
17+
<PackageReference Include="ICSharpCode.Decompiler" Version="3.0.0.3447" />
1818

1919
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
2020
<PackageReference Include="System.Runtime.Handles" Version="4.3.0" />

ICSharpCode.Decompiler.Console/Program.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,14 @@ static int Main(string[] args)
7575
return app.Execute(args);
7676
}
7777

78+
static CSharpDecompiler GetDecompiler(string assemblyFileName)
79+
{
80+
return new CSharpDecompiler(assemblyFileName, new DecompilerSettings() { ThrowOnAssemblyResolveErrors = false });
81+
}
82+
7883
static void ListContent(string assemblyFileName, TextWriter output, ISet<TypeKind> kinds)
7984
{
80-
CSharpDecompiler decompiler = new CSharpDecompiler(assemblyFileName, new DecompilerSettings());
85+
CSharpDecompiler decompiler = GetDecompiler(assemblyFileName);
8186

8287
foreach (var type in decompiler.TypeSystem.Compilation.MainAssembly.GetAllTypeDefinitions()) {
8388
if (!kinds.Contains(type.Kind))
@@ -95,7 +100,7 @@ static void DecompileAsProject(string assemblyFileName, string outputDirectory)
95100

96101
static void Decompile(string assemblyFileName, TextWriter output, string typeName = null)
97102
{
98-
CSharpDecompiler decompiler = new CSharpDecompiler(assemblyFileName, new DecompilerSettings());
103+
CSharpDecompiler decompiler = GetDecompiler(assemblyFileName);
99104

100105
if (typeName == null) {
101106
output.Write(decompiler.DecompileWholeModuleAsString());

ICSharpCode.Decompiler.PowerShell/Demo.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ Import-Module $modulePath
1010
$version = Get-DecompilerVersion
1111
Write-Output $version
1212

13-
$decompiler = Get-Decompiler $modulePath
13+
# different test assemblies - it makes a difference wrt .deps.json so there are two netstandard tests here
14+
$asm_netstdWithDepsJson = $basePath + '\bin\Debug\netstandard2.0\ICSharpCode.Decompiler.Powershell.dll'
15+
$asm_netstd = $basePath + '\bin\Debug\netstandard2.0\ICSharpCode.Decompiler.dll'
16+
17+
$decompiler = Get-Decompiler $asm_netstdWithDepsJson
1418

1519
$classes = Get-DecompiledTypes $decompiler -Types class
1620
$classes.Count

ICSharpCode.Decompiler.PowerShell/GetDecompilerCmdlet.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ protected override void ProcessRecord()
2020
string path = GetUnresolvedProviderPathFromPSPath(LiteralPath);
2121

2222
try {
23-
var decompiler = new CSharpDecompiler(path, new DecompilerSettings());
23+
var decompiler = new CSharpDecompiler(path, new DecompilerSettings() {
24+
ThrowOnAssemblyResolveErrors = false
25+
});
2426
WriteObject(decompiler);
2527

2628
} catch (Exception e) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<ItemGroup>
1010
<PackageReference Include="PowerShellStandard.Library" Version="3.0.0-preview-01" />
11-
<PackageReference Include="ICSharpCode.Decompiler" Version="3.0.0.3403-beta4" />
11+
<PackageReference Include="ICSharpCode.Decompiler" Version="3.0.0.3447" />
1212
</ItemGroup>
1313

1414
</Project>

ICSharpCode.Decompiler.Tests/Helpers/Tester.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public static CompilerResults CompileCSharp(string sourceFileName, CompilerOptio
187187
var preprocessorSymbols = GetPreprocessorSymbols(flags);
188188

189189
if (flags.HasFlag(CompilerOptions.UseRoslyn)) {
190-
var parseOptions = new CSharpParseOptions(preprocessorSymbols: preprocessorSymbols.ToArray());
190+
var parseOptions = new CSharpParseOptions(preprocessorSymbols: preprocessorSymbols.ToArray(), languageVersion: LanguageVersion.Latest);
191191
var syntaxTrees = sourceFileNames.Select(f => SyntaxFactory.ParseSyntaxTree(File.ReadAllText(f), parseOptions, path: f));
192192
var compilation = CSharpCompilation.Create(Path.GetFileNameWithoutExtension(sourceFileName),
193193
syntaxTrees, defaultReferences.Value,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
<PropertyGroup>
55
<TargetFramework>net46</TargetFramework>
6+
<LangVersion>latest</LangVersion>
67

78
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
89

@@ -62,6 +63,8 @@
6263
<Compile Include="TestCases\Correctness\MiniJSON.cs" />
6364
<Compile Include="TestCases\Correctness\FloatingPointArithmetic.cs" />
6465
<Compile Include="TestCases\ILPretty\Issue982.cs" />
66+
<Compile Include="TestCases\Pretty\AsyncMain.cs" />
67+
<Compile Include="TestCases\Pretty\CS72_PrivateProtected.cs" />
6568
<Compile Include="TestCases\Pretty\CS6_StringInterpolation.cs" />
6669
<Compile Include="TestCases\Pretty\ExpressionTrees.cs" />
6770
<Compile Include="TestCases\Pretty\VariableNaming.cs" />

0 commit comments

Comments
 (0)