Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ guidelines = 110
tab_width = 4
end_of_line = crlf

# .net tooling writes the BOM to resx files on running dotnet build ILSpy.sln regardless,
# .net tooling writes the BOM to resx files on running dotnet build ILSpy.slnx regardless,
# so we should direct text editors to NOT change the file
[*.resx]
charset = utf-8-bom
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-ilspy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ jobs:

- name: Restore the application
run: >
dotnet restore ILSpy.sln
dotnet restore ILSpy.slnx
/p:RestoreEnablePackagePruning=false
/p:Configuration=${{ matrix.configuration }}
/p:Platform="$env:BuildPlatform"

- name: Build
run: >
dotnet build -mt ILSpy.sln --no-restore
dotnet build -mt ILSpy.slnx --no-restore
-c ${{ matrix.configuration }}
/p:Platform="$env:BuildPlatform"

- name: Format check
run: dotnet-format whitespace --verify-no-changes --verbosity detailed ILSpy.sln
run: dotnet-format whitespace --verify-no-changes --verbosity detailed ILSpy.slnx

- name: Execute unit tests
id: unit-tests
Expand All @@ -107,7 +107,7 @@ jobs:
env:
DOTNET_gcServer: 0
run: >
dotnet test --solution ilspy.sln
dotnet test --solution ILSpy.slnx
--configuration ${{ matrix.configuration }}
--no-build --report-trx
--results-directory test-results/${{ matrix.configuration }}
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"files.exclude": {
"ILSpy-tests/**": true
},
"dotnet.defaultSolution": "ILSpy.sln",
"dotnet.defaultSolution": "ILSpy.slnx",
"dotrush.roslyn.projectOrSolutionFiles": [
"ILSpy.sln"
"ILSpy.slnx"
],
}
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Windows-only frontends, packaging, and tests:
- `ILSpy.Installer/` — WiX installer (`net472`)
- `ILSpy.BamlDecompiler.Tests/` — BAML-decompiler tests, still WPF/Windows-bound (`net11.0-windows`)

Solutions & filters: `ILSpy.sln` builds everything; `ILSpy.XPlat.slnf` is the decompiler libs + `ilspycmd` + their tests (no UI — the Linux CI target); `ILSpy.Desktop.slnf` is the UI plus its dependencies and tests; `ILSpy.Installer.sln` covers the legacy packaging, and `ILSpy.VSExtensions.slnx` the VS 2022 extension (`dotnet build`-able).
Solutions & filters: `ILSpy.slnx` builds everything; `ILSpy.XPlat.slnf` is the decompiler libs + `ilspycmd` + their tests (no UI — the Linux CI target); `ILSpy.Desktop.slnf` is the UI plus its dependencies and tests; `ILSpy.Installer.sln` covers the legacy packaging, and `ILSpy.VSExtensions.slnx` the VS 2022 extension (`dotnet build`-able).

## ILSpy-tests submodule

Expand All @@ -67,14 +67,14 @@ Solutions & filters: `ILSpy.sln` builds everything; `ILSpy.XPlat.slnf` is the de

## Build / restore

