utils

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendUnique

func AppendUnique[T comparable](slice []T, elems ...T) []T

func Contains

func Contains[T comparable](slice []T, elem T) bool

func CreateContext

func CreateContext(contextItem ContextItem) (context string)

func GetDefaultCmsisPackRoot

func GetDefaultCmsisPackRoot() (root string)

func GetExecutablePath

func GetExecutablePath() (string, error)

func GetInstalledExePath

func GetInstalledExePath(exeName string) (path string, err error)

func GetProjectName

func GetProjectName(csolutionFile string) (projectName string, err error)

func IsWildcardPattern

func IsWildcardPattern(str string) bool

func MatchString

func MatchString(str string, pattern string) (bool, error)

func NormalizePath

func NormalizePath(path string) string

func RemoveVersionRange

func RemoveVersionRange(str string) string

func ResolveContexts

func ResolveContexts(allContext []string, contextFilters []string) ([]string, error)

func ToRegEx

func ToRegEx(str string) string

Types

type CSolution

type CSolution struct {
	Solution struct {
		TargetTypes []struct {
			Type string `yaml:"type"`
		} `yaml:"target-types"`
		BuildTypes []struct {
			Type string `yaml:"type"`
		} `yaml:"build-types"`
	} `yaml:"solution"`
}

func ParseCSolutionFile

func ParseCSolutionFile(csolutionFile string) (data CSolution, err error)

type CbuildIndex

type CbuildIndex struct {
	BuildIdx struct {
		GeneratedBy string `yaml:"generated-by"`
		Cdefault    string `yaml:"cdefault"`
		Csolution   string `yaml:"csolution"`
		Cprojects   []struct {
			Cproject string `yaml:"cproject"`
		} `yaml:"cprojects"`
		Licenses interface{} `yaml:"licenses"`
		Cbuilds  []struct {
			Cbuild        string `yaml:"cbuild"`
			Project       string `json:"project"`
			Configuration string `json:"configuration"`
		} `yaml:"cbuilds"`
	} `yaml:"build-idx"`
}

func ParseCbuildIndexFile

func ParseCbuildIndexFile(cbuildIndexFile string) (data CbuildIndex, err error)

type CbuildSet

type CbuildSet struct {
	ContextSet struct {
		GeneratedBy string `yaml:"generated-by"`
		Contexts    []struct {
			Context string `yaml:"context"`
		} `yaml:"contexts"`
		Compiler string `yaml:"compiler"`
	} `yaml:"cbuild-set"`
}

func ParseCbuildSetFile

func ParseCbuildSetFile(cbuildSetFile string) (data CbuildSet, err error)

type Configurations

type Configurations struct {
	BinPath string
	EtcPath string
	BinExtn string
}

func GetInstallConfigs

func GetInstallConfigs() (configs Configurations, err error)

type ContextItem

type ContextItem struct {
	ProjectName string
	BuildType   string
	TargetType  string
}

func ParseContext

func ParseContext(context string) (item ContextItem, err error)

type EnvVars

type EnvVars struct {
	PackRoot     string
	CompilerRoot string
	BuildRoot    string
}

func UpdateEnvVars

func UpdateEnvVars(binPath string, etcPath string) (env EnvVars)

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func (Runner) ExecuteCommand

func (r Runner) ExecuteCommand(program string, quiet bool, args ...string) (string, error)

func (*Runner) Write

func (r *Runner) Write(bytes []byte) (n int, err error)

type RunnerInterface

type RunnerInterface interface {
	ExecuteCommand(program string, quiet bool, args ...string) (output string, err error)
}

Jump to

Keyboard shortcuts

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