Movatterモバイル変換


[0]ホーム

URL:


packagemanager

package
v1.3.1Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License:GPL-3.0Imports:33Imported by:0

Details

Repository

github.com/arduino/arduino-cli

Links

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPlatformNotAvailableForOS =errors.New("platform is not available for your OS")

Functions

This section is empty.

Types

typeBuilder

type BuilderPackageManager

Builder is used to create a new PackageManager. The builderhas methods to load platforms and tools to actually build the PackageManager.Once the PackageManager is built, it cannot be changed anymore.

funcNewBuilder

func NewBuilder(indexDir, packagesDir, userPackagesDir, downloadDir, tempDir *paths.Path, userAgentstring, downloaderConfig downloader.Config) *Builder

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 insteadof building a new one.

func (*Builder)GetOrCreatePackage

func (pmb *Builder) GetOrCreatePackage(packagerstring) *cores.Package

GetOrCreatePackage returns the specified Package or creates an empty onefilling all the cross-references

func (*Builder)LoadGlobalHardwareForProfileadded inv1.3.0

func (pmb *Builder) LoadGlobalHardwareForProfile(p *sketch.Profile) []error

LoadGlobalHardwareForProfile loads the hardware platforms for the given profile.It uses the global package manager and does not download or install any missing tools or platforms.

func (*Builder)LoadHardware

func (pm *Builder) LoadHardware() []error

LoadHardware read all plaforms from the configured paths

func (*Builder)LoadHardwareForProfile

func (pmb *Builder) LoadHardwareForProfile(ctxcontext.Context, p *sketch.Profile, installMissingbool, downloadCBrpc.DownloadProgressCB, taskCBrpc.TaskProgressCB, settings *configuration.Settings) []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

func (pm *Builder) LoadHardwareFromDirectories(hardwarePaths paths.PathList) []error

LoadHardwareFromDirectories load plaforms from a set of directories

func (*Builder)LoadHardwareFromDirectory

func (pm *Builder) LoadHardwareFromDirectory(path *paths.Path) []error

LoadHardwareFromDirectory read a plaform from the path passed as parameter

func (*Builder)LoadPackageIndex

func (pmb *Builder) LoadPackageIndex(URL *url.URL)error

LoadPackageIndex loads a package index by looking up the local cached file from the specified URL

func (*Builder)LoadPackageIndexFromFile

func (pmb *Builder) LoadPackageIndexFromFile(indexPath *paths.Path) (*packageindex.Index,error)

LoadPackageIndexFromFile load a package index from the specified file

func (*Builder)LoadToolsFromPackageDir

func (pm *Builder) LoadToolsFromPackageDir(targetPackage *cores.Package, toolsPath *paths.Path) []error

LoadToolsFromPackageDir loads a set of tools from the given toolsPath. The tools will be loadedin the given *Package.

typeExplorer

type ExplorerPackageManager

Explorer is used to query the PackageManager. When used it holdsa read-only lock on the PackageManager that must be released when thejob is completed.

func (*Explorer)Dirty

func (pme *Explorer) Dirty()bool

Dirty returns true if one of the loaded platforms needs to be re-initializeddue to file changes in the platform releases.

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(ctxcontext.Context,platformRelease *cores.PlatformRelease, requiredTools []*cores.ToolRelease,downloadCBrpc.DownloadProgressCB, taskCBrpc.TaskProgressCB,skipPostInstallbool, skipPreUninstallbool, checksresources.IntegrityCheckMode)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, andremoving the previously installed platform/tools that are no longer needed after the upgrade.

func (*Explorer)DownloadAndInstallPlatformUpgrades

