Unit Command.Deps

Description

This unit contains procedures to configure and execute a command to install the boss dependencies of a workspace and make them available to every member.

Overview

Functions and Procedures

procedure DepsCommand(ABuilder: ICommandBuilder);
procedure Registry(ABuilder: ICommandBuilder);
procedure SyncWorkspaceModules(ABuilder: ICommandBuilder; const AWorkspaceDir: string);
procedure SyncMemberSources(ABuilder: ICommandBuilder; const AWorkspaceDir: string; const AMember: TWorkspaceMember);
function InstallDependencies(ABuilder: ICommandBuilder; const AWorkspaceDir: string; const ADependencies: TArray<string>): Boolean;

Description

Functions and Procedures

procedure DepsCommand(ABuilder: ICommandBuilder);

This command runs boss install at the root of the current workspace, even when called inside a member, so the whole workspace has a single boss.json and modules folder. Then it updates the search paths of every member (and its test project) with the source folders of the installed modules, relative to each member.

boss "projects" attribute is not used because boss writes those paths relative to the workspace root, while lazarus resolves them relative to each project file.

Parameters
ABuilder
Command builder of the main application that will be used to output user instructions about the execution state of this command.
procedure Registry(ABuilder: ICommandBuilder);

Registry a deps command using the command builder from pascli.

Parameters
ABuilder
Command builder of the main application that will be used to registry the command.
procedure SyncWorkspaceModules(ABuilder: ICommandBuilder; const AWorkspaceDir: string);

Updates the search paths of every workspace member and of its test project with the source folders of the modules installed by boss.

Parameters
ABuilder
Command builder of the main application that will be used to output the updated files.
AWorkspaceDir
Workspace root folder.
procedure SyncMemberSources(ABuilder: ICommandBuilder; const AWorkspaceDir: string; const AMember: TWorkspaceMember);

Adds the folders under src of an app member that have Pascal sources, like the feature folders of the web template, to the search paths of its project, in every build mode, and of its test project. FPC does not search the unit folders recursively, so a new folder would only fail later with "Can't find unit". Packages list their units in the .lpk and are not changed.

Parameters
ABuilder
Command builder of the main application that will be used to output the updated files.
AWorkspaceDir
Workspace root folder.
AMember
Workspace member.
function InstallDependencies(ABuilder: ICommandBuilder; const AWorkspaceDir: string; const ADependencies: TArray<string>): Boolean;

Runs boss install for each dependency at the workspace root, then updates the search paths of the members, like the deps command. Returns false, with the boss exit code in ExitCode, if boss failed.

Parameters
ABuilder
Command builder of the main application that will be used to output the boss output and the updated files.
AWorkspaceDir
Workspace root folder.
ADependencies
boss dependencies, like github.com/user/repo.

Generated by PasDoc 1.0.4.