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
9 changes: 9 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,13 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<!-- Optional: reference Terminal.Gui source instead of the NuGet package.
Set TerminalGuiRoot to the path of your local Terminal.Gui repo clone.
Example: dotnet build -p:TerminalGuiRoot=../Terminal.Gui -->
<PropertyGroup Condition="'$(TerminalGuiRoot)' != ''">
<UseLocalTerminalGui>true</UseLocalTerminalGui>
<!-- Resolve relative paths against the repo root (where this file lives), not each .csproj -->
<TerminalGuiRoot>$([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', '$(TerminalGuiRoot)'))</TerminalGuiRoot>
</PropertyGroup>
</Project>
7 changes: 7 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<!-- When TerminalGuiRoot is set, replace the Terminal.Gui NuGet PackageReference with a ProjectReference -->
<ItemGroup Condition="'$(UseLocalTerminalGui)' == 'true'">
<PackageReference Remove="Terminal.Gui" />
<ProjectReference Include="$(TerminalGuiRoot)\Terminal.Gui\Terminal.Gui.csproj" />
Comment thread
tig marked this conversation as resolved.
</ItemGroup>
</Project>
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ cd Example
dotnet run
```

### Building Against Local Terminal.Gui Source

To build the examples against a local clone of Terminal.Gui (instead of the NuGet package), pass the `TerminalGuiRoot` property pointing to your Terminal.Gui repository root:

```bash
dotnet build -p:TerminalGuiRoot=../Terminal.Gui
dotnet run --project Example -p:TerminalGuiRoot=../Terminal.Gui
```

This replaces the NuGet `PackageReference` with a `ProjectReference`, so any breaking changes in Terminal.Gui are caught immediately during development.

## Examples

| Project | Description |
Expand Down Expand Up @@ -60,7 +71,7 @@ dotnet run
## Contributing

1. Follow Terminal.Gui [coding conventions](https://github.com/gui-cs/Terminal.Gui/blob/develop/CONTRIBUTING.md)
2. Examples should reference Terminal.Gui via NuGet package (not ProjectReference)
2. Examples reference Terminal.Gui via NuGet by default; use `TerminalGuiRoot` for local development
3. Each example should have its own project directory with a descriptive name
4. Include a README.md in each example explaining what it demonstrates

Expand Down
Loading