|
| 1 | +# Update all runfile #:project directives to use MSBuild variables |
| 2 | + |
| 3 | +## Description |
| 4 | + |
| 5 | +Update all `#:project` directives in runfiles to use MSBuild variables (e.g., `$(SourceDirectory)`) instead of hardcoded relative paths. This leverages .NET 10's support for MSBuild property expansion in `#:project` directives (PR #51108). |
| 6 | + |
| 7 | +## Checklist |
| 8 | + |
| 9 | +### samples/ (5 files) |
| 10 | +- [x] samples/table-widget.cs (already updated) |
| 11 | +- [x] samples/hyperlink-widget.cs |
| 12 | +- [x] samples/emoji-table-widget.cs |
| 13 | +- [x] samples/rule-widget.cs |
| 14 | +- [x] samples/panel-widget.cs |
| 15 | + |
| 16 | +### tests/ (23 files) |
| 17 | +- [x] tests/table-widget-01-basic.cs |
| 18 | +- [x] tests/table-widget-02-borders.cs |
| 19 | +- [x] tests/table-widget-03-styling.cs |
| 20 | +- [x] tests/table-widget-04-expand.cs |
| 21 | +- [x] tests/table-widget-05-shrink.cs |
| 22 | +- [x] tests/table-widget-06-emoji.cs |
| 23 | +- [x] tests/table-widget-07-grow.cs |
| 24 | +- [x] tests/panel-widget-01-basic.cs |
| 25 | +- [x] tests/panel-widget-02-terminal-extensions.cs |
| 26 | +- [x] tests/panel-widget-03-word-wrap.cs |
| 27 | +- [x] tests/rule-widget-01-basic.cs |
| 28 | +- [x] tests/rule-widget-02-terminal-extensions.cs |
| 29 | +- [x] tests/hyperlink-01-basic.cs |
| 30 | +- [x] tests/terminal-static-01-basic.cs |
| 31 | +- [x] tests/terminal-static-02-properties.cs |
| 32 | +- [x] tests/terminal-static-03-operations.cs |
| 33 | +- [x] tests/terminal-static-04-format.cs |
| 34 | +- [x] tests/terminal-static-05-widgets.cs |
| 35 | +- [x] tests/terminal-static-06-color.cs |
| 36 | +- [x] tests/ansi-string-utils-01-basic.cs |
| 37 | +- [x] tests/ansi-string-utils-02-wrap-text.cs |
| 38 | +- [x] tests/ansi-string-utils-03-emoji-width.cs |
| 39 | +- [x] tests/unicode-width-01-basic.cs |
| 40 | + |
| 41 | +### Verification |
| 42 | +- [x] Run all updated runfiles to verify they work |
| 43 | +- [x] Commit changes |
| 44 | + |
| 45 | +## Notes |
| 46 | + |
| 47 | +### MSBuild Variable Support |
| 48 | + |
| 49 | +.NET 10.0.201 supports MSBuild variable expansion in `#:project` directives (merged in PR #51108). The `Directory.Build.props` imports `msbuild/repository.props` which defines: |
| 50 | + |
| 51 | +- `$(SourceDirectory)` = `$(RepositoryRoot)source/` |
| 52 | +- `$(TestsDirectory)` = `$(RepositoryRoot)tests/` |
| 53 | +- `$(SamplesDirectory)` = `$(RepositoryRoot)samples/` |
| 54 | + |
| 55 | +### Change Pattern |
| 56 | + |
| 57 | +Replace: |
| 58 | +```csharp |
| 59 | +#:project ../source/timewarp-terminal/timewarp-terminal.csproj |
| 60 | +``` |
| 61 | + |
| 62 | +With: |
| 63 | +```csharp |
| 64 | +#:project $(SourceDirectory)timewarp-terminal/timewarp-terminal.csproj |
| 65 | +``` |
| 66 | + |
| 67 | +### Benefits |
| 68 | + |
| 69 | +1. **Consistency** - All runfiles use the same path resolution mechanism |
| 70 | +2. **Maintainability** - If project structure changes, only `repository.props` needs updating |
| 71 | +3. **Clarity** - Intent is clearer (`SourceDirectory` vs `../source`) |
| 72 | + |
| 73 | +## Results |
| 74 | + |
| 75 | +Successfully updated all 28 runfiles to use MSBuild variables in `#:project` directives. |
| 76 | + |
| 77 | +### Files Changed |
| 78 | +- 5 files in `samples/`: table-widget.cs, hyperlink-widget.cs, emoji-table-widget.cs, rule-widget.cs, panel-widget.cs |
| 79 | +- 23 files in `tests/`: all test runfiles |
| 80 | + |
| 81 | +### Change Made |
| 82 | +Replaced: `#:project ../source/timewarp-terminal/timewarp-terminal.csproj` |
| 83 | +With: `#:project $(SourceDirectory)timewarp-terminal/timewarp-terminal.csproj` |
| 84 | + |
| 85 | +### Verification |
| 86 | +- Ran multiple runfiles to verify they execute correctly |
| 87 | +- All tests pass with the new variable-based paths |
| 88 | + |
| 89 | +### Commits |
| 90 | +- `refactor: use MSBuild variables in all runfile #:project directives` (9ae34e9) |
0 commit comments