tree

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 25 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tree provides utility functions to manage the NAOS build tree.

Package tree provides utility functions to manage the NAOS build tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ADFDirectory added in v0.10.0

func ADFDirectory(naosPath string) string

ADFDirectory returns the assumed location of the esp-adf directory.

Note: It will not check if the directory exists.

func AppBinary

func AppBinary(naosPath, appName string) string

AppBinary will return the path to the built app binary.

func AppELF added in v0.13.2

func AppELF(naosPath, appName string) string

AppELF will return the path to the built app ELF file.

func Attach

func Attach(naosPath, port string, noReset bool, out io.Writer, in io.Reader) error

Attach will attach to the specified serial port using the idf.py monitor.

func Build

func Build(naosPath, appName, tagPrefix, target string, overrides map[string]string, files []string, partitions *Partitions, clean, reconfigure, appOnly bool, out io.Writer) error

Build will build the project.

func Bundle added in v0.13.2

func Bundle(naosPath, file string, addDebug bool, out io.Writer) error

func Config added in v0.8.0

func Config(naosPath string, values map[string]string, port, baudRate string, out io.Writer) error

Config will write settings and parameters to an attached device.

func Directory

func Directory(naosPath string) string

Directory returns the assumed location of the build tree directory.

Note: It will not check if the directory exists.

func Exec

func Exec(naosPath string, out io.Writer, in io.Reader, noEnv, usePty bool, name string, arg ...string) error

Exec runs a named command in the build tree. All xtensa toolchain binaries are made available in the path transparently.

func Flash

func Flash(naosPath, port, baudRate string, erase, appOnly, alt bool, out io.Writer) error

Flash will flash the project using the specified serial port.

func Format

func Format(naosPath string, out io.Writer) error

Format will format all source files in the project if 'clang-format' is available.

func IDFDirectory

func IDFDirectory(naosPath string) string

IDFDirectory returns the assumed location of the esp-idf directory.

Note: It will not check if the directory exists.

func IDFMajorVersion added in v0.9.0

func IDFMajorVersion(naosPath string) (int, error)

IDFMajorVersion will detect and return the major IDF version from the specified path.

func IDFVersion added in v0.11.0

func IDFVersion(naosPath string) (string, error)

IDFVersion will detect and return the IDF version from the specified path.

func IncludeDirectories

func IncludeDirectories(naosPath string) ([]string, error)

IncludeDirectories returns a list of directories that will be included in the build process.

func Install

func Install(naosPath, sourcePath, dataPath, version string, force bool, out io.Writer) error

Install will install the NAOS repo to the specified path and link the source path into the build tree.

func InstallAudioFramework added in v0.10.0

func InstallAudioFramework(naosPath, version string, force bool, out io.Writer) error

InstallAudioFramework will manage the esp-adf installation.

func InstallComponent

func InstallComponent(projectPath, naosPath, name, path, repository, version string, force bool, out io.Writer) error

InstallComponent will install the specified component in the build tree.

func InstallRegistryComponents added in v0.12.1

func InstallRegistryComponents(projectPath, naosPath string, components []IDFComponent, force bool, out io.Writer) error

InstallRegistryComponents will install the specified registry components.

func LoadCoredump added in v0.14.3

func LoadCoredump(naosPath, appName, elf, port, baudRate string, out io.Writer) ([]byte, error)

LoadCoredump will read the coredump from the flash of an attached device and return a human-readable representation.

func ParseCoredump

func ParseCoredump(naosPath, appName, elf string, coredump []byte) ([]byte, error)

ParseCoredump will parse the provided raw coredump data and return a human-readable representation.

func PruneComponents added in v0.16.0

func PruneComponents(naosPath string, names []string, out io.Writer) error

PruneComponents will remove all components from the build tree that are not part of the provided list. This is needed as the build system picks up every directory in "components" and would keep compiling removed components.

func ReadConfig added in v0.16.4

func ReadConfig(naosPath, port, baudRate string, out io.Writer) (map[string]string, error)

ReadConfig will read the parameters stored on an attached device.

func SourceAndHeaderFiles

func SourceAndHeaderFiles(naosPath string) ([]string, []string, error)

SourceAndHeaderFiles will return a list of source and header files.

func WriteCMakeLists

func WriteCMakeLists(naosPath string, out io.Writer) error

WriteCMakeLists will write a CMakeLists.txt with all included directories.

func WriteEnvCache added in v0.16.0

func WriteEnvCache(naosPath string) error

WriteEnvCache will source the ESP-IDF export script and cache the resulting environment in the build tree. Sourcing the script takes a few seconds, so the cache is what keeps subsequent commands fast.

Types

type IDFComponent added in v0.12.1

type IDFComponent struct {
	Name       string
	Version    string
	Repository string
	Path       string
}

IDFComponent represents a component in the idf-components.yml file.

type Partitions added in v0.12.1

type Partitions struct {
	Total   int // MiBs
	Alpha   int // %
	Beta    int // %
	Storage int // %
}

Partitions defines a percentage based partitioning scheme.

Jump to

Keyboard shortcuts

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