Skip to content

Commit 4dff788

Browse files
committed
Add "vendor" field to Tools structure
will map into "packager" field of the json
1 parent d1703ea commit 4dff788

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/arduino.cc/builder/setup_build_properties.go

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

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

src/arduino.cc/builder/tools_loader.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,10 @@ func loadToolsFrom(tools *[]*types.Tool, builtinToolsVersionsFilePath string) er
136136
if row != constants.EMPTY_STRING {
137137
rowParts := strings.Split(row, "=")
138138
toolName := strings.Split(rowParts[0], ".")[1]
139+
toolVendor := strings.Split(rowParts[0], ".")[0]
139140
toolVersion := rowParts[1]
140141
if !toolsSliceContains(tools, toolName, toolVersion) {
141-
*tools = append(*tools, &types.Tool{Name: toolName, Version: toolVersion, Folder: folder})
142+
*tools = append(*tools, &types.Tool{Name: toolName, Vendor: toolVendor, Version: toolVersion, Folder: folder})
142143
}
143144
}
144145
}
@@ -180,8 +181,9 @@ func loadToolsFromFolderStructure(tools *[]*types.Tool, folder string) error {
180181
if err != nil {
181182
return i18n.WrapError(err)
182183
}
184+
toolVendor := filepath.Base(strings.Replace(folder, filepath.Base(folder), "", -1))
183185
if !toolsSliceContains(tools, toolName.Name(), toolVersion.Name()) {
184-
*tools = append(*tools, &types.Tool{Name: toolName.Name(), Version: toolVersion.Name(), Folder: toolFolder})
186+
*tools = append(*tools, &types.Tool{Name: toolName.Name(), Vendor: toolVendor, Version: toolVersion.Name(), Folder: toolFolder})
185187
}
186188
}
187189
}

src/arduino.cc/builder/types/types.go

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ type Tool struct {
9292
Name string
9393
Version string
9494
Folder string
95+
Vendor string
9596
}
9697

9798
type LibraryLayout uint16

0 commit comments

Comments
 (0)