pkg

package
v0.0.0-...-56472e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PACKAGE_STABILITY_STABLE = "stable"
	PACKAGE_STABILITY_LATEST = "latest"
	PACKAGE_STABILITY_DEV    = "dev"
)
View Source
const (
	PACKAGE_TYPE_COMPILER interfaces.PackageType = iota
	PACKAGE_TYPE_MFG
	PACKAGE_TYPE_SDK
	PACKAGE_TYPE_GENERATED
	PACKAGE_TYPE_LIB
	PACKAGE_TYPE_TRANSIENT
	PACKAGE_TYPE_BSP
	PACKAGE_TYPE_UNITTEST
	PACKAGE_TYPE_APP
	PACKAGE_TYPE_TARGET
)

Define constants with values of increasing priority.

View Source
const BSP_YAML_FILENAME = "bsp.yml"
View Source
const PACKAGE_FILE_NAME = "pkg.yml"
View Source
const SYSCFG_YAML_FILENAME = "syscfg.yml"

Variables

View Source
var LocalPackageSpecialNames = map[string]bool{
	"src":     true,
	"include": true,
	"bin":     true,
}
View Source
var PackageHashIgnoreDirs = map[string]bool{
	"obj": true,
	"bin": true,
	".":   true,
}
View Source
var PackageTypeNames = map[interfaces.PackageType]string{
	PACKAGE_TYPE_COMPILER:  "compiler",
	PACKAGE_TYPE_MFG:       "mfg",
	PACKAGE_TYPE_SDK:       "sdk",
	PACKAGE_TYPE_GENERATED: "generated",
	PACKAGE_TYPE_LIB:       "lib",
	PACKAGE_TYPE_TRANSIENT: "transient",
	PACKAGE_TYPE_BSP:       "bsp",
	PACKAGE_TYPE_UNITTEST:  "unittest",
	PACKAGE_TYPE_APP:       "app",
	PACKAGE_TYPE_TARGET:    "target",
}

Functions

func LocalPackageSpecialName

func LocalPackageSpecialName(dirName string) bool

func ReadLocalPackageRecursive

func ReadLocalPackageRecursive(repo *repo.Repo,
	pkgList map[string]interfaces.PackageInterface, basePath string,
	pkgName string, searchedMap map[string]struct{}) ([]string, error)

func ReadLocalPackages

func ReadLocalPackages(repo *repo.Repo, basePath string) (
	*map[string]interfaces.PackageInterface, []string, error)

func ShortName

func ShortName(p interfaces.PackageInterface) string

Types

type BspPackage

type BspPackage struct {
	*LocalPackage
	CompilerName       string
	Arch               string
	LinkerScripts      []string
	Part2LinkerScripts []string /* scripts to link app to second partition */
	DownloadScript     string
	DebugScript        string
	OptChkScript       string
	ImageOffset        int
	ImagePad           int
	FlashMap           flashmap.FlashMap
	BspV               ycfg.YCfg
}

func NewBspPackage

func NewBspPackage(lpkg *LocalPackage) (*BspPackage, error)

func (*BspPackage) BspYamlPath

func (bsp *BspPackage) BspYamlPath() string

func (*BspPackage) Reload

func (bsp *BspPackage) Reload(settings map[string]string) error

type Dependency

type Dependency struct {
	Name string
	Repo string
}

func NewDependency

func NewDependency(parentRepo interfaces.RepoInterface, depStr string) (*Dependency, error)

func (*Dependency) Init

func (dep *Dependency) Init(parentRepo interfaces.RepoInterface, depStr string) error

func (*Dependency) SatisfiesDependency

func (dep *Dependency) SatisfiesDependency(pkg interfaces.PackageInterface) bool

func (*Dependency) String

func (dep *Dependency) String() string

type LocalPackage

type LocalPackage struct {

	// Settings read from pkg.yml.
	PkgY ycfg.YCfg

	// Settings read from syscfg.yml.
	SyscfgY ycfg.YCfg
	// contains filtered or unexported fields
}

func LoadLocalPackage

func LoadLocalPackage(repo *repo.Repo, pkgDir string) (*LocalPackage, error)

func NewLocalPackage

func NewLocalPackage(r *repo.Repo, pkgDir string) *LocalPackage

func SortLclPkgs

