Documentation
¶
Overview ¶
Package project provides multi-package project management and build orchestration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCircularDependency indicates a circular dependency was detected. // Static errors for linting compliance. ErrCircularDependency = errors.New(i18n.T("errors.project.circular_dependency_detected")) // ErrCircularRuntimeDependency indicates a circular runtime dependency was detected. ErrCircularRuntimeDependency = errors.New( i18n.T("errors.project.circular_runtime_dependency_detected")) )
Functions ¶
This section is empty.
Types ¶
type BuildOptions ¶
type BuildOptions struct {
Verbose bool
CleanBuild bool
NoBuild bool
NoMakeDeps bool
SkipSyncDeps bool
SkipDeps []string
SkipToolchainValidation bool
Zap bool
Parallel bool
SBOM bool
FromPkgName string
ToPkgName string
TargetArch string
OnlyPkgNames string
SkipPkgNames string
DebugDir string
SBOMFormat string
ExtraRepos []string
}
BuildOptions holds all build configuration options. Use Apply() to propagate these options to the package-level globals.
type MultipleProject ¶
type MultipleProject struct {
BuildDir string `json:"buildDir" validate:"required"`
Description string `json:"description" validate:"required"`
Name string `json:"name" validate:"required"`
Output string `json:"output" validate:"required"`
Projects []*Project `json:"projects" validate:"required,dive,required"`
CompressionDeb string `json:"compressionDeb" validate:""`
CompressionRpm string `json:"compressionRpm" validate:""`
Signing *signing.Config `json:"signing,omitempty"`
Repos []repo.Repo `json:"repos,omitempty"`
SkipDeps []string `json:"skipDeps,omitempty"`
// Opts holds build configuration options (not JSON-serialized; set by caller)
Opts BuildOptions
// contains filtered or unexported fields
}
MultipleProject represents a collection of projects.
It contains a slice of Project objects and provides methods to interact with multiple projects. The methods include building all the projects, finding a package in the projects, and creating packages for each project. The MultipleProject struct also contains the output directory for the packages and the ToPkgName field, which can be used to stop the build process after a specific package.
func (*MultipleProject) BuildAll ¶
func (mpc *MultipleProject) BuildAll() error
BuildAll builds all projects in the correct order. When Parallel is false (default), projects are built sequentially in file order; packages with HasToInstall set are installed immediately after being built. When Parallel is true, a topological sort determines build order and packages are built concurrently using a worker pool.
func (*MultipleProject) Clean ¶
func (mpc *MultipleProject) Clean() error
Clean cleans up the MultipleProject by removing the package directories and source directories if the CleanBuild flag is set. It takes no parameters. It returns an error if there was a problem removing the directories.
func (*MultipleProject) MultiProject ¶
func (mpc *MultipleProject) MultiProject(distro, release, path string) error
MultiProject is a function that performs multiple project operations.
It takes in the following parameters: - distro: a string representing the distribution - release: a string representing the release - path: a string representing the path
It returns an error.
type Project ¶
type Project struct {
Builder *builder.Builder
BuildRoot string
Distro string
PackageManager packer.Packer
Path string
Release string
Root string
Name string `json:"name" validate:"required,startsnotwith=.,startsnotwith=./"`
HasToInstall bool `json:"install" validate:""`
Signing *signing.Config
}
Project represents a single project.
It contains the necessary information to build and manage the project. The fields include the project's name, the path to the project directory, the builder object, the package manager object, and a flag indicating whether the project has to be installed.