Documentation ¶
Index ¶
- Constants
- Variables
- func BazelProcess(c *commandCli.Context) error
- func BladeProcess(c *commandCli.Context) error
- func CMakeProcess(c *commandCli.Context) error
- func DebugPrintf(format string, a ...interface{})
- func GetApp(ct ClientType) *commandCli.App
- func MakeProcess(c *commandCli.Context) error
- func NinjaProcess(c *commandCli.Context) error
- func Run(ct ClientType)
- func SetDebug(debug bool)
- func TransformGccVersion(oldVersion string) string
- type ClientType
- type CompilerType
Constants ¶
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" )
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 ¶
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 = "" )
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") )
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 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 TransformGccVersion ¶
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" )