Modules
The Terracotta source tree is divided into several different modules.
A module is a set of source code, compiled with a particular version of the JVM, along with supporting test infrastructure code, unit tests, and system (a.k.a., acceptance, functional, etc.) tests.
Modules can also be dependent upon other modules; this dependency is expressed explicitly. The buildsystem is very careful to only compile and run modules with exactly their dependencies included in the CLASSPATH, so it's impossible to introduce dependencies that you haven't explicitly declared.
Note that modules are compiled in a particular order, as defined in modules.def.yml.
Subtrees
A module is divided into subtrees. Each module can currently have up to four subtrees:
- src: The main source for the module. Modules dependent upon this module will get compiled against this code as well.
- tests.base: Test infrastructure code for the module. Test subtrees (tests.base, tests.unit, tests.system) in modules dependent upon this module will get compiled against this code as well.
- tests.unit: Unit tests for the module. Modules dependent upon this module will NOT have access to this code.
- tests.system: System tests for the module. Modules dependent upon this module will NOT have access to this code.
These subtrees are compiled (and run) with certain dependencies: 'src' gets compiled only against the 'src' subtrees of modules this module is declared to be dependent upon. 'tests.base' gets compiled against the 'src' subtree of this module, as well as the 'src' and 'tests.base' subtrees of the modules this module is declared to be dependent upon. 'tests.unit' and 'tests.system' get compiled against the 'src' and 'tests.base' subtrees of this module, as well as of the modules this module is declared to be dependent upon.
The code for each subtree goes in that exact directory; for example, a class 'com.tc.Foo' in the 'tests.base' subtree of module 'bar' would go in 'code/base/bar/tests.base/com/tc/Foo.java'.