dotnet pack3 does extra tag splitting #3701

Closed
joelverhagen opened this Issue Oct 19, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@joelverhagen
Member

joelverhagen commented Oct 19, 2016

Steps

  1. dotnet new a .csproj
  2. Add some <PackageTags> to the .csproj.
  3. dotnet restore3
  4. dotnet pack3
  5. Look at the tags in the output .nuspec

Expected

The tags should match the contents of <PackageTags>.

Actual

Semicolons are removed. The pack task should not have these smarts. Just copy the tags as-is in the .csproj to the .nuspec. Granted, the spec about .nuspec talks about space-delimited keywords. If we want to enforce this, we should error or warn that we're mangling things.

Example

Input:

    <PackageTags>semver;semantic versioning</PackageTags>

Output:

    <tags>semver semantic versioning</tags>

Compare to project.json:

{
  "packOptions": {
    "tags": [
      "semver",
      "semantic versioning"
    ]
}

@rrelyea rrelyea added this to the 3.6 RC milestone Oct 20, 2016

@emgarten

This comment has been minimized.

Show comment
Hide comment
@emgarten

emgarten Oct 21, 2016

Contributor

@joelverhagen what is the output from the project.json example in the nuspec? Wouldn't it be identical to the msbuild pack output?

A ; in MSBuild turns the value into a set the same as [] in json. I'm not sure that anything can be done here since pack isn't evaluating the ;. As mentioned there's no way to fix the output either apart from replacing spaces with . since tags are space delimited.

Contributor

emgarten commented Oct 21, 2016

@joelverhagen what is the output from the project.json example in the nuspec? Wouldn't it be identical to the msbuild pack output?

A ; in MSBuild turns the value into a set the same as [] in json. I'm not sure that anything can be done here since pack isn't evaluating the ;. As mentioned there's no way to fix the output either apart from replacing spaces with . since tags are space delimited.

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Oct 21, 2016

Contributor

@emgarten there is a way to just get the whole string instead of delimiting it by ; and then splitting them by spaces, however i am not sure if that's what we want.

msbuild users will expect that ; will do the splitting as it does for other properties.

Contributor

rohit21agrawal commented Oct 21, 2016

@emgarten there is a way to just get the whole string instead of delimiting it by ; and then splitting them by spaces, however i am not sure if that's what we want.

msbuild users will expect that ; will do the splitting as it does for other properties.

@joelverhagen

This comment has been minimized.

Show comment
Hide comment
@joelverhagen

joelverhagen Oct 21, 2016

Member

@joelverhagen what is the output from the project.json example in the nuspec? Wouldn't it be identical to the msbuild pack output?

Output of project.json dotnet pack is:

    <tags>semver,semantic versioning</tags>

This is also mangled, but there is at least a similar notion of different tags. My original assertion is we should just leave as is or warn that we are normalizing the tags.

Member

joelverhagen commented Oct 21, 2016

@joelverhagen what is the output from the project.json example in the nuspec? Wouldn't it be identical to the msbuild pack output?

Output of project.json dotnet pack is:

    <tags>semver,semantic versioning</tags>

This is also mangled, but there is at least a similar notion of different tags. My original assertion is we should just leave as is or warn that we are normalizing the tags.

@rrelyea rrelyea modified the milestones: 4.0 RC2, 4.0 RC Oct 24, 2016

@rrelyea rrelyea modified the milestones: 4.0 RC2, 4.0 RC3 Nov 29, 2016

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Dec 15, 2016

Contributor

closing as the behavior looks good

Contributor

rohit21agrawal commented Dec 15, 2016

closing as the behavior looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment