The composition tool is a command-line tool that helps developers manage dependencies for their projects. It allows developers to specify the dependencies for a project in a "plasma-compose.yaml" file, and then fetches and installs those dependencies in a structured and organized way.
The tool works by recursively fetching and processing the "plasma-compose.yaml" files for each package and its dependencies, and then merging the resulting filesystems into a single filesystem.
The composition tool is invoked from the command line with the following syntax: launchr compose [options] Where options are:
- -w, --working-dir : The directory where temporary files should be stored during the composition process. Default is the .compose/packages
- -s, --skip-not-versioned : Skip not versioned files from source directory (git only)
- --conflicts-verbosity: Log files conflicts in format "[curent-package] - path to file > Selectef from [domain, other package or current-package]"
Example usage - launchr compose -w=./folder/something -s=1 or -s=true --conflicts-verbosity
It's important to note that: if same file is present locally and also brought by a package, default strategy is that local file will be taken and package file ignored. Different strategies can be difined to customize this behavior to your needs.
The "plasma-compose.yaml" file is a text file that specifies the dependencies for a package, along with any necessary metadata and sources for those dependencies. The file format includes the following elements:
- name: The name of the package.
- version: The version number of the package.
- source: The source for the package, including the type of source (Git, HTTP), URL or file path, merge strategy and other metadata.
- dependencies: A list of required dependencies.
Example:
name: myproject
version: 1.0.0
dependencies:
- name: compose-example
source:
type: git
ref: master
tag: 0.0.1
url: https://github.com/example/compose-example.git
strategy:
- name: remove-extra-local-files
path: path/to/remove-extra-local-files
The composition tool fetches and installs dependencies for a package by recursively processing the "plasma-compose.yaml" files for each package and its dependencies. The tool follows these general steps:
- Fetch the package source code from the specified source location.
- Extract the package contents to a temporary directory.
- Process the "plasma-compose.yaml" file for the package, fetching and installing any necessary dependencies recursively.
- Merge the package filesystem into the final platform filesystem.
- Repeat steps 1-4 for each package and its dependencies.
During this process, the composition tool keeps track of the dependencies for each package.