(options []string)
| 90 | } |
| 91 | |
| 92 | func (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 | |
| 117 | func (c custom) Install(options []string) error { |
| 118 | toolchain := c.Ctx.Platform().GetToolchain() |
nothing calls this directly
no test coverage detected