I recently put some of my projects on github to make them open source but I'm having trouble understanding how to structure the projects properly.
I've got a Core project and another project that depends on the Core project (plus more to come). However, when users grab a copy of one of the projects they complain that it's missing the Core project and I have to tell them that it lives in a separate repository.
I know there must be a better way to do this. I've read about git submodules but I don't really understand them yet.
My question is, are there any easy to follow tutorials or examples of how I can structure my projects? I'm using Windows, TortoiseGit and my projects are in C#.
Under your repository name, click Settings. In the "Security" section of the sidebar, click Code security and analysis. Read the message about granting GitHub read-only access to the repository data to enable the dependency graph, then next to "Dependency Graph", click Enable.
GitHub's dependency graph identifies all upstream dependencies and public downstream dependents of a repository or package by parsing manifest files, so that you can better manage the security and compliance of your dependencies.
You can use subtrees or submodules. http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/
Instead of providing the source code for your dependencies, it may be better to use dependency management instead. This allows your projects to be built individually and also provides proper dependency versioning. This also means that your users do not need to worry about dependencies.
Microsoft's package manager for .NET - NuGet - is integrated into every version of Visual Studio nowadays. You can also try Paket as an alternative.
To package your project, you'd first add a package spec to your project. You then build a .nupkg file and upload it to NuGet.org to make it available to other projects. Check Microsoft's documentation for details.
In your main project, remove your dependency and use "Manage NuGet Package..." to add your own package as a dependency instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With