Documentation ¶
Index ¶
- type Builder
- func (pmb *Builder) Build() *PackageManager
- func (pmb *Builder) BuildIntoExistingPackageManager(target *PackageManager)
- func (pmb *Builder) GetOrCreatePackage(packager string) *cores.Package
- func (pm *Builder) LoadHardware() []error
- func (pmb *Builder) LoadHardwareForProfile(p *sketch.Profile, installMissing bool, downloadCB rpc.DownloadProgressCB, ...) []error
- func (pm *Builder) LoadHardwareFromDirectories(hardwarePaths paths.PathList) []error
- func (pm *Builder) LoadHardwareFromDirectory(path *paths.Path) []error
- func (pmb *Builder) LoadPackageIndex(URL *url.URL) error
- func (pmb *Builder) LoadPackageIndexFromFile(indexPath *paths.Path) (*packageindex.Index, error)
- func (pm *Builder) LoadToolsFromBundleDirectories(dirs paths.PathList) []error
- func (pm *Builder) LoadToolsFromBundleDirectory(toolsPath *paths.Path) error
- func (pm *Builder) LoadToolsFromPackageDir(targetPackage *cores.Package, toolsPath *paths.Path) []error
- type Explorer
- func (pme *Explorer) DiscoveryManager() *discoverymanager.DiscoveryManager
- func (pme *Explorer) DownloadAndInstallPlatformAndTools(platformRelease *cores.PlatformRelease, requiredTools []*cores.ToolRelease, ...) error
- func (pme *Explorer) DownloadAndInstallPlatformUpgrades(platformRef *PlatformReference, downloadCB rpc.DownloadProgressCB, ...) (*cores.PlatformRelease, error)
- func (pme *Explorer) DownloadPlatformRelease(platform *cores.PlatformRelease, config *downloader.Config, ...) error
- func (pme *Explorer) DownloadToolRelease(tool *cores.ToolRelease, config *downloader.Config, ...) error
- func (pme *Explorer) FindBoardWithFQBN(fqbnIn string) (*cores.Board, error)
- func (pme *Explorer) FindBoardsWithID(id string) []*cores.Board
- func (pme *Explorer) FindBoardsWithVidPid(vid, pid string) []*cores.Board
- func (pme *Explorer) FindDiscoveryDependency(discovery *cores.DiscoveryDependency) *cores.ToolRelease
- func (pme *Explorer) FindMonitorDependency(discovery *cores.MonitorDependency) *cores.ToolRelease
- func (pme *Explorer) FindPlatform(ref *PlatformReference) *cores.Platform
- func (pme *Explorer) FindPlatformRelease(ref *PlatformReference) *cores.PlatformRelease
- func (pme *Explorer) FindPlatformReleaseDependencies(item *PlatformReference) (*cores.PlatformRelease, []*cores.ToolRelease, error)
- func (pme *Explorer) FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid string) []*cores.PlatformRelease
- func (pme *Explorer) FindToolDependency(dep *cores.ToolDependency) *cores.ToolRelease
- func (pme *Explorer) FindToolsRequiredForBuild(platform, buildPlatform *cores.PlatformRelease) ([]*cores.ToolRelease, error)
- func (pme *Explorer) FindToolsRequiredFromPlatformRelease(platform *cores.PlatformRelease) ([]*cores.ToolRelease, error)
- func (pme *Explorer) GetAllInstalledToolsReleases() []*cores.ToolRelease
- func (pme *Explorer) GetCustomGlobalProperties() *properties.Map
- func (pme *Explorer) GetEnvVarsForSpawnedProcess() []string
- func (pme *Explorer) GetInstalledPlatformRelease(platform *cores.Platform) *cores.PlatformRelease
- func (pme *Explorer) GetPackages() cores.Packages
- func (pme *Explorer) GetProfile() *sketch.Profile
- func (pme *Explorer) GetTool(toolID string) *cores.Tool
- func (pme *Explorer) IdentifyBoard(idProps *properties.Map) []*cores.Board
- func (pme *Explorer) InstallPlatform(platformRelease *cores.PlatformRelease) error
- func (pme *Explorer) InstallPlatformInDirectory(platformRelease *cores.PlatformRelease, destDir *paths.Path) error
- func (pme *Explorer) InstallTool(toolRelease *cores.ToolRelease, taskCB rpc.TaskProgressCB, ...) error
- func (pme *Explorer) InstalledBoards() []*cores.Board
- func (pme *Explorer) InstalledPlatformReleases() []*cores.PlatformRelease
- func (pme *Explorer) IsManagedPlatformRelease(platformRelease *cores.PlatformRelease) bool
- func (pme *Explorer) IsManagedToolRelease(toolRelease *cores.ToolRelease) bool
- func (pme *Explorer) IsToolRequired(toolRelease *cores.ToolRelease) bool
- func (pme *Explorer) LoadDiscoveries() []error
- func (pme *Explorer) NormalizeFQBN(fqbn *cores.FQBN) (*cores.FQBN, error)
- func (pme *Explorer) Package(name string) *PackageActions
- func (pme *Explorer) ResolveFQBN(fqbn *cores.FQBN) (*cores.Package, *cores.PlatformRelease, *cores.Board, *properties.Map, ...)
- func (pme *Explorer) RunPostInstallScript(installDir *paths.Path) ([]byte, []byte, error)
- func (pme *Explorer) UninstallPlatform(platformRelease *cores.PlatformRelease, taskCB rpc.TaskProgressCB) error
- func (pme *Explorer) UninstallTool(toolRelease *cores.ToolRelease, taskCB rpc.TaskProgressCB) error
- type PackageActions
- type PackageManager
- type PlatformReference
- type ToolActions
- type ToolReleaseActions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder PackageManager
Builder is used to create a new PackageManager. The builder has methods to load platforms and tools to actually build the PackageManager. Once the PackageManager is built, it cannot be changed anymore.
func NewBuilder ¶
NewBuilder returns a new Builder
func (*Builder) Build ¶
func (pmb *Builder) Build() *PackageManager
Build builds a new PackageManager.
func (*Builder) BuildIntoExistingPackageManager ¶
func (pmb *Builder) BuildIntoExistingPackageManager(target *PackageManager)
BuildIntoExistingPackageManager will overwrite the given PackageManager instead of building a new one.
func (*Builder) GetOrCreatePackage ¶
GetOrCreatePackage returns the specified Package or creates an empty one filling all the cross-references
func (*Builder) LoadHardware ¶
LoadHardware read all plaforms from the configured paths
func (*Builder) LoadHardwareForProfile ¶
func (pmb *Builder) LoadHardwareForProfile(p *sketch.Profile, installMissing bool, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB) []error
LoadHardwareForProfile load the hardware platforms for the given profile. If installMissing is true then possibly missing tools and platforms will be downloaded and installed.
func (*Builder) LoadHardwareFromDirectories ¶
LoadHardwareFromDirectories load plaforms from a set of directories
func (*Builder) LoadHardwareFromDirectory ¶
LoadHardwareFromDirectory read a plaform from the path passed as parameter
func (*Builder) LoadPackageIndex ¶
LoadPackageIndex loads a package index by looking up the local cached file from the specified URL
func (*Builder) LoadPackageIndexFromFile ¶
LoadPackageIndexFromFile load a package index from the specified file
func (*Builder) LoadToolsFromBundleDirectories ¶
LoadToolsFromBundleDirectories FIXMEDOC
func (*Builder) LoadToolsFromBundleDirectory ¶
LoadToolsFromBundleDirectory FIXMEDOC
type Explorer ¶
type Explorer PackageManager
Explorer is used to query the PackageManager. When used it holds a read-only lock on the PackageManager that must be released when the job is completed.
func (*Explorer) DiscoveryManager ¶
func (pme *Explorer) DiscoveryManager() *discoverymanager.DiscoveryManager
DiscoveryManager returns the DiscoveryManager in use by this PackageManager
func (*Explorer) DownloadAndInstallPlatformAndTools ¶
func (pme *Explorer) DownloadAndInstallPlatformAndTools( platformRelease *cores.PlatformRelease, requiredTools []*cores.ToolRelease, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB, skipPostInstall bool) error
DownloadAndInstallPlatformAndTools runs a full installation process for the given platform and tools. This method takes care of downloading missing archives, installing/upgrading platforms and tools, and removing the previously installed platform/tools that are no longer needed after the upgrade.
func (*Explorer) DownloadAndInstallPlatformUpgrades ¶
func (pme *Explorer) DownloadAndInstallPlatformUpgrades( platformRef *PlatformReference, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB, skipPostInstall bool, ) (*cores.PlatformRelease, error)
DownloadAndInstallPlatformUpgrades runs a full installation process to upgrade the given platform. This method takes care of downloading missing archives, upgrading platforms and tools, and removing the previously installed platform/tools that are no longer needed after the upgrade.
func (*Explorer) DownloadPlatformRelease ¶
func (pme *Explorer) DownloadPlatformRelease(platform *cores.PlatformRelease, config *downloader.Config, progressCB rpc.DownloadProgressCB) error
DownloadPlatformRelease downloads a PlatformRelease. If the platform is already downloaded a nil Downloader is returned.
func (*Explorer) DownloadToolRelease ¶
func (pme *Explorer) DownloadToolRelease(tool *cores.ToolRelease, config *downloader.Config, progressCB rpc.DownloadProgressCB) error
DownloadToolRelease downloads a ToolRelease. If the tool is already downloaded a nil Downloader is returned. Uses the given downloader configuration for download, or the default config if nil.
func (*Explorer) FindBoardWithFQBN ¶
FindBoardWithFQBN returns the board identified by the fqbn, or an error
func (*Explorer) FindBoardsWithID ¶
FindBoardsWithID FIXMEDOC
func (*Explorer) FindBoardsWithVidPid ¶
FindBoardsWithVidPid FIXMEDOC
func (*Explorer) FindDiscoveryDependency ¶
func (pme *Explorer) FindDiscoveryDependency(discovery *cores.DiscoveryDependency) *cores.ToolRelease
FindDiscoveryDependency returns the ToolRelease referenced by the DiscoveryDepenency or nil if the referenced discovery doesn't exists.
func (*Explorer) FindMonitorDependency ¶
func (pme *Explorer) FindMonitorDependency(discovery *cores.MonitorDependency) *cores.ToolRelease
FindMonitorDependency returns the ToolRelease referenced by the MonitorDepenency or nil if the referenced monitor doesn't exists.
func (*Explorer) FindPlatform ¶
func (pme *Explorer) FindPlatform(ref *PlatformReference) *cores.Platform
FindPlatform returns the Platform matching the PlatformReference or nil if not found. The PlatformVersion field of the reference is ignored.
func (*Explorer) FindPlatformRelease ¶
func (pme *Explorer) FindPlatformRelease(ref *PlatformReference) *cores.PlatformRelease
FindPlatformRelease returns the PlatformRelease matching the PlatformReference or nil if not found
func (*Explorer) FindPlatformReleaseDependencies ¶
func (pme *Explorer) FindPlatformReleaseDependencies(item *PlatformReference) (*cores.PlatformRelease, []*cores.ToolRelease, error)
FindPlatformReleaseDependencies takes a PlatformReference and returns a set of items to download and a set of outputs for non existing platforms.
func (*Explorer) FindPlatformReleaseProvidingBoardsWithVidPid ¶
func (pme *Explorer) FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid string) []*cores.PlatformRelease
FindPlatformReleaseProvidingBoardsWithVidPid FIXMEDOC
func (*Explorer) FindToolDependency ¶
func (pme *Explorer) FindToolDependency(dep *cores.ToolDependency) *cores.ToolRelease
FindToolDependency returns the ToolRelease referenced by the ToolDependency or nil if the referenced tool doesn't exists.
func (*Explorer) FindToolsRequiredForBuild ¶
func (pme *Explorer) FindToolsRequiredForBuild(platform, buildPlatform *cores.PlatformRelease) ([]*cores.ToolRelease, error)
FindToolsRequiredForBuild returns the list of ToolReleases needed to build for the specified plaftorm. The buildPlatform may be different depending on the selected board.
func (*Explorer) FindToolsRequiredFromPlatformRelease ¶
func (pme *Explorer) FindToolsRequiredFromPlatformRelease(platform *cores.PlatformRelease) ([]*cores.ToolRelease, error)
FindToolsRequiredFromPlatformRelease returns a list of ToolReleases needed by the specified PlatformRelease. If a ToolRelease is not found return an error
func (*Explorer) GetAllInstalledToolsReleases ¶
func (pme *Explorer) GetAllInstalledToolsReleases() []*cores.ToolRelease
GetAllInstalledToolsReleases FIXMEDOC
func (*Explorer) GetCustomGlobalProperties ¶
func (pme *Explorer) GetCustomGlobalProperties() *properties.Map
GetCustomGlobalProperties returns the user defined custom global properties for installed platforms.
func (*Explorer) GetEnvVarsForSpawnedProcess ¶
GetEnvVarsForSpawnedProcess produces a set of environment variables that must be sent to all processes spawned from the arduino-cli.
func (*Explorer) GetInstalledPlatformRelease ¶
func (pme *Explorer) GetInstalledPlatformRelease(platform *cores.Platform) *cores.PlatformRelease
GetInstalledPlatformRelease returns the PlatformRelease installed (it is chosen)
func (*Explorer) GetPackages ¶
GetPackages returns the inter packages structure for direct usage. Deprecated: do not access packages directly, but use specific Explorer methods when possible.
func (*Explorer) GetProfile ¶
GetProfile returns the active profile for this package manager, or nil if no profile is selected.
func (*Explorer) IdentifyBoard ¶
func (pme *Explorer) IdentifyBoard(idProps *properties.Map) []*cores.Board
IdentifyBoard returns a list of boards whose identification properties match the provided ones.
func (*Explorer) InstallPlatform ¶
func (pme *Explorer) InstallPlatform(platformRelease *cores.PlatformRelease) error
InstallPlatform installs a specific release of a platform.
func (*Explorer) InstallPlatformInDirectory ¶
func (pme *Explorer) InstallPlatformInDirectory(platformRelease *cores.PlatformRelease, destDir *paths.Path) error
InstallPlatformInDirectory installs a specific release of a platform in a specific directory.
func (*Explorer) InstallTool ¶
func (pme *Explorer) InstallTool(toolRelease *cores.ToolRelease, taskCB rpc.TaskProgressCB, skipPostInstall bool) error
InstallTool installs a specific release of a tool.
func (*Explorer) InstalledBoards ¶
InstalledBoards returns all installed Boards. This function is useful to range all Boards in for loops.
func (*Explorer) InstalledPlatformReleases ¶
func (pme *Explorer) InstalledPlatformReleases() []*cores.PlatformRelease
InstalledPlatformReleases returns all installed PlatformReleases. This function is useful to range all PlatformReleases in for loops.
func (*Explorer) IsManagedPlatformRelease ¶
func (pme *Explorer) IsManagedPlatformRelease(platformRelease *cores.PlatformRelease) bool
IsManagedPlatformRelease returns true if the PlatforRelease is managed by the PackageManager
func (*Explorer) IsManagedToolRelease ¶
func (pme *Explorer) IsManagedToolRelease(toolRelease *cores.ToolRelease) bool
IsManagedToolRelease returns true if the ToolRelease is managed by the PackageManager
func (*Explorer) IsToolRequired ¶
func (pme *Explorer) IsToolRequired(toolRelease *cores.ToolRelease) bool
IsToolRequired returns true if any of the installed platforms requires the toolRelease passed as parameter
func (*Explorer) LoadDiscoveries ¶
LoadDiscoveries load all discoveries for all loaded platforms Returns error if: * A PluggableDiscovery instance can't be created * Tools required by the PlatformRelease cannot be found * Command line to start PluggableDiscovery has malformed or mismatched quotes
func (*Explorer) NormalizeFQBN ¶
NormalizeFQBN return a normalized copy of the given FQBN, that is the same FQBN but with the unneeded or invalid options removed.
func (*Explorer) Package ¶
func (pme *Explorer) Package(name string) *PackageActions
Package looks for the Package with the given name, returning a structure able to perform further operations on that given resource
func (*Explorer) ResolveFQBN ¶
func (pme *Explorer) ResolveFQBN(fqbn *cores.FQBN) ( *cores.Package, *cores.PlatformRelease, *cores.Board, *properties.Map, *cores.PlatformRelease, error)
ResolveFQBN returns, in order:
- the Package pointed by the fqbn
- the PlatformRelease pointed by the fqbn
- the Board pointed by the fqbn
- the build properties for the board considering also the configuration part of the fqbn
- the PlatformRelease to be used for the build (if the board requires a 3rd party core it may be different from the PlatformRelease pointed by the fqbn)
- an error if any of the above is not found
In case of error the partial results found in the meantime are returned together with the error.
func (*Explorer) RunPostInstallScript ¶ added in v0.0.2
RunPostInstallScript runs the post_install.sh (or post_install.bat) script for the specified platformRelease or toolRelease.
func (*Explorer) UninstallPlatform ¶
func (pme *Explorer) UninstallPlatform(platformRelease *cores.PlatformRelease, taskCB rpc.TaskProgressCB) error
UninstallPlatform remove a PlatformRelease.
func (*Explorer) UninstallTool ¶
func (pme *Explorer) UninstallTool(toolRelease *cores.ToolRelease, taskCB rpc.TaskProgressCB) error
UninstallTool remove a ToolRelease.
type PackageActions ¶
type PackageActions struct {
// contains filtered or unexported fields
}
PackageActions defines what actions can be performed on the specific Package It serves as a status container for the fluent APIs
func (*PackageActions) Tool ¶
func (pa *PackageActions) Tool(name string) *ToolActions
Tool looks for the Tool with the given name, returning a structure able to perform further operations on that given resource
type PackageManager ¶
type PackageManager struct { IndexDir *paths.Path PackagesDir *paths.Path DownloadDir *paths.Path // contains filtered or unexported fields }
PackageManager defines the superior oracle which understands all about Arduino Packages, how to parse them, download, and so on.
The manager also keeps track of the status of the Packages (their Platform Releases, actually) installed in the system.
func (*PackageManager) IdentifyBoardConfiguration ¶
func (pm *PackageManager) IdentifyBoardConfiguration(idProps *properties.Map, board *cores.Board) *properties.Map
IdentifyBoardConfiguration returns the configuration of the board that can be deduced from the given upload port identification properties
func (*PackageManager) NewBuilder ¶
func (pm *PackageManager) NewBuilder() (builder *Builder, commit func())
NewBuilder creates a Builder with the same configuration of this PackageManager. A "commit" function callback is returned: calling this function will make the builder write the new configuration into this PackageManager.
func (*PackageManager) NewExplorer ¶
func (pm *PackageManager) NewExplorer() (explorer *Explorer, release func())
NewExplorer creates an Explorer for this PackageManager. The Explorer will keep a read-lock on the underlying PackageManager, the user must call the "release" callback function to release the lock when the Explorer is no more needed.
type PlatformReference ¶
type PlatformReference struct { Package string // The package where this Platform belongs to. PlatformArchitecture string PlatformVersion *semver.Version }
PlatformReference represents a tuple to identify a Platform
func (*PlatformReference) String ¶
func (platform *PlatformReference) String() string
type ToolActions ¶
type ToolActions struct {
// contains filtered or unexported fields
}
ToolActions defines what actions can be performed on the specific Tool It serves as a status container for the fluent APIs
func (*ToolActions) Get ¶
func (ta *ToolActions) Get() (*cores.Tool, error)
Get returns the final representation of the Tool
func (*ToolActions) IsInstalled ¶
func (ta *ToolActions) IsInstalled() (bool, error)
IsInstalled checks whether any release of the Tool is installed in the system
func (*ToolActions) Release ¶
func (ta *ToolActions) Release(version *semver.RelaxedVersion) *ToolReleaseActions
Release FIXMEDOC
type ToolReleaseActions ¶
type ToolReleaseActions struct {
// contains filtered or unexported fields
}
ToolReleaseActions defines what actions can be performed on the specific ToolRelease It serves as a status container for the fluent APIs
func (*ToolReleaseActions) Get ¶
func (tr *ToolReleaseActions) Get() (*cores.ToolRelease, error)
Get FIXMEDOC