pkg

package
v0.0.0-...-6ac6f58 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagProjectID     = "project_id"
	FlagBuildID       = "build_id"
	FlagArgs          = "args"
	FlagGccVersion    = "gcc_version"
	FlagCCacheEnabled = "ccache_enabled"
	FlagClang         = "clang"
	FlagDebug         = "debug"
	FlagTest          = "test"
	FlagBazelRcPath   = "bazelrc_path"
	FlagWorkspacePath = "workspace_path"
	FlagCommandPath   = "command_path"
	FlagLimit         = "limit"
	FlagNoLocal       = "no_local"
	FlagSaveCode      = "save_code"
	FlagMaxJobs       = "max_jobs"
	FlagMaxLocalJobs  = "max_local_jobs"
	FlagLocalLimit    = "local_limit"
	FlagLocalLimitCpp = "local_limit_cpp"
	FlagHook          = "hook"

	DistCCHostEnvKey = "DISTCC_HOSTS"
)
View Source
const (
	ClientMakeUsage  = "blueking make client, replaced of make"
	ClientCMakeUsage = "blueking cmake client, replaced of cmake"
	ClientBazelUsage = "blueking bazel client, replaced of bazel"
	ClientBladeUsage = "blueking blade client, replaced of blade"
	ClientNinjaUsage = "blueking ninja client, replaced of ninja"
)

Variables

View Source
var (
	ProdDistCCServerDomain = ""
	ProdDistCCServerPort   = ""
	ProdDistCCServerHost   = fmt.Sprintf("http://%s:%s/api", ProdDistCCServerDomain, ProdDistCCServerPort)

	TestDistCCServerDomain = ""
	TestDistCCServerPort   = ""
	TestDistCCServerHost   = fmt.Sprintf("http://%s:%s/api", TestDistCCServerDomain, TestDistCCServerPort)

	DistCCServerDomain = ""
	DistCCServerHost   = ""
)
View Source
var (
	LocalIP  string
	Debug    bool
	NoLocal  bool
	SaveCode bool

	MaxJobs       int
	MaxLocalJobs  int
	SlotsLimit    = 0
	RunDir        = ""
	LocalLimit    = 0
	LocalLimitCpp = 0

	ErrNoLocal = fmt.Errorf("task degraded to local compiling and exit according to the --no_local flag set")
	ErrCompile = fmt.Errorf("compile error, build exit")
)
View Source
var (
	Connected = true
	Compiler  = CompilerGcc

	TotalWaitServerSecs = 20
	PrintEveryTimes     = 5
	SleepSecsPerWait    = 1
)

Functions

func BazelProcess

func BazelProcess(c *commandCli.Context) error

BazelProcess do the bazel build process: 1. apply resources. 2. keep heartbeat. 3. execute the bazel command when resources are ready. 4. release the resources when cancel or finish.

func BladeProcess

func BladeProcess(c *commandCli.Context) error

BladeProcess do the blade build process: 1. apply resources. 2. keep heartbeat. 3. execute the blade command when resources are ready. 4. release the resources when cancel or finish.

func CMakeProcess

func CMakeProcess(c *commandCli.Context) error

CMakeProcess do cmake process add CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to specify the compiler in CMakeFiles

func DebugPrintf

func DebugPrintf(format string, a ...interface{})

DebugPrintf print logs when DEBUG mode

func GetApp

func GetApp(ct ClientType) *commandCli.App

GetApp return the command handler

func MakeProcess

func MakeProcess(c *commandCli.Context) error

MakeProcess do the make process: 1. apply resources. 2. keep heartbeat. 3. execute the make command when resources are ready. 4. release the resources when cancel or finish.

func NinjaProcess

func NinjaProcess(c *commandCli.Context) error

NinjaProcess do the ninja build process: 1. apply resources. 2. keep heartbeat. 3. execute the ninja command when resources are ready. 4. release the resources when cancel or finish.

func Run

func Run(ct ClientType)

Run run command

func SetDebug

func SetDebug(debug bool)

SetDebug update debug mode settings

func TransformGccVersion

func TransformGccVersion(oldVersion string) string

TransformGccVersion transfer old version to new one(for version checking)

Types

type ClientType

type ClientType string
var (
	ClientMake  ClientType = "bk-make"
	ClientCMake ClientType = "bk-cmake"
	ClientBazel ClientType = "bk-bazel"
	ClientBlade ClientType = "bk-blade"
	ClientNinja ClientType = "bk-ninja"
)

func (ClientType) Name

func (ct ClientType) Name() string

Name return the string name of ClientType

func (ClientType) Usage

func (ct ClientType) Usage() string

Usage return the usage message of ClientType

type CompilerType

type CompilerType string
const (
	CompilerGcc   CompilerType = "gcc"
	CompilerClang CompilerType = "clang"
)

Jump to

Keyboard shortcuts

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