Documentation ¶
Index ¶
- Variables
- type Library
- func (library *Library) DeclaredHeaders() []string
- func (library *Library) IsArchitectureIndependent() bool
- func (library *Library) IsCompatibleWith(arch string) bool
- func (library *Library) IsOptimizedForArchitecture(arch string) bool
- func (library *Library) SourceDirs() []SourceDir
- func (library *Library) SourceHeaders() ([]string, error)
- func (library *Library) String() string
- func (library *Library) SupportsAnyArchitectureIn(archs ...string) bool
- func (library *Library) ToRPCLibrary() (*rpc.Library, error)
- type LibraryLayout
- type LibraryLocation
- type List
- func (list *List) Add(libs ...*Library)
- func (list *List) Contains(lib *Library) bool
- func (list *List) FilterByVersionAndInstallLocation(version *semver.Version, installLocation LibraryLocation) List
- func (list *List) FindByName(name string) *Library
- func (list *List) Remove(libraryToRemove *Library)
- func (list *List) SortByName()
- type SourceDir
Constants ¶
This section is empty.
Variables ¶
var MandatoryProperties = []string{"name", "version", "author", "maintainer"}
MandatoryProperties FIXMEDOC
var OptionalProperties = []string{"sentence", "paragraph", "url"}
OptionalProperties FIXMEDOC
var ValidCategories = map[string]bool{ "Display": true, "Communication": true, "Signal Input/Output": true, "Sensors": true, "Device Control": true, "Timing": true, "Data Storage": true, "Data Processing": true, "Other": true, "Uncategorized": true, }
ValidCategories FIXMEDOC
Functions ¶
This section is empty.
Types ¶
type Library ¶
type Library struct { Name string Author string Maintainer string Sentence string Paragraph string Website string Category string Architectures []string Types []string `json:"types,omitempty"` InstallDir *paths.Path DirName string SourceDir *paths.Path UtilityDir *paths.Path Location LibraryLocation ContainerPlatform *cores.PlatformRelease `json:""` Layout LibraryLayout DotALinkage bool Precompiled bool PrecompiledWithSources bool LDflags string IsLegacy bool InDevelopment bool Version *semver.Version License string Properties *properties.Map Examples paths.PathList CompatibleWith map[string]bool // contains filtered or unexported fields }
Library represents a library in the system
func Load ¶
func Load(libDir *paths.Path, location LibraryLocation) (*Library, error)
Load loads a library from the given LibraryLocation
func (*Library) DeclaredHeaders ¶
DeclaredHeaders returns the C++ headers that the library declares in library.properties
func (*Library) IsArchitectureIndependent ¶
IsArchitectureIndependent returns true if the library declares to be compatible with all architectures (the `architecture` field in library.properties contains the `*` item)
func (*Library) IsCompatibleWith ¶
IsCompatibleWith returns true if the library declares compatibility with the given architecture. If this function returns false, the library may still be compatible with the given architecture, but it's not explicitly declared.
func (*Library) IsOptimizedForArchitecture ¶
IsOptimizedForArchitecture returns true if the library declares to be explicitly compatible for a specific architecture (the `architecture` field in library.properties contains the architecture passed as parameter)
func (*Library) SourceDirs ¶
SourceDirs return all the source directories of a library
func (*Library) SourceHeaders ¶
SourceHeaders returns all the C++ headers in the library even if not declared in library.properties
func (*Library) SupportsAnyArchitectureIn ¶
SupportsAnyArchitectureIn returns true if any of the following is true: - the library supports at least one of the given architectures - the library is architecture independent - the library doesn't specify any `architecture` field in library.properties
type LibraryLayout ¶
type LibraryLayout uint16
LibraryLayout represents how the library source code is laid out in the library
const ( // FlatLayout is a library without a `src` directory FlatLayout LibraryLayout = iota // RecursiveLayout is a library with `src` directory (that allows recursive build) RecursiveLayout )
func (LibraryLayout) MarshalJSON ¶
func (d LibraryLayout) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface
func (*LibraryLayout) String ¶
func (d *LibraryLayout) String() string
func (*LibraryLayout) ToRPCLibraryLayout ¶
func (d *LibraryLayout) ToRPCLibraryLayout() rpc.LibraryLayout
ToRPCLibraryLayout converts this LibraryLayout to rpc.LibraryLayout
func (*LibraryLayout) UnmarshalJSON ¶
func (d *LibraryLayout) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface
type LibraryLocation ¶
type LibraryLocation int
LibraryLocation represents where the library is installed
const ( // IDEBuiltIn are libraries bundled in the IDE IDEBuiltIn LibraryLocation = iota // PlatformBuiltIn are libraries bundled in a PlatformRelease PlatformBuiltIn // ReferencedPlatformBuiltIn are libraries bundled in a PlatformRelease referenced for build ReferencedPlatformBuiltIn // User are user installed libraries User // Unmanaged is for libraries set manually by the user in the CLI command or from the gRPC function. // Ideally it's used for `libraries` outside folders managed by the CLI. Unmanaged )
The enumeration is listed in ascending order of priority
func FromRPCLibraryInstallLocation ¶
func FromRPCLibraryInstallLocation(l rpc.LibraryInstallLocation) LibraryLocation
FromRPCLibraryInstallLocation converts a rpc.LibraryInstallLocation to a LibraryLocation
func FromRPCLibraryLocation ¶
func FromRPCLibraryLocation(l rpc.LibraryLocation) LibraryLocation
FromRPCLibraryLocation converts a rpc.LibraryLocation to a LibraryLocation
func (LibraryLocation) MarshalJSON ¶
func (d LibraryLocation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface
func (*LibraryLocation) String ¶
func (d *LibraryLocation) String() string
func (*LibraryLocation) ToRPCLibraryLocation ¶
func (d *LibraryLocation) ToRPCLibraryLocation() rpc.LibraryLocation
ToRPCLibraryLocation converts this LibraryLocation to rpc.LibraryLocation
func (*LibraryLocation) UnmarshalJSON ¶
func (d *LibraryLocation) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface
type List ¶
type List []*Library
List is a list of Libraries
func (*List) FilterByVersionAndInstallLocation ¶
func (list *List) FilterByVersionAndInstallLocation(version *semver.Version, installLocation LibraryLocation) List
FilterByVersionAndInstallLocation returns the libraries matching the provided version and install location. If version is nil all version are matched.
func (*List) FindByName ¶
FindByName returns the first library in the list that match the specified name or nil if not found