PackageService¶
The PackageService takes the final output of the prime step
and assembles it into the final package. Because this step is unique to the app,
the pack() and metadata() methods are abstract
and must be implemented by the app.
API documentation¶
- class craft_application.services.package.PackageService¶
The business logic for creating packages.
- abstract pack(prime_dir: Path, dest: Path) list[Path]¶
Create one or more packages.
- Parameters:
prime_dir – Directory path to the default prime directory. DEPRECATED in favour of retrieving this information from the
LifecycleService.dest – Directory into which to write the package(s).
- Returns:
A list of paths to the created packages.
- write_state(artifact: Path | None, resources: dict[str, Path] | None) None¶
Write the packaging state.
- read_state(platform: str | None = None) PackState¶
Read the packaging state.
- Parameters:
platform – The name of the platform to read. If not provided, uses the first platform in the build plan.
- Returns:
A PackState object containing the artifact and resources.
- abstract property metadata: BaseMetadata¶
The metadata model for this project.