func SortLclPkgs(pkgs []*LocalPackage) []*LocalPackage

func (*LocalPackage) AddCfgFilename

func (pkg *LocalPackage) AddCfgFilename(cfgFilename string)

func (*LocalPackage) BasePath

func (pkg *LocalPackage) BasePath() string

func (*LocalPackage) CfgFilenames

func (pkg *LocalPackage) CfgFilenames() []string

func (*LocalPackage) Clone

func (pkg *LocalPackage) Clone(newRepo *repo.Repo,
	newName string) *LocalPackage

func (*LocalPackage) Desc

func (pkg *LocalPackage) Desc() *PackageDesc

func (*LocalPackage) DownFuncs

func (pkg *LocalPackage) DownFuncs(
	settings map[string]string) map[string]string

DownFuncs retrieves the package's shutdown functions. The returned map has: key=C-function-name, value=numeric-stage.

func (*LocalPackage) FullName

func (pkg *LocalPackage) FullName() string

func (*LocalPackage) InitFuncs

func (pkg *LocalPackage) InitFuncs(
	settings map[string]string) map[string]string

func (*LocalPackage) InjectedSettings

func (pkg *LocalPackage) InjectedSettings() map[string]string

func (*LocalPackage) LinkedName

func (pkg *LocalPackage) LinkedName() string

func (*LocalPackage) Load

func (pkg *LocalPackage) Load() error

Load reads everything that isn't identity specific into the package

func (*LocalPackage) Name

func (pkg *LocalPackage) Name() string

func (*LocalPackage) NameWithRepo

func (pkg *LocalPackage) NameWithRepo() string

func (*LocalPackage) PkgYamlPath

func (pkg *LocalPackage) PkgYamlPath() string

func (*LocalPackage) PostLinkCmds

func (pkg *LocalPackage) PostLinkCmds(
	settings map[string]string) map[string]string

func (*LocalPackage) PreBuildCmds

func (pkg *LocalPackage) PreBuildCmds(
	settings map[string]string) map[string]string

func (*LocalPackage) PreLinkCmds

func (pkg *LocalPackage) PreLinkCmds(
	settings map[string]string) map[string]string

func (*LocalPackage) RelativePath

func (pkg *LocalPackage) RelativePath() string

func (*LocalPackage) Repo

func (*LocalPackage) Save

func (pkg *LocalPackage) Save() error

Saves the package's pkg.yml file. NOTE: This does not save every field in the package. Only the fields necessary for creating a new target get saved.

func (*LocalPackage) SaveSyscfg

func (lpkg *LocalPackage) SaveSyscfg() error

func (*LocalPackage) SetBasePath

func (pkg *LocalPackage) SetBasePath(basePath string)

func (*LocalPackage) SetDesc

func (pkg *LocalPackage) SetDesc(desc *PackageDesc)

func (*LocalPackage) SetName

func (pkg *LocalPackage) SetName(name string)

func (*LocalPackage) SetRepo

func (pkg *LocalPackage) SetRepo(r *repo.Repo)

func (*LocalPackage) SetType

func (pkg *LocalPackage) SetType(packageType interfaces.PackageType)

func (*LocalPackage) SyscfgYamlPath

func (pkg *LocalPackage) SyscfgYamlPath() string

func (*LocalPackage) Type

func (pkg *LocalPackage) Type() interfaces.PackageType

type Package

type Package interface {
	// The repository this package belongs to
	Repo() interfaces.RepoInterface
	// The name of this package
	Name() string
	// The full name of this package, including repo
	FullName() string
	// The type of package (lib, target, bsp, etc.)
	Type() interfaces.PackageType
	// BasePath is the path on disk if it's a local package
	BasePath() string
	// Hash of the contents of the package
	Hash() (string, error)
	// Description of this package
	Desc() *PackageDesc
	// APIs exported by this package
	Apis() []string
	// APIs required by this package
	ReqApis() []string
}

An interface, representing information about a Package This interface is implemented by both packages in the local directory, but also packages that are stored in remote repositories. It is abstracted so that routines that do package search & installation can work across both local & remote packages without needing to special case.

type PackageDesc

type PackageDesc struct {
	// Author of the package
	Author string
	// Homepage of the package for more information
	Homepage    string
	Description string
	Keywords    []string
}

Description of a package

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL