Skip to content

Add optional project reference support for local Terminal.Gui development#1

Merged
tig merged 2 commits into
mainfrom
feature/optional-project-reference
May 25, 2026
Merged

Add optional project reference support for local Terminal.Gui development#1
tig merged 2 commits into
mainfrom
feature/optional-project-reference

Conversation

@tig
Copy link
Copy Markdown
Member

@tig tig commented May 25, 2026

When TerminalGuiRoot is set (e.g. dotnet build -p:TerminalGuiRoot=../Terminal.Gui), the NuGet PackageReference for Terminal.Gui is replaced with a ProjectReference to the local source. This enables immediate detection of incompatibilities during Terminal.Gui development.

Changes

  • Directory.Build.props — sets UseLocalTerminalGui=true when TerminalGuiRoot is provided
  • Directory.Build.targets (new) — removes the NuGet PackageReference and adds a ProjectReference when enabled
  • README.md — documents the feature with usage examples

Related: gui-cs/Terminal.Gui#5402

When TerminalGuiRoot is set (e.g. -p:TerminalGuiRoot=../Terminal.Gui),
the NuGet PackageReference is replaced with a ProjectReference to the
local Terminal.Gui source. This enables immediate detection of breaking
changes during Terminal.Gui development.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ab02048bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Directory.Build.targets
ProjectReference paths in Directory.Build.targets are evaluated relative
to each importing .csproj. This normalizes TerminalGuiRoot to an absolute
path based on the repo root (where Directory.Build.props lives), so
relative paths like '../Terminal.Gui' work correctly regardless of which
project directory the build is invoked from.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tig
Copy link
Copy Markdown
Member Author

tig commented May 25, 2026

Addressed the review feedback in 0a957cc: TerminalGuiRoot is now normalized to an absolute path using [MSBuild]::NormalizePath(MSBuildThisFileDirectory, TerminalGuiRoot) in Directory.Build.props. This means relative paths like ../Terminal.Gui resolve against the repo root (where Directory.Build.props lives), not each individual .csproj. Verified that dotnet build -p:TerminalGuiRoot=../../Terminal.Gui works correctly from nested project directories.

@tig tig merged commit 9768667 into main May 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant