types

package
v0.0.0-...-20dd7c9 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedUntilNewLineWriter

type BufferedUntilNewLineWriter struct {
	PrintFunc PrintFunc
	Buffer    bytes.Buffer
	// contains filtered or unexported fields
}

func (*BufferedUntilNewLineWriter) Flush

func (w *BufferedUntilNewLineWriter) Flush()

func (*BufferedUntilNewLineWriter) Write

func (w *BufferedUntilNewLineWriter) Write(p []byte) (n int, err error)

type CTag

type CTag struct {
	FunctionName string
	Kind         string
	Line         int
	Code         string
	Class        string
	Struct       string
	Namespace    string
	Filename     string
	Typeref      string
	SkipMe       bool
	Signature    string

	Prototype          string
	PrototypeModifiers string
}

type Command

type Command interface {
	Run(ctx *Context) error
}

type Context

type Context struct {
	// Build options
	HardwareDirs         paths.PathList
	BuiltInToolsDirs     paths.PathList
	BuiltInLibrariesDirs *paths.Path
	OtherLibrariesDirs   paths.PathList
	LibraryDirs          paths.PathList // List of paths pointing to individual library root folders
	SketchLocation       *paths.Path    // SketchLocation points to the main Sketch file
	WatchedLocations     paths.PathList
	ArduinoAPIVersion    string
	FQBN                 *cores.FQBN
	CodeCompleteAt       string
	Clean                bool

	// Build options are serialized here
	BuildOptionsJson         string
	BuildOptionsJsonPrevious string

	PackageManager             *packagemanager.Explorer
	Hardware                   cores.Packages
	AllTools                   []*cores.ToolRelease
	RequiredTools              []*cores.ToolRelease
	TargetBoard                *cores.Board
	TargetBoardBuildProperties *properties.Map
	TargetPackage              *cores.Package
	TargetPlatform             *cores.PlatformRelease
	ActualPlatform             *cores.PlatformRelease
	USBVidPid                  string

	PlatformKeyRewrites    PlatforKeysRewrite
	HardwareRewriteResults map[*cores.PlatformRelease][]PlatforKeyRewrite

	BuildProperties              *properties.Map
	BuildCore                    string
	BuildPath                    *paths.Path
	BuildCachePath               *paths.Path
	SketchBuildPath              *paths.Path
	CoreBuildPath                *paths.Path
	CoreBuildCachePath           *paths.Path
	CoreArchiveFilePath          *paths.Path
	CoreObjectsFiles             paths.PathList
	LibrariesBuildPath           *paths.Path
	LibrariesObjectFiles         paths.PathList
	PreprocPath                  *paths.Path
	SketchObjectFiles            paths.PathList
	IgnoreSketchFolderNameErrors bool

	CollectedSourceFiles *UniqueSourceFileQueue

	Sketch          *sketch.Sketch
	Source          string
	SourceGccMinusE string
	CodeCompletions string

	WarningsLevel string

	// Libraries handling
	LibrariesManager             *librariesmanager.LibrariesManager
	LibrariesResolver            *librariesresolver.Cpp
	ImportedLibraries            libraries.List
	LibrariesResolutionResults   map[string]LibraryResolutionResult
	IncludeFolders               paths.PathList
	UseCachedLibrariesResolution bool

	// C++ Parsing
	CTagsOutput                 string
	CTagsTargetFile             *paths.Path
	CTagsOfPreprocessedSource   []*CTag
	LineOffset                  int
	PrototypesSection           string
	PrototypesLineWhereToInsert int
	Prototypes                  []*Prototype

	// Verbosity settings
	Verbose           bool
	DebugPreprocessor bool

	// Compile optimization settings
	OptimizeForDebug  bool
	OptimizationFlags string

	// Dry run, only create progress map
	Progress ProgressStruct
	// Send progress events to this callback
	ProgressCB rpc.TaskProgressCB

	// Contents of a custom build properties file (line by line)
	CustomBuildProperties []string

	// Reuse old tools since the backing storage didn't change
	CanUseCachedTools bool

	// Experimental: use arduino-preprocessor to create prototypes
	UseArduinoPreprocessor bool

	// Parallel processes
	Jobs int

	// Out and Err stream to redirect all output
	Stdout io.Writer
	Stderr io.Writer

	// Sizer results
	ExecutableSectionsSize ExecutablesFileSections

	// Compilation Database to build/update
	CompilationDatabase *builder.CompilationDatabase
	// Set to true to skip build and produce only Compilation Database
	OnlyUpdateCompilationDatabase bool

	// Source code overrides (filename -> content map).
	// The provided source data is used instead of reading it from disk.
	// The keys of the map are paths relative to sketch folder.
	SourceOverride map[string]string
	// contains filtered or unexported fields
}

Context structure

func (*Context) ExtractBuildOptions

func (ctx *Context) ExtractBuildOptions() *properties.Map

