(options []string)
| 115 | } |
| 116 | |
| 117 | func (c custom) Install(options []string) error { |
| 118 | toolchain := c.Ctx.Platform().GetToolchain() |
| 119 | rootfs := c.Ctx.Platform().GetRootFS() |
| 120 | |
| 121 | if len(c.CustomInstall) > 0 { |
| 122 | // msvc and clang-cl need to set build environment event in dev mode. |
| 123 | if (c.DevDep || c.HostDev) && toolchain.GetName() != "msvc" && toolchain.GetName() != "clang-cl" { |
| 124 | toolchain.ClearEnvs() |
| 125 | } else { |
| 126 | toolchain.SetEnvs(rootfs, c.Name(), c.Envs) |
| 127 | } |
| 128 | |
| 129 | scripts := strings.Join(c.CustomInstall, " && ") |
| 130 | scripts = c.expandVariables(scripts) |
| 131 | title := fmt.Sprintf("[install %s]", c.PortConfig.nameVersion()) |
| 132 | executor := cmd.NewExecutor(title, scripts) |
| 133 | executor.SetLogPath(c.getLogPath("install")) |
| 134 | executor.SetWorkDir(expr.If(c.BuildInSource, c.PortConfig.SrcDir, c.PortConfig.BuildDir)) |
| 135 | if err := executor.Execute(); err != nil { |
| 136 | return err |
| 137 | } |
| 138 | } |
| 139 | return nil |
| 140 | } |
nothing calls this directly
no test coverage detected