MCPcopy Create free account
hub / github.com/celer-pkg/celer / Build

Method Build

buildsystems/build_custom.go:92–115  ·  view source on GitHub ↗
(options []string)

Source from the content-addressed store, hash-verified

90}
91
92func (c custom) Build(options []string) error {
93 toolchain := c.Ctx.Platform().GetToolchain()
94 rootfs := c.Ctx.Platform().GetRootFS()
95
96 if len(c.CustomBuild) > 0 {
97 // msvc and clang-cl need to set build environment event in dev mode.
98 if (c.DevDep || c.HostDev) && toolchain.GetName() != "msvc" && toolchain.GetName() != "clang-cl" {
99 toolchain.ClearEnvs()
100 } else {
101 toolchain.SetEnvs(rootfs, c.Name(), c.Envs)
102 }
103
104 scripts := strings.Join(c.CustomBuild, " && ")
105 scripts = c.expandVariables(scripts)
106 title := fmt.Sprintf("[build %s]", c.PortConfig.nameVersion())
107 executor := cmd.NewExecutor(title, scripts)
108 executor.SetLogPath(c.getLogPath("build"))
109 executor.SetWorkDir(expr.If(c.BuildInSource, c.PortConfig.SrcDir, c.PortConfig.BuildDir))
110 if err := executor.Execute(); err != nil {
111 return err
112 }
113 }
114 return nil
115}
116
117func (c custom) Install(options []string) error {
118 toolchain := c.Ctx.Platform().GetToolchain()

Callers

nothing calls this directly

Calls 15

NameMethod · 0.95
NewExecutorFunction · 0.92
IfFunction · 0.92
expandVariablesMethod · 0.80
SprintfMethod · 0.80
nameVersionMethod · 0.80
SetLogPathMethod · 0.80
SetWorkDirMethod · 0.80
ExecuteMethod · 0.80
GetToolchainMethod · 0.65
PlatformMethod · 0.65
GetRootFSMethod · 0.65

Tested by

no test coverage detected