A part of my brain has been trying to come up with a simple but powerful package management system for the Orx community for a while. A very unorthodox scheme has just occurred to me. I warn you, the idea will sound terrible at first, but give me a chance before you burn me at the stake
The idea is actually very simple:
So, what do we gain by this?
- We all base our game projects on a common git repository to serve as an empty template. I already have such a cmake-based template. The idea depends on us all starting from the same template, but the template might actually have the infrastructure for multiple build systems.
- Each package is a branch that builds on that template repo! Yes, you've heard me right. We won't be using git submodules, we will be using branches.
- Whenever you want to include a package in your game project, you merge that branch into your game.
- Whenever you want to release a package you just create a new branch. If your package depends on another package, simply merge that branch into your branch!none
- We can share anything, not just C++ code and headers. We can share .ini files, custom tool configurations, weird build system tricks. Just an example, in my Android build, I've integrated SWIG into my build configuration in such a way that you completely forget you're bridging Java and C++. In this package management scheme, I could share it with the community, so that the users of my package wouldn't even know what SWIG is and wonder how their C++ methods are just callable from Java!
- Package repository is outsourced. Github, or bitbucket does it for us.
- Package repositories are decentralized. You can maintain your own set of packages trivially. You can also fetch packages from other people's repositories by just "git remote add"ing their repo
- Diamond dependency problem disappears! If package B and C both depend on A, no problem, they already have it merged in, so when you try to merge them both into your project, only one copy of A appears.
- Packages are naturally versioned, you can easily see on a commit graph what libraries depend on what.
- It's trivial to update your packages, you just merge-in a newer version branch.none
What do you think?
Edit: The scheme has a fatal flaw:
You can't remove any package dependency, please see my post below.
I'm still hopeful about a similar package management system though, please see the same post