neo-project / neo-modules

MIT License
60 stars 100 forks source link

Remove unnecessary dll when build or publish a plugin #848

Closed superboyiii closed 9 months ago

superboyiii commented 9 months ago

Summary or problem description Our plugins have a complex dependency structure, for example, StateService need MPT, need RpcServer, need Neo, and Neo need Neo-VM, so when you build or publish a plugin, you may get many dll from these dependency, but what we what is just these necessary when taken them into Plugins path of neo-cli.

Do you have any solution you want to propose? Plugins excluding RpcServer itself, don't need build RpcServer in publish, Neo and Neo.ConsoleService as welll. Where in the software does this update applies to?

cschuchardt88 commented 9 months ago

you can add something like this

  <ItemGroup>
    <ProjectReference Include="..\B\B.csproj">
      <IncludeAssets>Compile;Runtime;Build;Native</IncludeAssets>
      <ExcludeAssets>ContentFiles;Analyzers</ExcludeAssets>
      <PrivateAssets>None</PrivateAssets>
    </ProjectReference>
  </ItemGroup>

just include the things you want. in the *.csproj file

Read more about it here https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets