Skip to content

Commit d175190

Browse files
libraries: expose Dependencies field
1 parent 36a4190 commit d175190

File tree

4 files changed

+106
-88
lines changed

4 files changed

+106
-88
lines changed

internal/arduino/libraries/libraries.go

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ type Library struct {
7878
License string
7979
Properties *properties.Map
8080
Examples paths.PathList
81+
Dependencies []string
8182
declaredHeaders []string
8283
sourceHeaders []string
8384
CompatibleWith map[string]bool
@@ -142,6 +143,7 @@ func (library *Library) ToRPCLibrary() (*rpc.Library, error) {
142143
Examples: library.Examples.AsStrings(),
143144
ProvidesIncludes: headers,
144145
CompatibleWith: library.CompatibleWith,
146+
Dependencies: library.Dependencies,
145147
}, nil
146148
}
147149

internal/arduino/libraries/loader.go

+3
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ func makeNewLibrary(libraryDir *paths.Path, location LibraryLocation) (*Library,
130130
library.LDflags = strings.TrimSpace(libProperties.Get("ldflags"))
131131
library.Properties = libProperties
132132
library.InDevelopment = libraryDir.Join(".development").Exist()
133+
if dependencies := libProperties.Get("depends"); dependencies != "" {
134+
library.Dependencies = strings.Split(strings.TrimSpace(libProperties.Get("depends")), ",")
135+
}
133136
return library, nil
134137
}
135138

rpc/cc/arduino/cli/commands/v1/lib.pb.go

+99-88
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)