- **Use the repo-root pwsh scripts for these tasks, not raw `dotnet` commands** -- they carry the flags that keep the repo consistent and all target `ILSpy.sln` (extra args are forwarded):
- **Use the repo-root pwsh scripts for these tasks, not raw `dotnet` commands** -- they carry the flags that keep the repo consistent and all target `ILSpy.slnx` (extra args are forwarded):
- **restore** -> `restore.ps1`
- **build** -> `build.ps1` (`-Configuration Debug|Release`)
- **update deps / regenerate lock files** -> `updatedeps.ps1`
- **format** -> `BuildTools/format.ps1`
- **clean** -> `clean.ps1`; **publish** -> `publish.ps1`
- **Why this matters:** `restore.ps1` and `updatedeps.ps1` pass `-p:RestoreEnablePackagePruning=false`, so they keep every `packages.lock.json` whole. A bare `dotnet restore`/`dotnet build` (which restores implicitly) **prunes** the lock files -- silently stripping the transitive/all-RID/DiaSymReader entries the repo deliberately carries -- and surfaces as a spurious `packages.lock.json` diff. Restore with `restore.ps1`, then build with `build.ps1 --no-restore`; if a bare build ever leaves a pruned `packages.lock.json` modified, discard it (`git checkout -- <path>`).
- **Every project generates a `packages.lock.json`** (`RestorePackagesWithLockFile` is set in the root `Directory.Build.props`); CI NuGet caching keys off these. After adding or bumping a `PackageReference`/`PackageVersion`, regenerate the lock files with `updatedeps.ps1` (i.e. `dotnet restore ILSpy.sln --force-evaluate -p:RestoreEnablePackagePruning=false`) and commit them. The core libraries additionally set `RestoreLockedMode`, so a plain restore there fails until the lock file is refreshed.
- **Every project generates a `packages.lock.json`** (`RestorePackagesWithLockFile` is set in the root `Directory.Build.props`); CI NuGet caching keys off these. After adding or bumping a `PackageReference`/`PackageVersion`, regenerate the lock files with `updatedeps.ps1` (i.e. `dotnet restore ILSpy.slnx --force-evaluate -p:RestoreEnablePackagePruning=false`) and commit them. The core libraries additionally set `RestoreLockedMode`, so a plain restore there fails until the lock file is refreshed.
- The pre-commit hook runs `dotnet format` on the **whole solution** -- it IS the formatter. **Always let the hook run; never commit `.cs` with `--no-verify`.** Bypassing it lands unformatted code and forces history-wide reformat rebases later. `--no-verify` is acceptable only for commits that touch no `.cs` (e.g. `.yml`/`.md`-only).
- **Line endings are a Windows-only concern.** The repo is `* text=auto`, so blobs are stored LF and git renormalizes on commit. On **Windows**, save new files CRLF so the hook's `git add -u` doesn't churn EOLs. On **Linux/macOS**, leave new files LF and do **not** `unix2dos` -- forcing CRLF there makes the whole working tree show as phantom-modified in `git status` (and is normalized back to LF on commit anyway).
- **Partial commits need stash-and-pop.** The format hook only auto-formats when the staged set equals the working tree. Stash unstaged remainder before committing a subset.
Expand All @@ -100,7 +100,7 @@ Never put more than one C# language feature on one branch.

## Test discipline

