clairernovotny / ReferenceGenerator

MIT License
75 stars 13 forks source link

Generate dependencies between multiple packages in a solution #9

Open bartlannoeye opened 8 years ago

bartlannoeye commented 8 years ago

I know this isn't an easy one, but logging it for a possible vNext

As discussed in an issue for Prism, sometimes you would like to generate multiple packages from a single solution, with some of these packages having a dependency on the others.

I have pushed another simple standalone solution to explain the desired behavior (as Prism will continue to evolve). In this solution, we're trying to create create a new awesome library consisting out of the core functionality and and extension assembly. Because most developers will only use the core functionality, we would like to publish 2 separate NuGet packages.

The ReferenceGenerator correctly adds all dependencies for our core assembly to MyLibrary.nuspec. As for the extensions assembly, it finds our dependency for Json.net, but as the core assembly is a referenced project in the solution and not a NuGet package, this dependency is left out in MyLibrary.Extension.nuspec.

The good news is that you can manually add your own dependency and it will not be removed the next time you build your solution and the .nuspec file gets update. You will of course have to increment version numbers manually.

Awesome news would be if the ReferenceGenerator picks up the core's assembly nuspec file and realizes through the project reference that this is a dependency. Maybe even add NuGet package versioning and package creation and it would be developer's heaven!