builder

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareSketchBuildPath added in v0.0.2

func PrepareSketchBuildPath(sketch *sketch.Sketch, sourceOverrides map[string]string, buildPath *paths.Path) (int, error)

PrepareSketchBuildPath copies the sketch source files in the build path. The .ino files are merged together to create a .cpp file (by the way, the .cpp file still needs to be Arduino-preprocessed to compile).

func SetupBuildProperties added in v0.0.2

func SetupBuildProperties(boardBuildProperties *properties.Map, buildPath *paths.Path, sketch *sketch.Sketch, optimizeForDebug bool) *properties.Map

SetupBuildProperties adds the build properties related to the sketch to the default board build properties map.

func SketchSaveItemCpp added in v0.0.2

func SketchSaveItemCpp(path *paths.Path, contents []byte, destPath *paths.Path) error

SketchSaveItemCpp saves a preprocessed .cpp sketch file on disk

Types

type CompilationCommand added in v0.0.4

type CompilationCommand struct {
	Directory string   `json:"directory"`
	Command   string   `json:"command,omitempty"`
	Arguments []string `json:"arguments,omitempty"`
	File      string   `json:"file"`
}

CompilationCommand keeps track of a single run of a compile command

type CompilationDatabase added in v0.0.4

type CompilationDatabase struct {
	Contents []CompilationCommand
	File     *paths.Path
}

CompilationDatabase keeps track of all the compile commands run by the builder

func LoadCompilationDatabase added in v0.0.4

func LoadCompilationDatabase(file *paths.Path) (*CompilationDatabase, error)

LoadCompilationDatabase reads a compilation database from a file

func NewCompilationDatabase added in v0.0.4

func NewCompilationDatabase(filename *paths.Path) *CompilationDatabase

NewCompilationDatabase creates an empty CompilationDatabase

func (*CompilationDatabase) Add added in v0.0.4

func (db *CompilationDatabase) Add(target *paths.Path, command *exec.Cmd)

Add adds a new CompilationDatabase entry

func (*CompilationDatabase) SaveToFile added in v0.0.4

func (db *CompilationDatabase) SaveToFile()

SaveToFile save the CompilationDatabase to file as a clangd-compatible compile_commands.json, see https://clang.llvm.org/docs/JSONCompilationDatabase.html

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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