Skip to content

Commit 732fa1b

Browse files
facchinmcmaglie
authored andcommitted
Add "vendor" field to Tools structure
will map into "packager" field of the json
1 parent 1059719 commit 732fa1b

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

setup_build_properties.go

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error {
9393
for _, tool := range tools {
9494
buildProperties[constants.BUILD_PROPERTIES_RUNTIME_TOOLS_PREFIX+tool.Name+constants.BUILD_PROPERTIES_RUNTIME_TOOLS_SUFFIX] = tool.Folder
9595
buildProperties[constants.BUILD_PROPERTIES_RUNTIME_TOOLS_PREFIX+tool.Name+"-"+tool.Version+constants.BUILD_PROPERTIES_RUNTIME_TOOLS_SUFFIX] = tool.Folder
96+
buildProperties[constants.BUILD_PROPERTIES_RUNTIME_TOOLS_PREFIX+tool.Name+"-"+tool.Vendor+"-"+tool.Version+constants.BUILD_PROPERTIES_RUNTIME_TOOLS_SUFFIX] = tool.Folder
9697
}
9798

9899
if !utils.MapStringStringHas(buildProperties, constants.BUILD_PROPERTIES_SOFTWARE) {

tools_loader.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,10 @@ func loadToolsFrom(tools *[]*types.Tool, builtinToolsVersionsFilePath string) er
146146
if row != constants.EMPTY_STRING {
147147
rowParts := strings.Split(row, "=")
148148
toolName := strings.Split(rowParts[0], ".")[1]
149+
toolVendor := strings.Split(rowParts[0], ".")[0]
149150
toolVersion := rowParts[1]
150151
if !toolsSliceContains(tools, toolName, toolVersion) {
151-
*tools = append(*tools, &types.Tool{Name: toolName, Version: toolVersion, Folder: folder})
152+
*tools = append(*tools, &types.Tool{Name: toolName, Vendor: toolVendor, Version: toolVersion, Folder: folder})
152153
}
153154
}
154155
}
@@ -190,8 +191,9 @@ func loadToolsFromFolderStructure(tools *[]*types.Tool, folder string) error {
190191
if err != nil {
191192
return i18n.WrapError(err)
192193
}
194+
toolVendor := filepath.Base(strings.Replace(folder, filepath.Base(folder), "", -1))
193195
if !toolsSliceContains(tools, toolName.Name(), toolVersion.Name()) {
194-
*tools = append(*tools, &types.Tool{Name: toolName.Name(), Version: toolVersion.Name(), Folder: toolFolder})
196+
*tools = append(*tools, &types.Tool{Name: toolName.Name(), Vendor: toolVendor, Version: toolVersion.Name(), Folder: toolFolder})
195197
}
196198
}
197199
}

types/types.go

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ type Tool struct {
153153
Name string
154154
Version string
155155
Folder string
156+
Vendor string
156157
}
157158

158159
type LibraryLayout uint16

0 commit comments

Comments
 (0)