Documentation
¶
Index ¶
- func PrepareSketchBuildPath(sketch *sketch.Sketch, sourceOverrides map[string]string, ...) (int, error)
- func SetupBuildProperties(boardBuildProperties *properties.Map, buildPath *paths.Path, ...) *properties.Map
- func SketchSaveItemCpp(path *paths.Path, contents []byte, destPath *paths.Path) error
- type CompilationCommand
- type CompilationDatabase
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
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