Repositories are loaded and used by the build environment to provide the appropriate services. They currently provide two functionalities:
- Dynamically loading build tasks to use (See BuildRepository.lookupTask(
TaskName) ) - Execution actions (See executeAction(
String...) )
Repositories can optionally provide access to actions which basically act as a main function for the repository. It can be used to execute code with the given parameters. Via actions, repositories can provide access to core features of it without the need of intializing a build execution.
Repositories are instantiated using SakerRepositoryFactory factory class that receives the environment for repositories to work with.
public void | close() Closes the repository and any child build repositories. |
public BuildRepository | createBuildRepository( Creates a build repository for the configuration specified by the environment parameter. |
public default void | executeAction( Executes an arbitrary action on this repository with the given parameters. |
Subsequent calls to this method should be a no-op. I.e. this method should be idempotent.
The created build repository should operate based on the configuration available from the parameter environment.
Build repositories are required to set the class lookup resolution appropriately in order for proper incremental build handling. (See RepositoryBuildEnvironment.getClassLoaderResolverRegistry())
Repository implementations should keep track of the created build repositories, and call close() on them
if this
parent repository is closed. If the created build repositories handle no unmanaged data,
this behaviour can be omitted.
If this method throws an exception, the build execution will be aborted.
This method servers as a main method to the repository. Calling it will execute custom actions specified by the repository implementation.
Implementations are not recommended to call System.exit(
The default implementation throws an UnsupportedOperationException.