本文整理汇总了Golang中github.com/laher/goxc/config.Settings.GetTaskSettingStringSlice方法的典型用法代码示例。如果您正苦于以下问题:Golang Settings.GetTaskSettingStringSlice方法的具体用法?Golang Settings.GetTaskSettingStringSlice怎么用?Golang Settings.GetTaskSettingStringSlice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/laher/goxc/config.Settings
的用法示例。
在下文中一共展示了Settings.GetTaskSettingStringSlice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: buildToolchain
// Build toolchain for a given target platform
func buildToolchain(goos string, arch string, settings *config.Settings) error {
goroot := settings.GoRoot
scriptpath := core.GetMakeScriptPath(goroot)
cmd := exec.Command(scriptpath)
cmd.Dir = filepath.Join(goroot, "src")
noClean := settings.GetTaskSettingBool(TASK_BUILD_TOOLCHAIN, "no-clean")
if noClean {
cmd.Args = append(cmd.Args, "--no-clean")
}
//0.8.5: no longer using cgoEnabled
env := []string{"GOOS=" + goos, "GOARCH=" + arch}
extraEnv := settings.GetTaskSettingStringSlice(TASK_BUILD_TOOLCHAIN, "extra-env")
if settings.IsVerbose() {
log.Printf("extra-env: %v", extraEnv)
}
env = append(env, extraEnv...)
if goos == platforms.LINUX && arch == platforms.ARM {
// see http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go
//NOTE: I don't think it has any effect on fp
goarm := settings.GetTaskSettingString(TASK_BUILD_TOOLCHAIN, "GOARM")
if goarm != "" {
env = append(env, "GOARM="+goarm)
}
}
if settings.IsVerbose() {
log.Printf("Setting env: %v", env)
}
cmd.Env = append([]string{}, os.Environ()...)
cmd.Env = append(cmd.Env, env...)
if settings.IsVerbose() {
log.Printf("'make' env: GOOS=%s GOARCH=%s GOROOT=%s", goos, arch, goroot)
log.Printf("Invoking '%v' from %s", executils.PrintableArgs(cmd.Args), cmd.Dir)
}
executils.RedirectIO(cmd)
err := cmd.Start()
if err != nil {
log.Printf("Build toolchain: Launch error: %s", err)
return err
}
err = cmd.Wait()
if err != nil {
log.Printf("Build Toolchain: wait error: %s", err)
return err
}
if settings.IsVerbose() {
log.Printf("Complete")
}
return err
}