Documentation
¶
Index ¶
- Constants
- Variables
- type Library
- func (library *Library) IsArchitectureIndependent() bool
- func (library *Library) IsOptimizedForArchitecture(arch string) bool
- func (l *Library) Lint() ([]string, error)
- func (library *Library) PriorityForArchitecture(arch string) uint8
- func (library *Library) SourceDirs() []SourceDir
- func (library *Library) String() string
- func (library *Library) SupportsAnyArchitectureIn(archs ...string) bool
- type LibraryLayout
- type LibraryLocation
- type List
- type SourceDir
Constants ¶
const ( // IDEBuiltIn are libraries bundled in the IDE IDEBuiltIn = 1 << iota // PlatformBuiltIn are libraries bundled in a PlatformRelease PlatformBuiltIn // ReferencedPlatformBuiltIn are libraries bundled in a PlatformRelease referenced for build ReferencedPlatformBuiltIn // Sketchbook are user installed libraries Sketchbook )
The enumeration is listed in ascending order of priority
Variables ¶
var MandatoryProperties = []string{"name", "version", "author", "maintainer"}
var OptionalProperties = []string{"sentence", "paragraph", "url"}
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 SourceDir *paths.Path UtilityDir *paths.Path Location LibraryLocation ContainerPlatform *cores.PlatformRelease `json:""` Layout LibraryLayout RealName string DotALinkage bool Precompiled bool LDflags string IsLegacy bool Version *semver.Version License string Properties *properties.Map }
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) 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) 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) PriorityForArchitecture ¶
PriorityForArchitecture returns an integer that represents the priority this lib has for the specified architecture based on his location and the architectures directly supported (as exposed on the `architecture` field of the `library.properties`) This function returns an integer between 0 and 255, higher means higher priority.
func (*Library) SourceDirs ¶
SourceDirs return all the source directories of a library
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 = 1 << 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) 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
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) 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) FindByName ¶
FindByName returns the first library in the list that match the specified name or nil if not found
func (*List) SortByArchitecturePriority ¶
SortByArchitecturePriority sorts the libraries in descending order using the Arduino lib priority ordering (the first has the higher priority)