- Always run the test suite with `--report-trx` so failures survive: `dotnet test --solution ILSpy.sln --report-trx` (the repo pins Microsoft.Testing.Platform in `global.json`; the bare `dotnet test <sln>` form is the old VSTest syntax). Don't dismiss failures as flaky without first reproducing in isolation, then running repeatedly.
- Always run the test suite with `--report-trx` so failures survive: `dotnet test --solution ILSpy.slnx --report-trx` (the repo pins Microsoft.Testing.Platform in `global.json`; the bare `dotnet test <sln>` form is the old VSTest syntax). Don't dismiss failures as flaky without first reproducing in isolation, then running repeatedly.
- **`ILSpy.Tests` is serial by design** (one headless Avalonia session and one process-wide app composition per test host), so it cannot use more than one core in-process. The local optimization is **sharding across processes**: `./runuitests.ps1` runs the built Debug suite as 4 concurrent `dotnet test` hosts with disjoint filters (about 2.5x faster than one host); CI runs the same script with 2 shards on Linux/macOS. For one fixture use `dotnet test --project ILSpy.Tests/ILSpy.Tests.csproj --no-build --filter "FullyQualifiedName~MyFixture"` (the `--treenode-filter` / `--filter-class` forms are rejected by the NUnit bridge).
- The decompiler test suite (test kinds, fixture structure, how to write tests, the compiler-matrix model) is documented in [ICSharpCode.Decompiler.Tests/AGENTS.md](ICSharpCode.Decompiler.Tests/AGENTS.md).
- After matcher / rewriter edits, **run the relevant tests, not just the build.** `dotnet build` green ≠ behaviour correct.
Expand Down
2 changes: 1 addition & 1 deletion BuildTools/bom-strip.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $Dotfiles = @(
$AllowedExts = @(
'.bat','.config','.cs','.csproj','.css','.filelist','.fs','.html','.il',
'.ipynb','.js','.json','.less','.manifest','.md','.projitems','.props',
'.ps1','.psd1','.shproj','.sln','.slnf','.svg','.template',
'.ps1','.psd1','.shproj','.sln','.slnf','.slnx','.svg','.template',
'.tt', '.txt','.vb','.vsct','.vsixlangpack','.wxl','.xaml','.xml','.xshd','.yml'
)

Expand Down
6 changes: 3 additions & 3 deletions BuildTools/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ DOTNET_FORMAT="$DOTNET_PATH/dotnet-format$EXE_SUFFIX"
"$DOTNET_FORMAT" --version
if [ "${1:-}" = "--format" ]; then
# called via format.bat
"$DOTNET_FORMAT" whitespace --no-restore --verbosity normal ILSpy.sln
"$DOTNET_FORMAT" whitespace --no-restore --verbosity normal ILSpy.slnx
elif git diff --quiet --ignore-submodules; then
"$DOTNET_FORMAT" whitespace --no-restore --verbosity normal ILSpy.sln
"$DOTNET_FORMAT" whitespace --no-restore --verbosity normal ILSpy.slnx
git add -u -- \*\*.cs
else
echo Partial commit: only verifying formatting
exec "$DOTNET_FORMAT" whitespace --verify-no-changes --no-restore --verbosity normal ILSpy.sln
exec "$DOTNET_FORMAT" whitespace --verify-no-changes --no-restore --verbosity normal ILSpy.slnx
fi
2 changes: 1 addition & 1 deletion BuildTools/update-assemblyinfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ try {
return 0;
}

if (-not (Test-File "ILSpy.sln")) {
if (-not (Test-File "ILSpy.slnx")) {
Write-Error "Working directory must be the ILSpy repo root!";
return 2;
}
Expand Down
2 changes: 1 addition & 1 deletion ICSharpCode.Decompiler.Tests/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ produced for that compiler's IL. This beats hand-running csc versions.
## Running

```
dotnet test --solution ILSpy.sln --report-trx --filter FullyQualifiedName~PrettyTestRunner.SwitchExpressions
dotnet test --solution ILSpy.slnx --report-trx --filter FullyQualifiedName~PrettyTestRunner.SwitchExpressions
```

(Microsoft.Testing.Platform syntax; see root `AGENTS.md` "Test discipline".) A failing
Expand Down
2 changes: 1 addition & 1 deletion ICSharpCode.Decompiler/CSharp/Syntax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ A few things that are easy to get wrong when editing the generator or the nodes
reference the expected symbol (e.g. `Slots.Foo`) in code and let the build fail or pass.
- **Validate with the DEBUG test run.** `CheckInvariant` is `[Conditional("DEBUG")]` and the test host
runs DEBUG, so after any AST or transform change run the Pretty suite in DEBUG:
`OPENSSL_ENABLE_SHA1_SIGNATURES=1 dotnet test --solution ILSpy.sln --report-trx --no-build -c Debug
`OPENSSL_ENABLE_SHA1_SIGNATURES=1 dotnet test --solution ILSpy.slnx --report-trx --no-build -c Debug
--filter "FullyQualifiedName~PrettyTestRunner"`. It checks the output is byte-identical **and**
exercises `CheckInvariant` across every node shape -- a green run is the real signal, not a green
build.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<PropertyGroup>
<!-- The BAML round-trip cases compile WPF XAML into this assembly, so the project is
Windows-bound (built and run only in the Windows CI leg via ILSpy.sln). EnableWindowsTargeting
Windows-bound (built and run only in the Windows CI leg via ILSpy.slnx). EnableWindowsTargeting
lets the package graph restore on non-Windows hosts, so the lock file can be generated and
verified anywhere even though the tests themselves only execute on Windows. -->
<TargetFramework>net11.0-windows</TargetFramework>
Expand Down
2 changes: 1 addition & 1 deletion ILSpy.Desktop.slnf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"solution": {
"path": "ILSpy.sln",
"path": "ILSpy.slnx",
"projects": [
"ICSharpCode.BamlDecompiler\\ICSharpCode.BamlDecompiler.csproj",
"ICSharpCode.Decompiler.TestRunner\\ICSharpCode.Decompiler.TestRunner.csproj",
Expand Down
2 changes: 1 addition & 1 deletion ILSpy.Tests.Windows/ILSpy.Tests.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- Windows-targeted TFM unlocks Microsoft.DiaSymReader (native COM) + System.Windows
registry APIs without conditional package gates. EnableWindowsTargeting lets the
build satisfy the -windows reference assemblies on non-Windows OSes via the
cross-targeting pack, so `dotnet build ILSpy.sln` succeeds on Linux/macOS; the
cross-targeting pack, so `dotnet build ILSpy.slnx` succeeds on Linux/macOS; the
tests still only execute on Windows because the binaries P/Invoke into Win32. -->
<TargetFramework>net11.0-windows</TargetFramework>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
Expand Down
2 changes: 1 addition & 1 deletion ILSpy.XPlat.slnf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"solution": {
"path": "ILSpy.sln",
"path": "ILSpy.slnx",
"projects": [
"ICSharpCode.ILSpyCmd\\ICSharpCode.ILSpyCmd.csproj",
"ICSharpCode.ILSpyCmd.Tests\\ICSharpCode.ILSpyCmd.Tests.csproj",
Expand Down
Loading
Loading