flags

package
v0.0.0-...-26ea352 Latest Latest
Warning

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

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

Documentation

Overview

Package flags provides structs for holding information about an action's command flags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandFlags

type CommandFlags struct {
	// ExecutablePath is the path to the executable used to run the build action.
	ExecutablePath string

	// TargetFilePaths is a list of filepaths on which the build action is supposed
	// to work. The paths are as seen in the command.
	// For example, for a C++ compile action, this would be the list of C++ files
	// being compiled.
	TargetFilePaths []string

	// Dependencies is a list of dependencies that are inferred from the command.
	Dependencies []string

	// EmittedDependencyFile is a file emitted by the action that lists all
	// dependencies required to execute the action.
	EmittedDependencyFile string

	// OutputFilePaths is a list of filepaths produced by the command as outputs.
	OutputFilePaths []string

	// OutputDirPaths is a list of directory paths indicated by the command as output
	// directory paths.
	OutputDirPaths []string

	// IncludeDirPaths is a list of directory paths where include files will be looked
	// for by the C++ compiler. The field is only relevant for C++ actions.
	IncludeDirPaths []string

	// VirtualDirectories is a list of directories that should exist for the correct
	// execution of the action.
	VirtualDirectories []string

	// WorkingDirectory is the directory inside which the build action must be run.
	WorkingDirectory string

	// ExecRoot is the execution root of the build action.
	ExecRoot string

	// Flags is the list of in-memory flag objects associated with the build action.
	Flags []*Flag
}

CommandFlags is the in-memory representation of all the flags associated with the commandline invocation of an action. It also stores certain key information associated with the build command, like the executable being invoked.

func (*CommandFlags) Copy

func (c *CommandFlags) Copy() *CommandFlags

Copy creates a deep copy of CommandFlags.

type Flag

type Flag struct {
	Key   string
	Value string
	// If true, key and value should be joined together to form a command line argument
	// (e.g -I/include/path or --sysroot=/path)
	Joined bool
	// contains filtered or unexported fields
}

Flag is the in-memory representation of a specific flag associated with the command-line invocation of an action.

func New

func New(key, originalKey, value string, joined bool) *Flag

New returns a new instance of Flag

func (*Flag) OriginalKey

func (f *Flag) OriginalKey() string

OriginalKey returns value original (unnormalized) key that was passed to New function when instantianting the Flag if it's not set, it returns Key

Jump to

Keyboard shortcuts

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