Simplify symbol package creation

May 20, 2011 at 4:35 AM

I love the ability to push packages and symbol packages to nuget and symbolsource.org with a simple command.

However, creating symbols packages is overly complicated right now. The project file approach (.csproj) is a neat trick, but not practical except in the most basic situation (no support for multiple projects, multiple target frameworks, external builds, etc). There needs to be a streamlined approach for building .symbols.nupkg companion packages from a given nuspec file. I do not want to use the conventional folders approach to specifying my files, as it seems tedious to have to move files around the filesystem, instead of referencing them where they are in my source tree.

Currently, this requires the following process:

  1. create a single nuspec file, it uses file elements to specify all of the files that will be included in the library and symbol packages.
  2. call nuget pack myspec.nuspec
  3. rename the created myspec.1.0.0.nupkg to myspec.1.0.0.symbols.nupkg
  4. call nuget pack myspec.nuspec -Exclude **\*.pdb -Exclude **\*.cs

I now have myspec.1.0.0.nupkg and myspec.1.0.0.symbols.nupkg.

This seems like a common scenario that should be baked in somehow. Currently, the -Symbols option for the pack command is only valid when building from a package. How about we allow use of the -Symbols option with .nuspec files, and give it the following behavior:

  1. build the source package, and give it the .symbols.nupkgs name
  2. build the lib package, automatically excluding all pdbs, and the entire /src target folder

If doing 2 builds would be too complicated in a single command, maybe -Symbols option just does step 1, and a -NoSource option does step 2.

Are there any other ideas out there on how to support symbol package creation from a nuspec file?

May 20, 2011 at 6:51 AM

I agree that we need to improve the workflow when not using a project. Your proposal seems reasonable, and probably not that hard to do. To refine it a bit, I'd say the source package should also exclude some things, and pretty much just keep /src, and /lib folders. This way it doesn't include things like content files and Tools (though technically they may be harmless).

I'll ask the symbolsource guys to comment on it to make sure it's sound from the source package point of view.

May 20, 2011 at 7:55 AM

For SymbolSource the only thing that matters is the packages layout. I think it's the correct direction, to try and make the pack command behave the same way both when invoking it with a csproj file and a nuspec file. It could build a regular package just as before, but if invoked with -Symbols it would produce 2 packages in one go, including and excluding items as required for the SymbolSource scenario.

 

 

May 20, 2011 at 6:58 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.