Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
b8b3b790
Commit
b8b3b790
authored
Jul 16, 2018
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed librariesmanager.StatusContext -> librariesmanager.LibrariesManager
parent
1b766d80
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
12 deletions
+12
-12
Gopkg.lock
Gopkg.lock
+1
-1
arduino/libraries/librariesmanager/librariesmanager.go
arduino/libraries/librariesmanager/librariesmanager.go
+7
-7
commands/lib/download.go
commands/lib/download.go
+1
-1
commands/lib/install.go
commands/lib/install.go
+1
-1
commands/lib/lib.go
commands/lib/lib.go
+1
-1
vendor/github.com/arduino/arduino-builder/types/context.go
vendor/github.com/arduino/arduino-builder/types/context.go
+1
-1
No files found.
Gopkg.lock
View file @
b8b3b790
...
...
@@ -15,7 +15,7 @@
"types",
"utils"
]
revision = "
e82d0725fbee6f1528426949202902d0c7aa74e5
"
revision = "
fd8b7dcea92845ba26eb0252aae29ccaef635a4e
"
source = "github.com/bcmi-labs/arduino-builder"
[[projects]]
...
...
arduino/libraries/librariesmanager/librariesmanager.go
View file @
b8b3b790
...
...
@@ -39,9 +39,9 @@ import (
"github.com/pmylund/sortutil"
)
//
StatusContext
keeps the current status of the libraries in the system
//
LibrariesManager
keeps the current status of the libraries in the system
// (the list of libraries, revisions, installed paths, etc.)
type
StatusContext
struct
{
type
LibrariesManager
struct
{
Libraries
map
[
string
]
*
LibraryAlternatives
`json:"libraries"`
Index
*
librariesindex
.
Index
}
...
...
@@ -67,7 +67,7 @@ func (alts *LibraryAlternatives) Select() *libraries.Library {
}
// Names returns an array with all the names of the installed libraries.
func
(
sc
StatusContext
)
Names
()
[]
string
{
func
(
sc
LibrariesManager
)
Names
()
[]
string
{
res
:=
make
([]
string
,
len
(
sc
.
Libraries
))
i
:=
0
for
n
:=
range
sc
.
Libraries
{
...
...
@@ -79,22 +79,22 @@ func (sc StatusContext) Names() []string {
}
// NewLibraryManager creates a new library manager
func
NewLibraryManager
()
*
StatusContext
{
return
&
StatusContext
{
func
NewLibraryManager
()
*
LibrariesManager
{
return
&
LibrariesManager
{
Libraries
:
map
[
string
]
*
LibraryAlternatives
{},
}
}
// LoadIndex reads a library_index.json from a file and returns
// the corresponding Index structure.
func
(
sc
*
StatusContext
)
LoadIndex
()
error
{
func
(
sc
*
LibrariesManager
)
LoadIndex
()
error
{
index
,
err
:=
librariesindex
.
LoadIndex
(
IndexPath
())
sc
.
Index
=
index
return
err
}
// LoadLibrariesFromDir loads all libraries in the given folder
func
(
sc
*
StatusContext
)
LoadLibrariesFromDir
(
librariesDir
*
paths
.
Path
)
error
{
func
(
sc
*
LibrariesManager
)
LoadLibrariesFromDir
(
librariesDir
*
LibrariesDir
)
error
{
subFolders
,
err
:=
librariesDir
.
ReadDir
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"reading dir %s: %s"
,
librariesDir
,
err
)
...
...
commands/lib/download.go
View file @
b8b3b790
...
...
@@ -64,7 +64,7 @@ func runDownloadCommand(cmd *cobra.Command, args []string) {
downloadLibraries
(
lm
,
pairs
)
}
func
downloadLibraries
(
lm
*
librariesmanager
.
StatusContext
,
refs
[]
*
librariesindex
.
Reference
)
{
func
downloadLibraries
(
lm
*
librariesmanager
.
LibrariesManager
,
refs
[]
*
librariesindex
.
Reference
)
{
libsReleaseToDownload
:=
[]
*
librariesindex
.
Release
{}
for
_
,
ref
:=
range
refs
{
if
lib
:=
lm
.
Index
.
FindRelease
(
ref
);
lib
==
nil
{
...
...
commands/lib/install.go
View file @
b8b3b790
...
...
@@ -66,7 +66,7 @@ func runInstallCommand(cmd *cobra.Command, args []string) {
installLibraries
(
lm
,
refs
)
}
func
installLibraries
(
lm
*
librariesmanager
.
StatusContext
,
refs
[]
*
librariesindex
.
Reference
)
{
func
installLibraries
(
lm
*
librariesmanager
.
LibrariesManager
,
refs
[]
*
librariesindex
.
Reference
)
{
libReleasesToInstall
:=
[]
*
librariesindex
.
Release
{}
for
_
,
ref
:=
range
refs
{
rel
:=
lm
.
Index
.
FindRelease
(
ref
)
...
...
commands/lib/lib.go
View file @
b8b3b790
...
...
@@ -76,7 +76,7 @@ func resultFromFileName(file os.FileInfo, libs *output.LibProcessResults) {
}
}
func
getLibraryManager
()
*
librariesmanager
.
StatusContext
{
func
getLibraryManager
()
*
librariesmanager
.
LibrariesManager
{
logrus
.
Info
(
"Starting libraries manager"
)
lm
:=
librariesmanager
.
NewLibraryManager
()
if
err
:=
lm
.
LoadIndex
();
err
!=
nil
{
...
...
vendor/github.com/arduino/arduino-builder/types/context.go
View file @
b8b3b790
...
...
@@ -75,7 +75,7 @@ type Context struct {
WarningsLevel
string
// Libraries handling
LibrariesManager
*
librariesmanager
.
StatusContext
LibrariesManager
*
librariesmanager
.
LibrariesManager
HeaderToLibraries
map
[
string
][]
*
libraries
.
Library
ImportedLibraries
[]
*
libraries
.
Library
LibrariesResolutionResults
map
[
string
]
LibraryResolutionResult
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment