Browse Source

Merge pull request #3546 from petercrabtree/dev/dev-env-clean-no-bom

Normalize UTF-8 BOM Marks and ps1 Indention
pull/3551/head
Siegfried Pammer 4 months ago committed by GitHub
parent
commit
967de581d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      .editorconfig
  2. 171
      BuildTools/bom-classify-encodings.ps1
  3. 208
      BuildTools/bom-strip.ps1
  4. 40
      BuildTools/create-filelists.ps1
  5. 4
      BuildTools/ghactions-install.ps1
  6. 187
      BuildTools/update-assemblyinfo.ps1
  7. 2
      ICSharpCode.BamlDecompiler/Baml/BamlContext.cs
  8. 2
      ICSharpCode.BamlDecompiler/Baml/BamlDocument.cs
  9. 2
      ICSharpCode.BamlDecompiler/Baml/BamlNode.cs
  10. 2
      ICSharpCode.BamlDecompiler/Baml/BamlReader.cs
  11. 2
      ICSharpCode.BamlDecompiler/Baml/BamlRecords.cs
  12. 2
      ICSharpCode.BamlDecompiler/Baml/BamlWriter.cs
  13. 2
      ICSharpCode.BamlDecompiler/Baml/KnownMembers.cs
  14. 2
      ICSharpCode.BamlDecompiler/Baml/KnownThings.cs
  15. 2
      ICSharpCode.BamlDecompiler/Baml/KnownThings.g.cs
  16. 2
      ICSharpCode.BamlDecompiler/Baml/KnownThings.gen.cs
  17. 2
      ICSharpCode.BamlDecompiler/Baml/KnownTypes.cs
  18. 2
      ICSharpCode.BamlDecompiler/BamlConnectionId.cs
  19. 2
      ICSharpCode.BamlDecompiler/BamlDecompilationResult.cs
  20. 2
      ICSharpCode.BamlDecompiler/BamlDecompilerSettings.cs
  21. 2
      ICSharpCode.BamlDecompiler/BamlDecompilerTypeSystem.cs
  22. 2
      ICSharpCode.BamlDecompiler/BamlElement.cs
  23. 2
      ICSharpCode.BamlDecompiler/Handlers/Blocks/ConstructorParametersHandler.cs
  24. 2
      ICSharpCode.BamlDecompiler/Handlers/Blocks/DocumentHandler.cs
  25. 2
      ICSharpCode.BamlDecompiler/Handlers/Blocks/ElementHandler.cs
  26. 2
      ICSharpCode.BamlDecompiler/Handlers/Blocks/KeyElementStartHandler.cs
  27. 2
      ICSharpCode.BamlDecompiler/Handlers/Blocks/PropertyArrayHandler.cs
  28. 2
      ICSharpCode.BamlDecompiler/Handlers/Blocks/PropertyComplexHandler.cs
  29. 2
      ICSharpCode.BamlDecompiler/Handlers/Blocks/PropertyDictionaryHandler.cs
  30. 2
      ICSharpCode.BamlDecompiler/Handlers/Blocks/PropertyListHandler.cs
  31. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/AssemblyInfoHandler.cs
  32. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/AttributeInfoHandler.cs
  33. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/ConnectionIdHandler.cs
  34. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/ConstructorParameterTypeHandler.cs
  35. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/ContentPropertyHandler.cs
  36. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/DefAttributeHandler.cs
  37. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/DefAttributeKeyStringHandler.cs
  38. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/DefAttributeKeyTypeHandler.cs
  39. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/DeferableContentStartHandler.cs
  40. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/LineNumberAndPositionHandler.cs
  41. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/LinePositionHandler.cs
  42. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/LiteralContentHandler.cs
  43. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/OptimizedStaticResourceHandler.cs
  44. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/PIMappingHandler.cs
  45. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/PresentationOptionsAttributeHandler.cs
  46. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/PropertyCustomHandler.cs
  47. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/PropertyHandler.cs
  48. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/PropertyTypeReferenceHandler.cs
  49. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/PropertyWithConverterHandler.cs
  50. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/PropertyWithExtensionHandler.cs
  51. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/PropertyWithStaticResourceIdHandler.cs
  52. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/StaticResourceIdHandler.cs
  53. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/StaticResourceStartHandler.cs
  54. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/TextHandler.cs
  55. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/TextWithConverterHandler.cs
  56. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/TypeInfoHandler.cs
  57. 2
      ICSharpCode.BamlDecompiler/Handlers/Records/XmlnsPropertyHandler.cs
  58. 2
      ICSharpCode.BamlDecompiler/ICSharpCode.BamlDecompiler.csproj
  59. 2
      ICSharpCode.BamlDecompiler/IHandlers.cs
  60. 2
      ICSharpCode.BamlDecompiler/IRewritePass.cs
  61. 2
      ICSharpCode.BamlDecompiler/PackageReadme.md
  62. 2
      ICSharpCode.BamlDecompiler/Rewrite/AttributeRewritePass.cs
  63. 2
      ICSharpCode.BamlDecompiler/Rewrite/ConnectionIdRewritePass.cs
  64. 2
      ICSharpCode.BamlDecompiler/Rewrite/DocumentRewritePass.cs
  65. 2
      ICSharpCode.BamlDecompiler/Rewrite/MarkupExtensionRewritePass.cs
  66. 2
      ICSharpCode.BamlDecompiler/Rewrite/XClassRewritePass.cs
  67. 2
      ICSharpCode.BamlDecompiler/Xaml/NamespaceMap.cs
  68. 2
      ICSharpCode.BamlDecompiler/Xaml/XamlExtension.cs
  69. 2
      ICSharpCode.BamlDecompiler/Xaml/XamlPathDeserializer.cs
  70. 2
      ICSharpCode.BamlDecompiler/Xaml/XamlProperty.cs
  71. 2
      ICSharpCode.BamlDecompiler/Xaml/XamlResourceKey.cs
  72. 2
      ICSharpCode.BamlDecompiler/Xaml/XamlType.cs
  73. 2
      ICSharpCode.BamlDecompiler/Xaml/XamlUtils.cs
  74. 2
      ICSharpCode.BamlDecompiler/XamlContext.cs
  75. 2
      ICSharpCode.BamlDecompiler/XamlDecompiler.cs
  76. 2
      ICSharpCode.BamlDecompiler/XmlnsDictionary.cs
  77. 4
      ICSharpCode.Decompiler.PowerShell/Demo.ps1
  78. 2
      ICSharpCode.Decompiler.PowerShell/ErrorIds.cs
  79. 2
      ICSharpCode.Decompiler.PowerShell/GetDecompiledProjectCmdlet.cs
  80. 2
      ICSharpCode.Decompiler.PowerShell/GetDecompiledSourceCmdlet.cs
  81. 2
      ICSharpCode.Decompiler.PowerShell/GetDecompiledTypesCmdlet.cs
  82. 2
      ICSharpCode.Decompiler.PowerShell/GetDecompilerCmdlet.cs
  83. 2
      ICSharpCode.Decompiler.PowerShell/GetDecompilerVersion.cs
  84. 2
      ICSharpCode.Decompiler.PowerShell/GetTargetFramework.cs
  85. 2
      ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj
  86. 2
      ICSharpCode.Decompiler.PowerShell/NullAttributes.cs
  87. 2
      ICSharpCode.Decompiler.PowerShell/TypesParser.cs
  88. 2
      ICSharpCode.Decompiler.TestRunner/Program.cs
  89. 2
      ICSharpCode.Decompiler.Tests/DataFlowTest.cs
  90. 2
      ICSharpCode.Decompiler.Tests/DisassemblerPrettyTestRunner.cs
  91. 2
      ICSharpCode.Decompiler.Tests/Helpers/CodeAssert.cs
  92. 2
      ICSharpCode.Decompiler.Tests/Helpers/RemoveCompilerAttribute.cs
  93. 2
      ICSharpCode.Decompiler.Tests/Helpers/RoslynToolset.cs
  94. 2
      ICSharpCode.Decompiler.Tests/Helpers/SdkUtility.cs
  95. 2
      ICSharpCode.Decompiler.Tests/Helpers/Tester.VB.cs
  96. 2
      ICSharpCode.Decompiler.Tests/Helpers/Tester.cs
  97. 2
      ICSharpCode.Decompiler.Tests/Helpers/TestsAssemblyOutput.cs
  98. 2
      ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs
  99. 2
      ICSharpCode.Decompiler.Tests/Output/CSharpAmbienceTests.cs
  100. 2
      ICSharpCode.Decompiler.Tests/Output/InsertParenthesesVisitorTests.cs
  101. Some files were not shown because too many files have changed in this diff Show More

