29 lines
1.0 KiB
Go
29 lines
1.0 KiB
Go
package build
|
|
|
|
import (
|
|
"git.novox.be/novox/mesh-delivery/contracts/go/seats/meshcatalog"
|
|
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"
|
|
sdkstep "git.novox.be/novox/mesh-delivery/sdk/buildstep"
|
|
)
|
|
|
|
// CatalogToolchains are the toolchains of a build, by language, as a module's value holds them (the catalog's form names
|
|
// the language in the entry).
|
|
func CatalogToolchains(used map[string]builds.ToolchainUsed) map[string]meshcatalog.ToolchainUsed {
|
|
if used == nil {
|
|
return nil
|
|
}
|
|
out := make(map[string]meshcatalog.ToolchainUsed, len(used))
|
|
for language, t := range used {
|
|
out[language] = meshcatalog.ToolchainUsed{Language: language, Recipe: t.Recipe, Version: t.Version}
|
|
}
|
|
return out
|
|
}
|
|
|
|
// buildToolchain is the toolchain a build ask names for a language (the ask's form names the language in the entry).
|
|
func buildToolchain(language string, t *builds.ToolchainUsed) *sdkstep.ToolchainUsed {
|
|
if t == nil {
|
|
return nil
|
|
}
|
|
return &sdkstep.ToolchainUsed{Language: language, Recipe: t.Recipe, Version: t.Version}
|
|
}
|