Skip to content

Allow setting additional metadata on a project reference when switching to projects - #165

Open
binginsin wants to merge 2 commits into
RicoSuter:masterfrom
binginsin:master
Open

binginsin wants to merge 2 commits into
RicoSuter:masterfrom
binginsin:master

Conversation

@binginsin

Copy link
Copy Markdown
Contributor

Working on an analyzer / code generator nuget I realised the only way to get it to work as a project reference was by setting additional attributes of

OutputItemType=Analyzer,
ReferenceOutputAssembly=true

But there is currently no way to achieve this behavior using switcher. This PR adds the functionality. An example switcher.json:

{
  "solution": "TestSolution.slnx",
  "solutionFolder": null,
  "mappings": {
    "TestNuget1": "../Common/TestNuget1.csproj",
    "CodeGeneratorNuget": "../Common/CodeGeneratorNuget.csproj"
  },
  "removeProjects": true,
  "additionalMetadata": {
    "CodeGeneratorNuget": [
      "OutputItemType=Analyzer",
      "ReferenceOutputAssembly=true"
    ]
  }
}

This will produce project references of:

<ProjectReference Include="../Common/TestNuget1.csproj" />
<ProjectReference Include="../Common/CodeGeneratorNuget.csproj">
  <OutputItemType>Analyzer</OutputItemType>
  <ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>

@binginsin

Copy link
Copy Markdown
Contributor Author

@RicoSuter this repo needs some love! There's a few tiny PRs that are waiting to be merged that would fix a fair few issues.

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.

1 participant