Documentation ¶
Index ¶
- func CheckForPdeFiles(sketch *paths.Path) []*paths.Path
- type InvalidSketchFolderNameError
- type Profile
- type ProfileLibraryReference
- type ProfilePlatformReference
- type ProfileRequiredLibraries
- type ProfileRequiredPlatforms
- type Profiles
- type Project
- type Sketch
- func (s *Sketch) DefaultBuildPath() *paths.Path
- func (s *Sketch) GetDefaultFQBN() string
- func (s *Sketch) GetDefaultPortAddressAndProtocol() (string, string)
- func (s *Sketch) GetProfile(profileName string) *Profile
- func (s *Sketch) GetProjectPath() *paths.Path
- func (s *Sketch) Hash() string
- func (s *Sketch) SetDefaultFQBN(fqbn string) error
- func (s *Sketch) SetDefaultPort(address, protocol string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckForPdeFiles ¶
func CheckForPdeFiles(sketch *paths.Path) []*paths.Path
CheckForPdeFiles returns all files ending with .pde extension in sketch, this is mainly used to warn the user that these files must be changed to .ino extension. When .pde files won't be supported anymore this function must be removed.
Types ¶
type InvalidSketchFolderNameError ¶
type InvalidSketchFolderNameError struct { SketchFolder *paths.Path SketchFile *paths.Path }
InvalidSketchFolderNameError is returned when the sketch directory doesn't match the sketch name
func (*InvalidSketchFolderNameError) Error ¶
func (e *InvalidSketchFolderNameError) Error() string
type Profile ¶
type Profile struct { Name string Notes string `yaml:"notes"` FQBN string `yaml:"fqbn"` Platforms ProfileRequiredPlatforms `yaml:"platforms"` Libraries ProfileRequiredLibraries `yaml:"libraries"` }
Profile is a sketch profile, it contains a reference to all the resources needed to build and upload a sketch
type ProfileLibraryReference ¶
ProfileLibraryReference is a reference to a library
func (*ProfileLibraryReference) AsYaml ¶
func (l *ProfileLibraryReference) AsYaml() string
AsYaml outputs the required library as Yaml
func (*ProfileLibraryReference) InternalUniqueIdentifier ¶
func (l *ProfileLibraryReference) InternalUniqueIdentifier() string
InternalUniqueIdentifier returns the unique identifier for this object
func (*ProfileLibraryReference) String ¶
func (l *ProfileLibraryReference) String() string
func (*ProfileLibraryReference) UnmarshalYAML ¶
func (l *ProfileLibraryReference) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML decodes a ProfileLibraryReference from YAML source.
type ProfilePlatformReference ¶
type ProfilePlatformReference struct { Packager string Architecture string Version *semver.Version PlatformIndexURL *url.URL }
ProfilePlatformReference is a reference to a platform
func (*ProfilePlatformReference) AsYaml ¶
func (p *ProfilePlatformReference) AsYaml() string
AsYaml outputs the platform reference as Yaml
func (*ProfilePlatformReference) InternalUniqueIdentifier ¶
func (p *ProfilePlatformReference) InternalUniqueIdentifier() string
InternalUniqueIdentifier returns the unique identifier for this object
func (*ProfilePlatformReference) String ¶
func (p *ProfilePlatformReference) String() string
func (*ProfilePlatformReference) UnmarshalYAML ¶
func (p *ProfilePlatformReference) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML decodes a ProfilePlatformReference from YAML source.
type ProfileRequiredLibraries ¶
type ProfileRequiredLibraries []*ProfileLibraryReference
ProfileRequiredLibraries is a list of ProfileLibraryReference (libraries required to build the sketch using this profile)
func (*ProfileRequiredLibraries) AsYaml ¶
func (p *ProfileRequiredLibraries) AsYaml() string
AsYaml outputs the required libraries as Yaml
type ProfileRequiredPlatforms ¶
type ProfileRequiredPlatforms []*ProfilePlatformReference
ProfileRequiredPlatforms is a list of ProfilePlatformReference (platforms required to build the sketch using this profile)
func (*ProfileRequiredPlatforms) AsYaml ¶
func (p *ProfileRequiredPlatforms) AsYaml() string
AsYaml outputs the required platforms as Yaml
type Profiles ¶ added in v0.0.2
type Profiles []*Profile
Profiles are a list of Profile
func (*Profiles) UnmarshalYAML ¶ added in v0.0.2
UnmarshalYAML decodes a Profiles section from YAML source.
type Project ¶
type Project struct { Profiles Profiles `yaml:"profiles"` DefaultProfile string `yaml:"default_profile"` DefaultFqbn string `yaml:"default_fqbn"` DefaultPort string `yaml:"default_port,omitempty"` DefaultProtocol string `yaml:"default_protocol,omitempty"` }
Project represents the sketch project file
func LoadProjectFile ¶
LoadProjectFile reads a sketch project file
type Sketch ¶
type Sketch struct { Name string MainFile *paths.Path FullPath *paths.Path // FullPath is the path to the Sketch folder OtherSketchFiles paths.PathList // Sketch files that end in .ino other than main file AdditionalFiles paths.PathList RootFolderFiles paths.PathList // All files that are in the Sketch root Project *Project }
Sketch holds all the files composing a sketch
func New ¶
New creates an Sketch instance by reading all the files composing a sketch and grouping them by file type.
func (*Sketch) DefaultBuildPath ¶
func (s *Sketch) DefaultBuildPath() *paths.Path
DefaultBuildPath generates the default build directory for a given sketch. The build path is in a temporary directory and is unique for each sketch.
func (*Sketch) GetDefaultFQBN ¶
GetDefaultFQBN returns the default FQBN for the sketch (from the sketch.yaml project file), or the empty string if not set.
func (*Sketch) GetDefaultPortAddressAndProtocol ¶
GetDefaultPortAddressAndProtocol returns the default port address and port protocol for the sketch (from the sketch.yaml project file), or empty strings if not set.
func (*Sketch) GetProfile ¶
GetProfile returns the requested profile or nil if the profile is not found.
func (*Sketch) GetProjectPath ¶
func (s *Sketch) GetProjectPath() *paths.Path
GetProjectPath returns the path to the sketch project file (sketch.yaml or sketch.yml)
func (*Sketch) SetDefaultFQBN ¶
SetDefaultFQBN sets the default FQBN for the sketch and saves it in the sketch.yaml project file.
func (*Sketch) SetDefaultPort ¶
SetDefaultPort sets the default port address and port protocol for the sketch and saves it in the sketch.yaml project file.