6
.editorconfig

@ -2,12 +2,18 @@ @@ -2,12 +2,18 @@
root = true
[*]
charset = utf-8 # standardize on no BOM (except resx, see below)
indent_style = tab
indent_size = 4
guidelines = 110
tab_width = 4
end_of_line = crlf
# .net tooling writes the BOM to resx files on running dotnet build ILSpy.sln regardless,
# so we should direct text editors to NOT change the file
[*.resx]
charset = utf-8-bom
[*.il]
indent_style = space
indent_size = 2

171
BuildTools/bom-classify-encodings.ps1

@ -0,0 +1,171 @@ @@ -0,0 +1,171 @@
<#
.SYNOPSIS
Classify text files by encoding under the current subtree, respecting .gitignore.
.DESCRIPTION
Enumerates tracked files and untracked-but-not-ignored files (via Git) beneath
PWD. Skips likely-binary files (NUL probe). Classifies remaining files as:
- 'utf8' : valid UTF-8 (no BOM) or empty file
- 'utf8-with-bom' : starts with UTF-8 BOM (EF BB BF)
- 'other' : text but not valid UTF-8 (e.g., UTF-16/ANSI)
Outputs:
1) Relative paths of files classified as 'other'
2) A table by extension: UTF8 / UTF8-with-BOM / Other / Total
Notes:
- Read-only: this script makes no changes.
- Requires Git and must be run inside a Git work tree.
#>
[CmdletBinding()]
param()
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
# --- Git enumeration ---------------------------------------------------------
function Assert-InGitWorkTree {
# Throws if not inside a Git work tree.
$inside = (& git rev-parse --is-inside-work-tree 2>$null).Trim()
if ($LASTEXITCODE -ne 0 -or $inside -ne 'true') {
throw 'Not in a Git work tree.'
}
}
function Get-GitFilesUnderPwd {
<#
Returns full paths to tracked + untracked-not-ignored files under PWD.
#>
Assert-InGitWorkTree
$repoRoot = (& git rev-parse --show-toplevel).Trim()
$pwdPath = (Get-Location).Path
# cached (tracked) + others (untracked not ignored)
$nulSeparated = & git -C $repoRoot ls-files -z --cached --others --exclude-standard
$relativePaths = $nulSeparated.Split(
[char]0, [System.StringSplitOptions]::RemoveEmptyEntries)
foreach ($relPath in $relativePaths) {
$fullPath = Join-Path $repoRoot $relPath
# Only include files under the current subtree.
if ($fullPath.StartsWith($pwdPath,
[System.StringComparison]::OrdinalIgnoreCase)) {
if (Test-Path -LiteralPath $fullPath -PathType Leaf) { $fullPath }
}
}
}
# --- Probes ------------------------------------------------------------------
function Test-ProbablyBinary {
# Heuristic: treat as binary if the first 8 KiB contains any NUL byte.
param([Parameter(Mandatory)][string]$Path)
try {
$stream = [System.IO.File]::Open($Path,'Open','Read','ReadWrite')
try {
$len = [int][Math]::Min(8192,$stream.Length)
if ($len -le 0) { return $false }
$buffer = [byte[]]::new($len)
[void]$stream.Read($buffer,0,$len)
return ($buffer -contains 0)
}
finally { $stream.Dispose() }
}
catch { return $false }
}
function Get-TextEncodingCategory {
# Returns 'utf8', 'utf8-with-bom', 'other', or $null for likely-binary.
param([Parameter(Mandatory)][string]$Path)
$stream = [System.IO.File]::Open($Path,'Open','Read','ReadWrite')
try {
$fileLength = $stream.Length
if ($fileLength -eq 0) { return 'utf8' }
# BOM check (EF BB BF)
$header = [byte[]]::new([Math]::Min(3,$fileLength))
[void]$stream.Read($header,0,$header.Length)
if ($header.Length -ge 3 -and
$header[0] -eq 0xEF -and $header[1] -eq 0xBB -and $header[2] -eq 0xBF) {
return 'utf8-with-bom'
}
# Quick binary probe before expensive decoding
$stream.Position = 0
$sampleLen = [int][Math]::Min(8192,$fileLength)
$sample = [byte[]]::new($sampleLen)
[void]$stream.Read($sample,0,$sampleLen)
if ($sample -contains 0) { return $null }
}
finally { $stream.Dispose() }
# Validate UTF-8 by decoding with throw-on-invalid option (no BOM).
try {
$bytes = [System.IO.File]::ReadAllBytes($Path)
$utf8 = [System.Text.UTF8Encoding]::new($false,$true)
[void]$utf8.GetString($bytes)
return 'utf8'
}
catch { return 'other' }
}
# --- Main --------------------------------------------------------------------
$otherFiles = @()
$byExtension = @{}
$allFiles = Get-GitFilesUnderPwd
foreach ($fullPath in $allFiles) {
# Avoid decoding likely-binary files.
if (Test-ProbablyBinary $fullPath) { continue }
$category = Get-TextEncodingCategory $fullPath
if (-not $category) { continue }
$ext = [IO.Path]::GetExtension($fullPath).ToLower()
if (-not $byExtension.ContainsKey($ext)) {
$byExtension[$ext] = @{ 'utf8' = 0; 'utf8-with-bom' = 0; 'other' = 0 }
}
$byExtension[$ext][$category]++
if ($category -eq 'other') {
$otherFiles += (Resolve-Path -LiteralPath $fullPath -Relative)
}
}
# 1) Files in 'other'
if ($otherFiles.Count -gt 0) {
'Files classified as ''other'':'
$otherFiles | Sort-Object | ForEach-Object { " $_" }
''
}
# 2) Table by extension
$rows = foreach ($kv in $byExtension.GetEnumerator()) {
$ext = if ($kv.Key) { $kv.Key } else { '[noext]' }
$u = [int]$kv.Value['utf8']
$b = [int]$kv.Value['utf8-with-bom']
$o = [int]$kv.Value['other']
[PSCustomObject]@{
Extension = $ext
UTF8 = $u
'UTF8-with-BOM' = $b
Other = $o
Total = $u + $b + $o
}
}
$rows |
Sort-Object -Property (
@{Expression='Total';Descending=$true},
@{Expression='Extension';Descending=$false}
) |
Format-Table -AutoSize