func (pme *Explorer) DownloadAndInstallPlatformUpgrades(ctxcontext.Context,platformRef *PlatformReference,downloadCBrpc.DownloadProgressCB,taskCBrpc.TaskProgressCB,skipPostInstallbool,skipPreUninstallbool,checksresources.IntegrityCheckMode,) (*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, andremoving the previously installed platform/tools that are no longer needed after the upgrade.

func (*Explorer)DownloadPlatformRelease

func (pme *Explorer) DownloadPlatformRelease(ctxcontext.Context, platform *cores.PlatformRelease, progressCBrpc.DownloadProgressCB)error

DownloadPlatformRelease downloads a PlatformRelease. If the platform is already downloaded anil Downloader is returned.

func (*Explorer)DownloadToolRelease

func (pme *Explorer) DownloadToolRelease(ctxcontext.Context, tool *cores.ToolRelease, progressCBrpc.DownloadProgressCB)error

DownloadToolRelease downloads a ToolRelease. If the tool is already downloaded a nil Downloaderis returned. Uses the given downloader configuration for download, or the default config if nil.

func (*Explorer)FindBoardWithFQBN

func (pme *Explorer) FindBoardWithFQBN(fqbnInstring) (*cores.Board,error)

FindBoardWithFQBN returns the board identified by the fqbn, or an error

func (*Explorer)FindDiscoveryDependency

func (pme *Explorer) FindDiscoveryDependency(discovery *cores.DiscoveryDependency) *cores.ToolRelease

FindDiscoveryDependency returns the ToolRelease referenced by the DiscoveryDepenency or nil ifthe 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 ifthe 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 anda set of outputs for non existing platforms.

func (*Explorer)FindPlatformReleaseProvidingBoardsWithVidPid

func (pme *Explorer) FindPlatformReleaseProvidingBoardsWithVidPid(vid, pidstring) []*cores.Platform

FindPlatformReleaseProvidingBoardsWithVidPid FIXMEDOC

func (*Explorer)FindToolDependency

func (pme *Explorer) FindToolDependency(dep *cores.ToolDependency) *cores.ToolRelease

FindToolDependency returns the ToolRelease referenced by the ToolDependency or nil ifthe 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 specifiedplaftorm. 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 globalproperties for installed platforms.

func (*Explorer)GetEnvVarsForSpawnedProcess

func (pme *Explorer) GetEnvVarsForSpawnedProcess() []string

GetEnvVarsForSpawnedProcess produces a set of environment variables thatmust 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

func (pme *Explorer) GetPackages()cores.Packages

GetPackages returns the internal packages structure for direct usage.Deprecated: do not access packages directly, but use specific Explorer methods when possible.

func (*Explorer)GetProfile

func (pme *Explorer) GetProfile() *sketch.Profile

GetProfile returns the active profile for this package manager, or nil if no profile is selected.

func (*Explorer)GetTool

func (pme *Explorer) GetTool(toolIDstring) *cores.Tool

GetTool searches for tool in all packages and platforms.

func (*Explorer)IdentifyBoard

func (pme *Explorer) IdentifyBoard(idProps *properties.Map) []*cores.Board

IdentifyBoard returns a list of boards whose identification properties match theprovided ones.

func (*Explorer)InstallPlatform

func (pme *Explorer) InstallPlatform(platformRelease *cores.PlatformRelease, checksresources.IntegrityCheckMode)error

InstallPlatform installs a specific release of a platform.

func (*Explorer)InstallPlatformInDirectory

func (pme *Explorer) InstallPlatformInDirectory(platformRelease *cores.PlatformRelease, destDir *paths.Path, checksresources.IntegrityCheckMode)error

InstallPlatformInDirectory installs a specific release of a platform in a specific directory.

func (*Explorer)InstallTool

func (pme *Explorer) InstallTool(toolRelease *cores.ToolRelease, taskCBrpc.TaskProgressCB, skipPostInstallbool, checksresources.IntegrityCheckMode)error

InstallTool installs a specific release of a tool.

func (*Explorer)InstalledBoards

func (pme *Explorer) InstalledBoards() []*cores.Board

InstalledBoards returns all installed Boards. This function is useful to rangeall Boards in for loops.

func (*Explorer)InstalledPlatformReleases

func (pme *Explorer) InstalledPlatformReleases() []*cores.PlatformRelease

InstalledPlatformReleases returns all installed PlatformReleases. This function isuseful 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 toolReleasepassed as parameter

func (*Explorer)LoadDiscoveries

func (pme *Explorer) LoadDiscoveries() []error

LoadDiscoveries load all discoveries for all loaded platformsReturns 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

func (pme *Explorer) NormalizeFQBN(fqbn *fqbn.FQBN) (*fqbn.FQBN,error)

NormalizeFQBN return a normalized copy of the given FQBN, that is the sameFQBN but with the unneeded or invalid options removed.

func (*Explorer)Package

func (pme *Explorer) Package(namestring) *PackageActions

Package looks for the Package with the given name, returning a structureable to perform further operations on that given resource

func (*Explorer)ResolveFQBN

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 theconfiguration part of the fqbn

- the PlatformRelease to be used for the build (if the boardrequires a 3rd party core it may be different from thePlatformRelease 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 arereturned together with the error.

func (*Explorer)RunPreOrPostScript

func (pme *Explorer) RunPreOrPostScript(installDir *paths.Path, prefixstring) ([]byte, []byte,error)

RunPreOrPostScript runs either the post_install.sh (or post_install.bat) or the pre_uninstall.sh (or pre_uninstall.bat)script for the specified platformRelease or toolRelease.

func (*Explorer)UninstallPlatform

func (pme *Explorer) UninstallPlatform(platformRelease *cores.PlatformRelease, taskCBrpc.TaskProgressCB, skipPreUninstallbool)error

UninstallPlatform remove a PlatformRelease.

func (*Explorer)UninstallTool

func (pme *Explorer) UninstallTool(toolRelease *cores.ToolRelease, taskCBrpc.TaskProgressCB, skipPreUninstallbool)error

UninstallTool remove a ToolRelease.

typePackageActions

type PackageActions struct {// contains filtered or unexported fields}

PackageActions defines what actions can be performed on the specific PackageIt serves as a status container for the fluent APIs

func (*PackageActions)Tool

func (pa *PackageActions) Tool(namestring) *ToolActions

Tool looks for the Tool with the given name, returning a structureable to perform further operations on that given resource

typePackageManager

type PackageManager struct {IndexDir    *paths.PathPackagesDir *paths.PathDownloadDir *paths.Path// contains filtered or unexported fields}

PackageManager defines the superior oracle which understands all aboutArduino 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)Destroyadded inv1.3.1

func (pm *PackageManager) Destroy()

Destroy releases all resources held by the PackageManager.

func (*PackageManager)IdentifyBoardConfiguration

func (pm *PackageManager) IdentifyBoardConfiguration(idProps *properties.Map, board *cores.Board) *properties.Map

IdentifyBoardConfiguration returns the configuration of the board that can bededuced 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 configurationof this PackageManager. A "commit" function callback is returned: callingthis function will make the builder write the new configuration into thisPackageManager.

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 lockwhen the Explorer is no more needed.

typePlatformReference

type PlatformReference struct {Packagestring// The package where this Platform belongs to.PlatformArchitecturestringPlatformVersion      *semver.Version}

PlatformReference represents a tuple to identify a Platform

func (*PlatformReference)String

func (platform *PlatformReference) String()string

typeToolActions

type ToolActions struct {// contains filtered or unexported fields}

ToolActions defines what actions can be performed on the specific ToolIt 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

typeToolReleaseActions

type ToolReleaseActions struct {// contains filtered or unexported fields}

ToolReleaseActions defines what actions can be performed on the specific ToolReleaseIt serves as a status container for the fluent APIs

func (*ToolReleaseActions)Get

Get FIXMEDOC

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp