CONFIG: Fix net10.0 targets paths, add LibPostalAutoDownload opt-out, document usage - #102
Open
perirrs wants to merge 2 commits into
Open
CONFIG: Fix net10.0 targets paths, add LibPostalAutoDownload opt-out, document usage#102perirrs wants to merge 2 commits into
perirrs wants to merge 2 commits into
Conversation
Two changes to NHSISL.LibPostalClient.targets. 1. Release blocker. Commit b3442e9 moved the packed native files from contentFiles/any/net8.0 to contentFiles/any/net10.0, but the targets file still resolved Headers, WindowsNativeFiles and LinuxNativeFiles from the net8.0 paths. Verified against a real consumer project: the unfixed package fails the consumer build outright with MSB3030 ("Could not copy ... contentFiles/any/net8.0/libpostal.h"), and no native library reaches the output directory. 2. Issue #97. Adds a LibPostalAutoDownload MSBuild property, defaulting to true so current behaviour is unchanged. When set to false the LibpostalData.zip download is skipped on both build and publish, and Clean no longer deletes the zip, which is what caused the next build to download it again. Verified with a consumer project referencing the packed package: natives copy to the output directory, and LibPostalAutoDownload=false suppresses the download. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Addresses #52, open since September 2024, which asked how to actually use the package. The README had no usage section at all. Adds install, parse and expand examples, a configuration table, the LibPostalAutoDownload option, and a note on the test project DllNotFoundException reported in #58 with its workaround. All code samples and their outputs were run against the package built from this branch, so the parser labels shown are real output rather than illustrative. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes NuGet package build/publish behavior by correcting the packaged native/content file paths for net10.0, adding an MSBuild opt-out for automatic libpostal data download, and documenting end-to-end usage in the README so consumers can successfully install and use the library.
Changes:
- Update
NHSISL.LibPostalClient.targetsto resolve native/header assets fromcontentFiles/any/net10.0/(instead ofnet8.0/). - Add
LibPostalAutoDownload(defaulttrue) to gate data download on both build and publish, and preventCleanfrom deletingLibpostalData.zipwhen opted out. - Expand
README.mdwith install, parse/expand examples, configuration guidance, and test-project usage notes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| README.md | Adds usage documentation, examples, configuration table, and guidance for controlling downloads and test-project usage. |
| NHSISL.LibPostalClient/NHSISL.LibPostalClient.targets | Fixes content file paths to net10.0 and introduces LibPostalAutoDownload gating for download/clean/publish behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes AB#29898
Also addresses #97 and #52.
1. Release blocker — native files not found (no issue, found while reviewing #97)
b3442e9moved the packed natives fromcontentFiles/any/net8.0/tocontentFiles/any/net10.0/, butNHSISL.LibPostalClient.targetsstill resolved them from the net8.0 paths. The targets file was never updated.Verified against a real consumer project referencing the packed package:
mainMSB3030libpostal-1.dll,libpostal.hThe unfixed error:
This is a hard build failure for every consumer, not a runtime error. It would have shipped in v1.0.1.0.
2.
LibPostalAutoDownloadopt-out (#97)Adds an MSBuild property, default
trueso existing behaviour is unchanged:When
false: the download is skipped on both build and publish, andCleanno longer deletesLibpostalData.zip— which was what caused the next build to re-download it.Note the publish path (
PrepLibPostalPublish) downloaded unconditionally on every publish, so that is now gated and existence-checked too.Verified:
LibPostalAutoDownload=falseCleanwith opt-outCleandefault3. README usage docs (#52)
Open since September 2024, asking how to actually use the package — the README had no usage section. Adds install, parse and expand examples, a config table, the new opt-out, and a note on the #58 test-project
DllNotFoundExceptionwith its workaround.All samples and their outputs were run against the package built from this branch, so the parser labels are real output.
🤖 Generated with Claude Code