Repository navigation
Publish only the names from AUTHORS.md as Authors and Company [patch] - #97
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
Sdk.props set Authors to the whole AUTHORS.md, so the conventional heading over a contributor list put the markdown and every contributor's email address into the nuspec and AssemblyCompanyAttribute. Drop heading lines, list markers and <email> suffixes, join the names with NuGet's ';' separator (unescaped, so NuGet sees a list), and derive Company from the cleaned names. A single-line AUTHORS.md is unchanged, and AuthorsNamespace still reads the raw text. Fixes #90 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5RdbhA7TAMDQD8QTG
|
| Assert.IsNotNull(authors, $"Packed nuspec has no <authors>.{Environment.NewLine}{nuspec}"); | ||
| Assert.AreEqual("Jane Doe,John Smith", authors.Value, "nuspec <authors>"); | ||
|
|
||
| string assemblyInfo = Directory.EnumerateFiles(Path.Combine(workspace.Root, "Alpha", "obj"), "*.AssemblyInfo.cs", SearchOption.AllDirectories) |
Contributor
Author
There was a problem hiding this comment.
Not changing this one. Path.Combine discards earlier arguments only when a later argument is rooted. Here the later arguments are the literals "Alpha" and "obj", which are never rooted, so workspace.Root can't be dropped. The rest of this test project builds paths the same way: ExampleWorkspace.ResolveForWrite, RepoLayout.Demo and ExampleWorkspace.Pack all use Path.Combine(root, ...). Switching only this call to Path.Join would make it inconsistent with them without fixing anything.
Generated by Claude Code
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 #90
What was wrong
Sdk.propssetAuthorsto all ofAUTHORS.md, trimmed, andCompanydefaulted to that value. A conventional heading-over-contributor-list file therefore put# Authors, the bullets and every contributor's email address into the nuspec<authors>and intoAssemblyCompanyAttribute. A published package can't be taken back.Change (
Sdk/Sdk.props)AuthorsNamespaceis derived (it still reads the raw text, so prefixes are unchanged),Authorsread fromAUTHORS.mdis cleaned:-,*,+,1.,1)) are dropped<email>suffixes are dropped;[MSBuild]::Unescape. A property function's result is escaped, so without this NuGet received%3Band published a single author namedJane Doe;John Smith.Companydefaults to the same names joined with,, because it is a display string.AUTHORS.md(the ktsu convention) comes through exactly as written. AnAuthorsthat a consumer sets inDirectory.Build.propswith noAUTHORS.mdis not touched.Tests
New
AuthorsMetadataTests(6 tests):<authors>isJane Doe,John Smithand that the generatedAssemblyCompanyAttributeisJane Doe, John Smithand contains no email addressWith the
Sdk.propschange reverted, the 3 heading/list tests fail:Actual:<# Authors .... The other 3 cover behaviour that must not change, so they pass either way.AuthorsNamespaceTestsstill passes unchanged.Full
Sdk.Examples.Testssuite on this branch (Linux): 112 passed, 0 failed.Generated by Claude Code