Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 28, 2025

When running dotnet build /t:GenerateCode, MSBuild's terminal logger displays "InstallTspClient" throughout the entire generation process instead of transitioning to "GenerateCode" after installation completes.

Changes

eng/CodeGeneration.targets:

  • Changed GenerateCode target to use DependsOnTargets="InstallTspClient" instead of CallTarget
  • Moved SkipTspClientInstall condition to InstallTspClient target definition

Before:

<Target Name="InstallTspClient" Condition="'$(TypeSpecInput)' != ''">
  <Exec Command="npm ci --prefix $(_TspClientDir)" />
</Target>

<Target Name="GenerateCode" Condition="'$(TypeSpecInput)' != ''">
  <CallTarget Condition="'$(SkipTspClientInstall)' != 'true'" Targets="InstallTspClient" />
  <Exec Condition="..." Command="..." />
</Target>

After:

<Target Name="InstallTspClient" Condition="'$(TypeSpecInput)' != '' AND '$(SkipTspClientInstall)' != 'true'">
  <Exec Command="npm ci --prefix $(_TspClientDir)" />
</Target>

<Target Name="GenerateCode" Condition="'$(TypeSpecInput)' != ''" DependsOnTargets="InstallTspClient">
  <Exec Condition="..." Command="..." />
</Target>

Using DependsOnTargets allows MSBuild to properly track target transitions instead of maintaining the calling target's context through CallTarget.

Original prompt

This section details on the original issue you should resolve

<issue_title>InstallTspClient target displayed the whole time while generating</issue_title>
<issue_description>For some reason the InstallTspClient target is shown the whole time, instead of just for the first step in the generation process. It should show GenerateCode afterwards but it doesn't do this.

C:\Users\jolov\repos\azure-sdk-for-net\sdk\documentintelligence\Azure.AI.DocumentIntelligence\src [main ≡ +0 ~2 -0 !]> dotnet build /t:GenerateCode -v d
Restore complete (0.9s)
    Determining projects to restore...
    All projects are up-to-date for restore.
  Azure.AI.DocumentIntelligence                                                                InstallTspClient (44.6s)
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Replace CallTarget with DependsOnTargets in CodeGeneration.targets to properly track target execution. This allows MSBuild's terminal logger to correctly display "GenerateCode" instead of staying stuck on "InstallTspClient" throughout the generation process.

Also moved the SkipTspClientInstall condition to the InstallTspClient target itself for cleaner implementation.

Co-authored-by: JoshLove-msft <[email protected]>
@JoshLove-msft JoshLove-msft marked this pull request as ready for review October 28, 2025 19:43
Copilot AI review requested due to automatic review settings October 28, 2025 19:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the MSBuild target dependencies for TypeSpec code generation by simplifying how InstallTspClient is invoked. Instead of conditionally calling the target from within GenerateCode, it establishes a proper dependency relationship between the targets.

Key Changes:

  • Added SkipTspClientInstall condition to the InstallTspClient target definition
  • Changed GenerateCode to depend on InstallTspClient via DependsOnTargets attribute
  • Removed the conditional CallTarget invocation from within GenerateCode

Copilot AI changed the title [WIP] Fix InstallTspClient target display during generation Fix MSBuild target display stuck on InstallTspClient during code generation Oct 28, 2025
Copilot AI requested a review from JoshLove-msft October 28, 2025 19:46
Copilot finished work on behalf of JoshLove-msft October 28, 2025 19:46
@weshaggard
Copy link
Member

/check-enforcer evaluate

@JoshLove-msft JoshLove-msft merged commit 7aa0849 into main Oct 28, 2025
28 checks passed
@JoshLove-msft JoshLove-msft deleted the copilot/fix-installtspclient-display branch October 28, 2025 19:58
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.

InstallTspClient target displayed the whole time while generating

4 participants