labels

package
v0.0.0-...-223af15 Latest Latest
Warning

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

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

Documentation

Overview

Package labels has helper functions for conditionally supporting functionality based on the command's labels.

Index

Constants

View Source
const (

	// Compile is a compile action.
	Compile = "compile"
	// Tool is an action that invokes a generic tool.
	Tool = "tool"
	// Link denotes the C++ link action type label.
	Link = "link"
	// Archive denotes the C++ archive action type label.
	Archive = "archive"
	// AbiDump is a header abi dump action.
	AbiDump = "abi-dump"
	// Lint is a code linting action.
	Lint = "lint"
	// APKSigning is an action that's used to digitally sign Android APKs.
	APKSigning = "apksigning"

	// Clang for compiling c/c++.
	Clang = "clang"
	// ClangCL for compiling c/c++ with clang-cl (different flag semantics)
	ClangCL = "clang-cl"
	// NaCl for compiling c/c++ with nacl clang (different flag semantics)
	NaCl = "nacl"
	// Javac for compiling java files.
	Javac = "javac"
	// R8 for compiling class files into dex files with further optimizations.
	R8 = "r8"
	// D8 for compiling class files into dex files.
	D8 = "d8"
	// Metalava for compiling documentation of java source files.
	Metalava = "metalava"
	// HeaderAbiDumper for generating docs for C++.
	HeaderAbiDumper = "header-abi-dumper"
	// ClangTidy for C++ linting.
	ClangTidy = "clang-tidy"
	// SignAPKJAR for signing apk files in Android.
	SignAPKJAR = "signapkjar"
	// TsCompiler for compiling typescript files.
	TsCompiler = "tsc"

	// Cpp indicates the language is c++.
	Cpp = "cpp"
	// Java indicates the language is java.
	Java = "java"
	// Ts indicates the language is typescript.
	Ts = "typescript"

	// ClangTool indicates that the tool being used for this action is clang.
	// This is currently used for link actions, where clang++ is used as a driver
	// to call underlying ld linker.
	ClangTool = "clang"
	// LLVMTool indicates that the tool being used for this action is llvm.
	// This is currently used for archive actions, where llvm-ar is used.
	LLVMTool = "llvm"
)

Variables

This section is empty.

Functions

func ToDigest

func ToDigest(l map[string]string) (string, error)

ToDigest returns a SHA256 of the given labels.

Digest of labels of various action types for quick reference: [compiler=clang,lang=cpp,type=compile]=1c2a12e4 [compiler=clang-cl,lang=cpp,type=compile]=f1d5b747 [tool=clang,type=link]=c8d5e900 [lang=cpp,tool=clang-tidy,type=lint]=ef9b9dea [tool=header-abi-dumper,type=abi-dump]=480a02e7 [compiler=javac,lang=java,type=compile]=2c59b32a [compiler=r8,type=compile]=fc0915a4 [compiler=d8,type=compile]=4be622a4 [compiler=metalava,lang=java,type=compile]=44779548 [compiler=signapkjar,type=apksigning]=c5a25a91 [type=tool]=8ea55c85

func ToKey

func ToKey(labels map[string]string) string

ToKey converts the labels to a flattened string in the form <key1>=<value1>,<key2>=<value2>,...

func ToMap

func ToMap(l Labels) map[string]string

ToMap converts Labels to a map.

Types

type Labels

type Labels struct {
	// ActionType is the type of the action.
	ActionType string
	// Compiler is the compiler used in a compile action.
	Compiler string
	// Lang is the code language.
	Lang string
	// ActionTool refers to a generic tool used for the action.
	ActionTool string
}

Labels encapsulates common labels used to identify actions.

func ClangCLCppLabels

func ClangCLCppLabels() Labels

ClangCLCppLabels is the set of labels identifying a cpp compile with clang-cl.

func ClangCppLabels

func ClangCppLabels() Labels

ClangCppLabels is the set of labels identifying a cpp compile with clang.

func ClangLinkLabels

func ClangLinkLabels() Labels

ClangLinkLabels is the set of labels identifying a cpp link with clang driver.

func ClangLintLabels

func ClangLintLabels() Labels

ClangLintLabels is the set of labels identifying a clang-tidy action.

func D8Labels

func D8Labels() Labels

D8Labels is the set of labels identifying a d8 command.

func FromMap

func FromMap(l map[string]string) Labels

FromMap converts a map of labels to a Labels struct.

func HeaderAbiDumpLabels

func HeaderAbiDumpLabels() Labels

HeaderAbiDumpLabels is the set of labels identifying a header ABI dumper action.

func JavacLabels

func JavacLabels() Labels

JavacLabels is the set of labels identifying a java compile with javac.

func LLVMArLabels

func LLVMArLabels() Labels

LLVMArLabels is the set of labels identifying a cpp archive with llvm driver.

func MetalavaLabels

func MetalavaLabels() Labels

MetalavaLabels is the set of labels identifying a metalava compile.

func NaClLabels

func NaClLabels() Labels

NaClLabels is the set of labels identifying a cpp compile with native client compilers.

func NaClLinkLabels

func NaClLinkLabels() Labels

NaClLinkLabels is the set of labels identifying a cpp link with native client.

func R8Labels

func R8Labels() Labels

R8Labels is the set of labels identifying an r8 command.

func SignAPKLabels

func SignAPKLabels() Labels

SignAPKLabels is the set of labels identifying a signapk command.

func ToolLabels

func ToolLabels() Labels

ToolLabels is the set of labels for running a generic tool.

func TscLabels

func TscLabels() Labels

TscLabels is the set of labels identifying a typescript compile.

Jump to

Keyboard shortcuts

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