Distribution of the lib's source code in package

Oct 29, 2010 at 1:40 PM

We have package NHibernate, source code of this lib is also available. After you add-package you get reference, but if you need to debug, you have to go and get source code from repository, add pdb and so on.

What if package will have also pdb files and source code? This should be useful.

Oct 29, 2010 at 2:04 PM

The only concern I would have is the time to pull down the package.  You want your package coming down fast, especially if you are like me and live in the Pkg Mgr Console.  There is also no convention for source or ignored content.  You would need to use the <files/> node I believe to push the src.  You'd either need to build the files snippet from the actual source tree or zip and include the source zip.  Either way, from a pkg consumer perspective, I think this is probably not a standard piece I want included in my packages directory.

Why not instead publish a symbol server for the pdbs?  Then use the install.ps1 to add the NHibernate symbol server to Visual Studio?  That would be the slimmest, nicest solution IMHO.

Oct 29, 2010 at 2:18 PM

Problem with symbol server is that you will need to do this with each lib you want. Also you will have to hack package folders to add pdb files. So well, this is something that we use now (we are also see to the http://www.symbolsource.org/ ).

Problem with source code is not that big, first of all packages are zip, means that source code will be compressed. Second including in single package is not the only option. For example in maven you allowed adding another package with special name that only includes source code.

Oct 29, 2010 at 4:26 PM
The two problems are that you want/need the PDBs to sit beside the DLLs, so they can't be in a separate package. And, of course, the PDBs won't necessarily match the source code path so you'll be forced to browse for sources when debugging (a minor annoyance).

I agree, source in a separate package seems like the best idea.
Oct 29, 2010 at 5:51 PM

I love the idea of bringing down sources using NuPack.  And indeed, they should go into a different package.  We should come up with a simple convention for naming those packages, which can simply be to append .Sources to the name, e.g.

NHibernate.Core --> NHibernate.Core.Sources

Maybe we can get fancy later and actually tag it as a Source package in...

As far as dependencies, I'd say it's best not to make the Sources package depend on the binary, as they're separate things that one might want individually.  There is always the option of creating a meta package that installs all the NHibernate components along with all the sources if someone thinks there is value.

Coordinator
Nov 10, 2010 at 4:55 PM

Someone want to create an issue for this with some of these proposals so we can track it?

Nov 18, 2010 at 3:58 PM

I created this: http://nuget.codeplex.com/workitem/394 before finding this thread.  I find this feature extremely useful in Maven for attaching source code jars.

Resharper (5+) does this with MS "source" code.  Maybe it would have the ability to attach real source code somehow.

Nov 23, 2010 at 12:38 PM

Maven handles it this by copying a *-sources.jar to the repository.   As an example, here is the Maven repo for acegi-security: http://repo1.maven.org/maven2/org/acegisecurity/acegi-security/1.0.7/ with the relevant source jars.

All common java IDEs have support to automatically attach the source code inside the IDE if it exists.

I guess two things need to happen:

1. There needs to be a way to package the source (either inside the binary package or alongside it)

2. Visual Studio needs to be able to bind to this source.  See http://stackoverflow.com/questions/2620279/visual-studio-attach-source-code-to-reference.  Like many things, it seems this functionality is not native to VS, but ReSharper adds it.