Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 34ff479

Browse files
committed
Dump custom libraries in profiles with --dump-profile command
1 parent 233c310 commit 34ff479

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

‎internal/cli/compile/compile.go‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -323,22 +323,21 @@ func runCompileCommand(cmd *cobra.Command, args []string, srv rpc.ArduinoCoreSer
323323
// Output profile
324324

325325
libs := ""
326-
hasVendoredLibs := false
327326
for _, lib := range builderRes.GetUsedLibraries() {
328327
if lib.GetLocation() != rpc.LibraryLocation_LIBRARY_LOCATION_USER && lib.GetLocation() != rpc.LibraryLocation_LIBRARY_LOCATION_UNMANAGED {
329328
continue
330329
}
331-
if lib.GetVersion() == "" {
332-
hasVendoredLibs = true
333-
continue
330+
if lib.GetVersion() == "" || lib.Location == rpc.LibraryLocation_LIBRARY_LOCATION_UNMANAGED {
331+
libDir := paths.New(lib.GetInstallDir())
332+
if ok, err := libDir.IsInsideDir(sketchPath); err == nil && ok {
333+
if ref, err := libDir.RelFrom(sketchPath); err == nil {
334+
libDir = ref
335+
}
336+
}
337+
libs += fmt.Sprintln(" - dir: " + libDir.String())
338+
} else {
339+
libs += fmt.Sprintln(" - " + lib.GetName() + " (" + lib.GetVersion() + ")")
334340
}
335-
libs += fmt.Sprintln(" - " + lib.GetName() + " (" + lib.GetVersion() + ")")
336-
}
337-
if hasVendoredLibs {
338-
msg := "\n"
339-
msg += i18n.Tr("WARNING: The sketch is compiled using one or more custom libraries.") + "\n"
340-
msg += i18n.Tr("Currently, Build Profiles only support libraries available through Arduino Library Manager.")
341-
feedback.Warning(msg)
342341
}
343342

344343
newProfileName := "my_profile_name"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /