-
Notifications
You must be signed in to change notification settings - Fork 0
Add Source Link support for GitHub repository #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: SIkebe <[email protected]>
Co-authored-by: Copilot <[email protected]>
Directory.Build.props
Outdated
|
|
||
| <!-- Source Link Configuration --> | ||
| <PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
| <EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
|
|
||
| <!-- Deterministic builds help ensure reproducible builds --> | ||
| <Deterministic>true</Deterministic> | ||
| <ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot src/ShukujitsuSharp/ShukujitsuSharp.csproj ではなく Directory.Build.props に追加した理由は?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right to question this. I've moved the Source Link properties from Directory.Build.props to the specific ShukujitsuSharp.csproj project file where they're actually needed. Source Link is only relevant for NuGet packages that get published, and only the main library project has IsPackable=true. The test project and generator don't need these properties. This makes the configuration more targeted and precise. Commit: 5a0ef13
There was a problem hiding this 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 adds Source Link support to the GitHub repository, enabling developers to step into the library source code during debugging sessions.
- Added the Microsoft.SourceLink.GitHub package reference to the main project.
- Configured Source Link properties (PublishRepositoryUrl, EmbedUntrackedSources, Deterministic, ContinuousIntegrationBuild) globally in Directory.Build.props.
- Removed the duplicate PublishRepositoryUrl property from the project file.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/ShukujitsuSharp/ShukujitsuSharp.csproj | Removed duplicate PublishRepositoryUrl and added Microsoft.SourceLink.GitHub package. |
| Directory.Build.props | Added Source Link configuration properties for reproducible builds and CI integration. |
Why globally? |
…ific project file Co-authored-by: SIkebe <[email protected]>
Good point. I initially configured them globally but realized that Source Link properties are only meaningful for projects that get published as NuGet packages. I've moved them to the specific |
Implements Source Link support to enable debugging into the library source code from NuGet packages.
Changes Made
Added Microsoft.SourceLink.GitHub package reference (v8.0.0) to the main library project with
PrivateAssets="All"to avoid exposing it as a dependencyConfigured Source Link MSBuild properties in
Directory.Build.props:PublishRepositoryUrl=true- Enables repository URL publishing in packagesEmbedUntrackedSources=true- Embeds source files not tracked by source controlDeterministic=true- Enables deterministic builds for reproducibilityContinuousIntegrationBuild=true- Enabled when running in GitHub ActionsRemoved duplicate
PublishRepositoryUrlproperty from the project file since it's now defined globallyBenefits
Verification
sourcelink test✅/_/*→https://raw.githubusercontent.com/SIkebe/ShukujitsuSharp/{commit}/*✅This implementation follows the Microsoft Source Link documentation and enables a better debugging experience for library consumers.
Fixes #9.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.