Workspace
Description
A workspace is a repository with several apps and internal Lazarus packages, sharing a single boss manifest. Inside the same repository code is shared by Lazarus, with packages referenced by relative path; boss handles only the external dependencies.
repo/
├── pasc.json # workspace manifest: { "members": ["packages/*", "apps/*"] }
├── boss.json # the only boss.json: external dependencies of the whole workspace
├── boss-lock.json
├── modules/ # installed by boss at the root, shared by every member
├── packages/
│ └── core/ # core.lpk, src/, tests/
└── apps/
└── cli/ # cli.lpi, cli.lpr, src/, tests/
Creating a workspace
pasc new repo --workspace cd repo pasc new core --package pasc new cli --app
Members are created in the right folder from anywhere inside the workspace, without a boss.json or git of their own. An existing project is converted with pasc add --workspace, see Add Command.
Using packages
Inside a member, pasc add --package=core makes its .lpi or .lpk, and its test project, require the package by a relative path, so lazbuild builds it without registering it in the IDE.
Building and testing
At the root of the workspace pasc build builds every member, packages before the members that require them, and pasc test runs the tests of every member and prints a summary. pasc build apps/cli builds a single member.
Dependencies
pasc deps runs boss install at the root, even inside a member, and writes the module folders to the search paths of every member, relative to each one; see Deps Command. It, pasc build and pasc test also add the folders with units under src of each app to its search paths and to those of its test project. Use the same boss version everywhere: the module folder names depend on it.
A library used by other repositories through boss must stay in its own repository, since boss versions by repository tag. Code used only inside the workspace goes to packages.
Next Add Command |
|---|
Generated by PasDoc 1.0.4.