208
BuildTools/bom-strip.ps1

@ -0,0 +1,208 @@ @@ -0,0 +1,208 @@
<#
.SYNOPSIS
Strip UTF-8 BOM from selected text files under the current subtree, respecting
.gitignore.
.DESCRIPTION
Enumerates tracked and untracked-but-not-ignored files under the current
directory (via Git), filters to texty extensions and dotfiles, skips likely
binary files (NUL probe), and removes a leading UTF-8 BOM (EF BB BF) in place.
Refuses to run if there are uncommitted changes as a safeguard. Use -Force to override.
Supports -WhatIf/-Confirm via ShouldProcess.
#>
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Low')]
param(
[switch]$Force
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
# --- File sets (ILSpy) ------------------------------------------------------
$Dotfiles = @(
'.gitignore', '.editorconfig', '.gitattributes', '.gitmodules',
'.tgitconfig', '.vsconfig'
)
$AllowedExts = @(
'.bat','.config','.cs','.csproj','.css','.filelist','.fs','.html','.il',
'.ipynb','.js','.json','.less','.manifest','.md','.projitems','.props',
'.ps1','.psd1','.ruleset','.shproj','.sln','.slnf','.svg','.template',
'.tt', '.txt','.vb','.vsct','.vsixlangpack','.wxl','.xaml','.xml','.xshd','.yml'
)
$IncludeNoExt = $true # include names like LICENSE
# --- Git checks / enumeration -----------------------------------------------
function Assert-InGitWorkTree {
$inside = (& git rev-parse --is-inside-work-tree 2>$null).Trim()
if ($LASTEXITCODE -ne 0 -or $inside -ne 'true') {
throw 'Not in a Git work tree.'
}
}
function Assert-CleanWorkingTree {
if ($Force) { return }
$status = & git status --porcelain -z
if ($LASTEXITCODE -ne 0) { throw 'git status failed.' }
if (-not [string]::IsNullOrEmpty($status)) {
throw 'Working tree not clean. Commit/stash changes or use -Force.'
}
}
function Get-GitFilesUnderPwd {
Assert-InGitWorkTree
$repoRoot = (& git rev-parse --show-toplevel).Trim()
$pwdPath = (Get-Location).Path
$tracked = & git -C $repoRoot ls-files -z
$others = & git -C $repoRoot ls-files --others --exclude-standard -z
$allRel = ("$tracked$others").Split(
[char]0, [System.StringSplitOptions]::RemoveEmptyEntries)
foreach ($relPath in $allRel) {
$fullPath = Join-Path $repoRoot $relPath
if ($fullPath.StartsWith($pwdPath,
[System.StringComparison]::OrdinalIgnoreCase)) {
if (Test-Path -LiteralPath $fullPath -PathType Leaf) {
$fullPath
}
}
}
}
# --- Probes -----------------------------------------------------------------
function Test-HasUtf8Bom {
param([Parameter(Mandatory)][string]$Path)
try {
$stream = [System.IO.File]::Open($Path,'Open','Read','ReadWrite')
try {
if ($stream.Length -lt 3) { return $false }
$header = [byte[]]::new(3)
[void]$stream.Read($header,0,3)
return ($header[0] -eq 0xEF -and
$header[1] -eq 0xBB -and
$header[2] -eq 0xBF)
}
finally {
$stream.Dispose()
}
}
catch { return $false }
}
function Test-ProbablyBinary {
# Binary if the first 8 KiB contains any NUL byte.
param([Parameter(Mandatory)][string]$Path)
try {
$stream = [System.IO.File]::Open($Path,'Open','Read','ReadWrite')
try {
$len = [int][Math]::Min(8192,$stream.Length)
if ($len -le 0) { return $false }
$buffer = [byte[]]::new($len)
[void]$stream.Read($buffer,0,$len)
return ($buffer -contains 0)
}
finally {
$stream.Dispose()
}
}
catch { return $false }
}
# --- Mutation ---------------------------------------------------------------
function Remove-Utf8BomInPlace {
# Write the existing buffer from offset 3, no extra full-size allocation.
param([Parameter(Mandatory)][string]$Path)
$bytes = [System.IO.File]::ReadAllBytes($Path)
if ($bytes.Length -lt 3) { return $false }
if ($bytes[0] -ne 0xEF -or
$bytes[1] -ne 0xBB -or
$bytes[2] -ne 0xBF) {
return $false
}
$stream = [System.IO.File]::Open($Path,'Create','Write','ReadWrite')
try {
$stream.Write($bytes, 3, $bytes.Length - 3)
$stream.SetLength($bytes.Length - 3)
}
finally {
$stream.Dispose()
}
return $true
}
# --- Main -------------------------------------------------------------------
Assert-InGitWorkTree
Assert-CleanWorkingTree
$allFiles = Get-GitFilesUnderPwd
$targets = $allFiles | % {
$fileName = [IO.Path]::GetFileName($_)
$ext = [IO.Path]::GetExtension($fileName)
$isDot = $Dotfiles -contains $fileName
$isNoExt = -not $fileName.Contains('.')
if ($isDot -or ($AllowedExts -contains $ext) -or
($IncludeNoExt -and $isNoExt -and -not $isDot)) {
$_
}
}
| ? { Test-HasUtf8Bom $_ }
| ? { -not (Test-ProbablyBinary $_) }
$changed = 0
$byExtension = @{}
$dotfileChanges = 0
$targets | % {
$relative = Resolve-Path -LiteralPath $_ -Relative
if ($PSCmdlet.ShouldProcess($relative,'Strip UTF-8 BOM')) {
if (Remove-Utf8BomInPlace -Path $_) {
$changed++
$fileName = [IO.Path]::GetFileName($_)
if ($Dotfiles -contains $fileName) { $dotfileChanges++ }
$ext = [IO.Path]::GetExtension($fileName)
if (-not $byExtension.ContainsKey($ext)) { $byExtension[$ext] = 0 }
$byExtension[$ext]++
"stripped BOM: $relative"
}
}
}
"Done. Stripped BOM from $changed file(s)."
if ($byExtension.Keys.Count -gt 0) {
""
"By extension:"
$byExtension.GetEnumerator() | Sort-Object Name | % {
$key = if ([string]::IsNullOrEmpty($_.Name)) { '[noext]' } else { $_.Name }
" {0}: {1}" -f $key, $_.Value
}
}
if ($dotfileChanges -gt 0) {
" [dotfiles]: $dotfileChanges"
}

40
BuildTools/create-filelists.ps1

@ -1,25 +1,25 @@ @@ -1,25 +1,25 @@
$ErrorActionPreference = "Stop";
$ErrorActionPreference = "Stop";
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
gci -Include *.vsix, *.msi -recurse | foreach ($_) {
if (-not ($_.FullName -contains "\bin\Debug\")) {
continue;
}
$idx=-1;
$body=$false;
$outputFileName = ".\BuildTools\$($_.Name -replace '-\d+\.\d+\.\d+\.\d+', '').filelist";
$lines = 7z l $_.FullName | foreach {
if ($idx -eq -1) {
$idx = $_.IndexOf("Name");
}
$p = $body;
if ($idx -gt 0) {
$body = ($body -ne ($_ -match ' *-[ -]+'))
}
if ($p -and $body) {
$_.Substring($idx)
}
} | sort
[System.IO.File]::WriteAllLines($outputFileName, $lines, $Utf8NoBomEncoding)
if (-not ($_.FullName -contains "\bin\Debug\")) {
continue;
}
$idx=-1;
$body=$false;
$outputFileName = ".\BuildTools\$($_.Name -replace '-\d+\.\d+\.\d+\.\d+', '').filelist";
$lines = 7z l $_.FullName | foreach {
if ($idx -eq -1) {
$idx = $_.IndexOf("Name");
}
$p = $body;
if ($idx -gt 0) {
$body = ($body -ne ($_ -match ' *-[ -]+'))
}
if ($p -and $body) {
$_.Substring($idx)
}
} | sort
[System.IO.File]::WriteAllLines($outputFileName, $lines, $Utf8NoBomEncoding)
}

4
BuildTools/ghactions-install.ps1

@ -17,9 +17,9 @@ $build = $versionParts.Build; @@ -17,9 +17,9 @@ $build = $versionParts.Build;
$versionName = $versionParts.VersionName;
if ($versionName -ne "null") {
$versionName = "-$versionName";
$versionName = "-$versionName";
} else {
$versionName = "";
$versionName = "";
}
Write-Host "GITHUB_REF: '$env:GITHUB_REF'";

187
BuildTools/update-assemblyinfo.ps1

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
if (-not ($PSVersionTable.PSCompatibleVersions -contains "5.0")) {
Write-Error "This script requires at least powershell version 5.0!";
return 255;
if (-not ($PSVersionTable.PSCompatibleVersions -contains "5.0")) {
Write-Error "This script requires at least powershell version 5.0!";
return 255;
}
$ErrorActionPreference = "Stop"
@ -14,11 +14,11 @@ $masterBranches = '^(master|release/.+)$'; @@ -14,11 +14,11 @@ $masterBranches = '^(master|release/.+)$';
$decompilerVersionInfoTemplateFile = "ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.template.cs";
function Test-File([string]$filename) {
return [System.IO.File]::Exists((Join-Path (Get-Location) $filename));
return [System.IO.File]::Exists((Join-Path (Get-Location) $filename));
}
function Test-Dir([string]$name) {
return [System.IO.Directory]::Exists((Join-Path (Get-Location) $name));
return [System.IO.Directory]::Exists((Join-Path (Get-Location) $name));
}
function Find-Git() {
@ -44,63 +44,63 @@ function Find-Git() { @@ -44,63 +44,63 @@ function Find-Git() {
}
function No-Git() {
return -not (((Test-Dir ".git") -or (Test-File ".git")) -and (Find-Git));
return -not (((Test-Dir ".git") -or (Test-File ".git")) -and (Find-Git));
}
function gitVersion() {
if (No-Git) {
return 0;
}
try {
return [Int32]::Parse((git rev-list --count "$baseCommit..HEAD" 2>&1 | Tee-Object -Variable cmdOutput)) + $baseCommitRev;
} catch {
Write-Host $cmdOutput
return 0;
}
if (No-Git) {
return 0;
}
try {
return [Int32]::Parse((git rev-list --count "$baseCommit..HEAD" 2>&1 | Tee-Object -Variable cmdOutput)) + $baseCommitRev;
} catch {
Write-Host $cmdOutput
return 0;
}
}
function gitCommitHash() {
if (No-Git) {
return "0000000000000000000000000000000000000000";
}
try {
return (git rev-list --max-count 1 HEAD 2>&1 | Tee-Object -Variable cmdOutput);
} catch {
Write-Host $cmdOutput
return "0000000000000000000000000000000000000000";
}
if (No-Git) {
return "0000000000000000000000000000000000000000";
}
try {
return (git rev-list --max-count 1 HEAD 2>&1 | Tee-Object -Variable cmdOutput);
} catch {
Write-Host $cmdOutput
return "0000000000000000000000000000000000000000";
}
}
function gitShortCommitHash() {
if (No-Git) {
return "00000000";
}
try {
return (git rev-parse --short=8 (git rev-list --max-count 1 HEAD 2>&1 | Tee-Object -Variable cmdOutput) 2>&1 | Tee-Object -Variable cmdOutput);
} catch {
Write-Host $cmdOutput
return "00000000";
}
if (No-Git) {
return "00000000";
}
try {
return (git rev-parse --short=8 (git rev-list --max-count 1 HEAD 2>&1 | Tee-Object -Variable cmdOutput) 2>&1 | Tee-Object -Variable cmdOutput);
} catch {
Write-Host $cmdOutput
return "00000000";
}
}
function gitBranch() {
if (No-Git) {
return "no-branch";
}
if (No-Git) {
return "no-branch";
}
if ($env:APPVEYOR_REPO_BRANCH -ne $null) {
return $env:APPVEYOR_REPO_BRANCH;
} elseif ($env:BUILD_SOURCEBRANCHNAME -ne $null) {
return $env:BUILD_SOURCEBRANCHNAME;
} else {
return ((git branch --no-color).Split([System.Environment]::NewLine) | where { $_ -match "^\* " } | select -First 1).Substring(2);
}
return $env:APPVEYOR_REPO_BRANCH;
} elseif ($env:BUILD_SOURCEBRANCHNAME -ne $null) {
return $env:BUILD_SOURCEBRANCHNAME;
} else {
return ((git branch --no-color).Split([System.Environment]::NewLine) | where { $_ -match "^\* " } | select -First 1).Substring(2);
}
}
$templateFiles = (
@{Input=$decompilerVersionInfoTemplateFile; Output="ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.cs"},
@{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=$decompilerVersionInfoTemplateFile; Output="ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.cs"},
@{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"}
);
[string]$mutexId = "ILSpyUpdateAssemblyInfo" + (Get-Location).ToString().GetHashCode();
@ -108,43 +108,43 @@ Write-Host $mutexId; @@ -108,43 +108,43 @@ Write-Host $mutexId;
[bool]$createdNew = $false;
$mutex = New-Object System.Threading.Mutex($true, $mutexId, [ref]$createdNew);
try {
if (-not $createdNew) {
try {
$mutex.WaitOne(10000);
} catch [System.Threading.AbandonedMutexException] {
}
return 0;
}
if (-not (Test-File "ILSpy.sln")) {
Write-Error "Working directory must be the ILSpy repo root!";
return 2;
}
$versionParts = @{};
Get-Content $decompilerVersionInfoTemplateFile | where { $_ -match 'string (\w+) = "?(\w+)"?;' } | foreach { $versionParts.Add($Matches[1], $Matches[2]) }
$major = $versionParts.Major;
$minor = $versionParts.Minor;
$build = $versionParts.Build;
$versionName = $versionParts.VersionName;
$revision = gitVersion;
$branchName = gitBranch;
$gitCommitHash = gitCommitHash;
if (-not $createdNew) {
try {
$mutex.WaitOne(10000);
} catch [System.Threading.AbandonedMutexException] {
}
return 0;
}
if (-not (Test-File "ILSpy.sln")) {
Write-Error "Working directory must be the ILSpy repo root!";
return 2;
}
$versionParts = @{};
Get-Content $decompilerVersionInfoTemplateFile | where { $_ -match 'string (\w+) = "?(\w+)"?;' } | foreach { $versionParts.Add($Matches[1], $Matches[2]) }
$major = $versionParts.Major;
$minor = $versionParts.Minor;
$build = $versionParts.Build;
$versionName = $versionParts.VersionName;
$revision = gitVersion;
$branchName = gitBranch;
$gitCommitHash = gitCommitHash;
$gitShortCommitHash = gitShortCommitHash;
if ($branchName -match $masterBranches) {
$postfixBranchName = "";
} else {
$postfixBranchName = "-$branchName";
if ($branchName -match $masterBranches) {
$postfixBranchName = "";
} else {
$postfixBranchName = "-$branchName";
}
if ($versionName -eq "null") {
$versionName = "";
$postfixVersionName = "";
} else {
$postfixVersionName = "-$versionName";
}
if ($versionName -eq "null") {
$versionName = "";
$postfixVersionName = "";
} else {
$postfixVersionName = "-$versionName";
}
$buildConfig = $args[0].ToString().ToLower();
if ($buildConfig -eq "release") {
@ -153,13 +153,13 @@ try { @@ -153,13 +153,13 @@ try {
$buildConfig = "-" + $buildConfig;
}
$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";
}
$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;
foreach ($file in $templateFiles) {
[string]$in = (Get-Content $file.Input) -Join [System.Environment]::NewLine;
$out = $in.Replace('$INSERTVERSION$', $fullVersionNumber);
$out = $out.Replace('$INSERTMAJORVERSION$', $major);
@ -169,17 +169,18 @@ try { @@ -169,17 +169,18 @@ try {
$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('$INSERTBRANCHPOSTFIX$', $postfixBranchName);
$out = $out.Replace('$INSERTVERSIONNAME$', $versionName);
$out = $out.Replace('$INSERTVERSIONNAMEPOSTFIX$', $postfixVersionName);
$out = $out.Replace('$INSERTBUILDCONFIG$', $buildConfig);
$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;
}
}
if ((-not (Test-File $file.Output)) -or (((Get-Content $file.Output) -Join [System.Environment]::NewLine) -ne $out)) {
$utf8NoBom = New-Object System.Text.UTF8Encoding($false);
[System.IO.File]::WriteAllText($file.Output, $out, $utf8NoBom);
}
}
} finally {
$mutex.ReleaseMutex();
$mutex.Close();
$mutex.ReleaseMutex();
$mutex.Close();
}

2
ICSharpCode.BamlDecompiler/Baml/BamlContext.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Baml/BamlDocument.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Baml/BamlNode.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Baml/BamlReader.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Baml/BamlRecords.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Baml/BamlWriter.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Baml/KnownMembers.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Baml/KnownThings.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Baml/KnownThings.g.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Baml/KnownThings.gen.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Baml/KnownTypes.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/BamlConnectionId.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2019 Siegfried Pammer
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/BamlDecompilationResult.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2021 Siegfried Pammer
// Copyright (c) 2021 Siegfried Pammer
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.BamlDecompiler/BamlDecompilerSettings.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2021 Siegfried Pammer
// Copyright (c) 2021 Siegfried Pammer
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.BamlDecompiler/BamlDecompilerTypeSystem.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2021 Siegfried Pammer
// Copyright (c) 2021 Siegfried Pammer
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.BamlDecompiler/BamlElement.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Blocks/ConstructorParametersHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Blocks/DocumentHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Blocks/ElementHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Blocks/KeyElementStartHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Blocks/PropertyArrayHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Blocks/PropertyComplexHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Blocks/PropertyDictionaryHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Blocks/PropertyListHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/AssemblyInfoHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/AttributeInfoHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/ConnectionIdHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/ConstructorParameterTypeHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/ContentPropertyHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/DefAttributeHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/DefAttributeKeyStringHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/DefAttributeKeyTypeHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/DeferableContentStartHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/LineNumberAndPositionHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/LinePositionHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/LiteralContentHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/OptimizedStaticResourceHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/PIMappingHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/PresentationOptionsAttributeHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/PropertyCustomHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/PropertyHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/PropertyTypeReferenceHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/PropertyWithConverterHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/PropertyWithExtensionHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/PropertyWithStaticResourceIdHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/StaticResourceIdHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2019 Siegfried Pammer
// Copyright (c) 2019 Siegfried Pammer
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.BamlDecompiler/Handlers/Records/StaticResourceStartHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2019 Siegfried Pammer
// Copyright (c) 2019 Siegfried Pammer
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.BamlDecompiler/Handlers/Records/TextHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/TextWithConverterHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/TypeInfoHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Handlers/Records/XmlnsPropertyHandler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/ICSharpCode.BamlDecompiler.csproj

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>

2
ICSharpCode.BamlDecompiler/IHandlers.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/IRewritePass.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/PackageReadme.md

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
## About
## About
ICSharpCode.BamlDecompiler is the library used by the BAML Addin in ILSpy to decompile BAML to XAML.

2
ICSharpCode.BamlDecompiler/Rewrite/AttributeRewritePass.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Rewrite/ConnectionIdRewritePass.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2019 Siegfried Pammer
// Copyright (c) 2019 Siegfried Pammer
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.BamlDecompiler/Rewrite/DocumentRewritePass.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Rewrite/MarkupExtensionRewritePass.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Rewrite/XClassRewritePass.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Xaml/NamespaceMap.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Xaml/XamlExtension.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Xaml/XamlPathDeserializer.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Xaml/XamlProperty.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Xaml/XamlResourceKey.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Xaml/XamlType.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/Xaml/XamlUtils.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/XamlContext.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/XamlDecompiler.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

2
ICSharpCode.BamlDecompiler/XmlnsDictionary.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy

4
ICSharpCode.Decompiler.PowerShell/Demo.ps1

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
$basePath = $PSScriptRoot
if ([string]::IsNullOrEmpty($basePath))
{
$basePath = Split-Path -parent $psISE.CurrentFile.Fullpath
$basePath = Split-Path -parent $psISE.CurrentFile.Fullpath
}
$modulePath = $basePath + '\bin\Debug\netstandard2.0\ICSharpCode.Decompiler.Powershell.dll'
@ -21,7 +21,7 @@ $classes.Count @@ -21,7 +21,7 @@ $classes.Count
foreach ($c in $classes)
{
Write-Output $c.FullName
Write-Output $c.FullName
}

2
ICSharpCode.Decompiler.PowerShell/ErrorIds.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Text;

2
ICSharpCode.Decompiler.PowerShell/GetDecompiledProjectCmdlet.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Management.Automation;
using System.Threading;

2
ICSharpCode.Decompiler.PowerShell/GetDecompiledSourceCmdlet.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Management.Automation;

2
ICSharpCode.Decompiler.PowerShell/GetDecompiledTypesCmdlet.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

2
ICSharpCode.Decompiler.PowerShell/GetDecompilerCmdlet.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Management.Automation;

2
ICSharpCode.Decompiler.PowerShell/GetDecompilerVersion.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
using System;
using System;
using System.Management.Automation;
using ICSharpCode.Decompiler.TypeSystem;

2
ICSharpCode.Decompiler.PowerShell/GetTargetFramework.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
using System.Management.Automation;
using System.Management.Automation;
using ICSharpCode.Decompiler.CSharp;
using ICSharpCode.Decompiler.Metadata;

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

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>

2
ICSharpCode.Decompiler.PowerShell/NullAttributes.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
#if !NETCORE
#if !NETCORE
#nullable enable

2
ICSharpCode.Decompiler.PowerShell/TypesParser.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

2
ICSharpCode.Decompiler.TestRunner/Program.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2022 Siegfried Pammer
// Copyright (c) 2022 Siegfried Pammer
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler.Tests/DataFlowTest.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2016 Daniel Grunwald
// Copyright (c) 2016 Daniel Grunwald
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler.Tests/DisassemblerPrettyTestRunner.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler.Tests/Helpers/CodeAssert.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

2
ICSharpCode.Decompiler.Tests/Helpers/RemoveCompilerAttribute.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using ICSharpCode.Decompiler.CSharp;
using ICSharpCode.Decompiler.CSharp.Syntax;

2
ICSharpCode.Decompiler.Tests/Helpers/RoslynToolset.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2020 Siegfried Pammer
// Copyright (c) 2020 Siegfried Pammer
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler.Tests/Helpers/SdkUtility.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

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

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2015 Daniel Grunwald
// Copyright (c) 2015 Daniel Grunwald
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

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

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2015 Daniel Grunwald
// Copyright (c) 2015 Daniel Grunwald
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler.Tests/Helpers/TestsAssemblyOutput.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2024 Christoph Wille
// Copyright (c) 2024 Christoph Wille
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler.Tests/Output/CSharpAmbienceTests.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team
// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler.Tests/Output/InsertParenthesesVisitorTests.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team
// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save