func (*Context) Info

func (ctx *Context) Info(msg string)

func (*Context) InjectBuildOptions

func (ctx *Context) InjectBuildOptions(opts *properties.Map)

func (*Context) PushProgress

func (ctx *Context) PushProgress()

func (*Context) Warn

func (ctx *Context) Warn(msg string)

type ExecutableSectionSize

type ExecutableSectionSize struct {
	Name    string `json:"name"`
	Size    int    `json:"size"`
	MaxSize int    `json:"max_size"`
}

ExecutableSectionSize represents a section of the executable output file

type ExecutablesFileSections

type ExecutablesFileSections []ExecutableSectionSize

ExecutablesFileSections is an array of ExecutablesFileSection

func (ExecutablesFileSections) ToRPCExecutableSectionSizeArray

func (s ExecutablesFileSections) ToRPCExecutableSectionSizeArray() []*rpc.ExecutableSectionSize

ToRPCExecutableSectionSizeArray transforms this array into a []*rpc.ExecutableSectionSize

type LibraryResolutionResult

type LibraryResolutionResult struct {
	Library          *libraries.Library
	NotUsedLibraries []*libraries.Library
}

type PlatforKeyRewrite

type PlatforKeyRewrite struct {
	Key      string
	OldValue string
	NewValue string
}

type PlatforKeysRewrite

type PlatforKeysRewrite struct {
	Rewrites []PlatforKeyRewrite
}

func (*PlatforKeysRewrite) Empty

func (p *PlatforKeysRewrite) Empty() bool

type PrintFunc

type PrintFunc func([]byte)

type ProgressStruct

type ProgressStruct struct {
	Progress   float32
	StepAmount float32
	Parent     *ProgressStruct
}

func (*ProgressStruct) AddSubSteps

func (p *ProgressStruct) AddSubSteps(steps int)

func (*ProgressStruct) CompleteStep

func (p *ProgressStruct) CompleteStep()

func (*ProgressStruct) RemoveSubSteps

func (p *ProgressStruct) RemoveSubSteps()

type Prototype

type Prototype struct {
	FunctionName string
	File         string
	Prototype    string
	Modifiers    string
	Line         int
}

func (*Prototype) String

func (proto *Prototype) String() string

type SketchFile

type SketchFile struct {
	Name *paths.Path
}

type SketchFileSortByName

type SketchFileSortByName []SketchFile

func (SketchFileSortByName) Len

func (s SketchFileSortByName) Len() int

func (SketchFileSortByName) Less

func (s SketchFileSortByName) Less(i, j int) bool

func (SketchFileSortByName) Swap

func (s SketchFileSortByName) Swap(i, j int)

type SourceFile

type SourceFile struct {
	// Sketch or Library pointer that this source file lives in
	Origin interface{}
	// Path to the source file within the sketch/library root folder
	RelativePath *paths.Path
}

func MakeSourceFile

func MakeSourceFile(ctx *Context, origin interface{}, path *paths.Path) (SourceFile, error)

Create a SourceFile containing the given source file path within the given origin. The given path can be absolute, or relative within the origin's root source folder

func (*SourceFile) DepfilePath

func (f *SourceFile) DepfilePath(ctx *Context) *paths.Path

func (*SourceFile) ObjectPath

func (f *SourceFile) ObjectPath(ctx *Context) *paths.Path

func (*SourceFile) SourcePath

func (f *SourceFile) SourcePath(ctx *Context) *paths.Path

type UniqueSourceFileQueue

type UniqueSourceFileQueue []SourceFile

func (*UniqueSourceFileQueue) Empty

func (queue *UniqueSourceFileQueue) Empty() bool

func (UniqueSourceFileQueue) Len

func (queue UniqueSourceFileQueue) Len() int

func (UniqueSourceFileQueue) Less

func (queue UniqueSourceFileQueue) Less(i, j int) bool

func (*UniqueSourceFileQueue) Pop

func (queue *UniqueSourceFileQueue) Pop() SourceFile

func (*UniqueSourceFileQueue) Push

func (queue *UniqueSourceFileQueue) Push(value SourceFile)

func (UniqueSourceFileQueue) Swap

func (queue UniqueSourceFileQueue) Swap(i, j int)

type UniqueStringQueue

type UniqueStringQueue []string

func (*UniqueStringQueue) Empty

func (queue *UniqueStringQueue) Empty() bool

func (UniqueStringQueue) Len

func (queue UniqueStringQueue) Len() int

func (UniqueStringQueue) Less

func (queue UniqueStringQueue) Less(i, j int) bool

func (*UniqueStringQueue) Pop

func (queue *UniqueStringQueue) Pop() interface{}

func (*UniqueStringQueue) Push

func (queue *UniqueStringQueue) Push(value string)

func (UniqueStringQueue) Swap

func (queue UniqueStringQueue) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL