puppetlabs/puppet — pull request #1971 by zaphod42 (2013-10-04 23:26:42+00:00)
Title: (DO NOT MERGE) A proposed system for splitting the codebase

The puppet codebase has become large and monolithic. This makes it hard to
test, modify, and understand. Splitting it up is a first step towards getting a
handle around uncontrolled dependencies and making APIs clearer.

This lays out a way of splitting up the codebase by:

* creating sub-projects
* combining the sub-projects to create a whole project

Each sub-project consists of a simple gem layout.

````
sub-project
|- Rakefile
|- .gemspec
|- lib/
\- spec
````

The Rakefile will need to implement a few common commands, which I am still
figuring out the full list. At the moment they only need to implement `spec`.

The project as a whole then consists of (at the moment, the sub-projects will
expand as we find more places to split):

````
puppet
|- core/
|- pops/
|- testing/
|- Gemfile
\- Rakefile

````

The Gemfile only exists at the top level, it is used for development. The individual projects are not-quite-independent gems.

Examples:

To run all of the tests:

bundle install
bundle exec rake spec

To run the test of a specific project (core in this example)

bundle install
bundle exec rake core:spec
# alternately
cd core; bundle exec rake spec

Todo:

At the moment the packaging tasks don't handle all of the files being moved
around like this. The tasks expect that all of the files are in the correct
place already at the top level. There may already be a mechanism in the
packaging tasks to handle requiring a build step in order to collect everything
together first, but I haven't yet figured that out.