Skip to content

Commit 23a0bb4

Browse files
committed
Using new librarymanager functions to load libraries
1 parent 006c22d commit 23a0bb4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

libraries_loader.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,27 @@ func (s *LibrariesLoader) Run(ctx *types.Context) error {
5050
if err := builtInLibrariesFolders.ToAbs(); err != nil {
5151
return i18n.WrapError(err)
5252
}
53-
lm.AddLibrariesDir(libraries.IDEBuiltIn, builtInLibrariesFolders...)
53+
for _, folder := range builtInLibrariesFolders {
54+
lm.AddLibrariesDir(folder, libraries.IDEBuiltIn)
55+
}
5456

5557
debugLevel := ctx.DebugLevel
5658
logger := ctx.GetLogger()
5759

5860
actualPlatform := ctx.ActualPlatform
5961
platform := ctx.TargetPlatform
6062
if actualPlatform != platform {
61-
if dir := actualPlatform.GetLibrariesDir(); dir != nil {
62-
lm.AddLibrariesDir(libraries.ReferencedPlatformBuiltIn, dir)
63-
}
64-
}
65-
if dir := platform.GetLibrariesDir(); dir != nil {
66-
lm.AddLibrariesDir(libraries.PlatformBuiltIn, dir)
63+
lm.AddPlatformReleaseLibrariesDir(actualPlatform, libraries.ReferencedPlatformBuiltIn)
6764
}
65+
lm.AddPlatformReleaseLibrariesDir(platform, libraries.PlatformBuiltIn)
6866

6967
librariesFolders := ctx.OtherLibrariesFolders
7068
if err := librariesFolders.ToAbs(); err != nil {
7169
return i18n.WrapError(err)
7270
}
73-
lm.AddLibrariesDir(libraries.Sketchbook, librariesFolders...)
71+
for _, folder := range librariesFolders {
72+
lm.AddLibrariesDir(folder, libraries.Sketchbook)
73+
}
7474

7575
if err := lm.RescanLibraries(); err != nil {
7676
return i18n.WrapError(err)

0 commit comments

Comments
 (0)