Skip to content

Commit e0b96a9

Browse files
committed
Added GRPC libraryList command
1 parent 08b4f59 commit e0b96a9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

arduino-core/src/cc/arduino/cli/ArduinoCoreInstance.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
import cc.arduino.cli.commands.Common.Instance;
4949
import cc.arduino.cli.commands.Compile.CompileReq;
5050
import cc.arduino.cli.commands.Compile.CompileResp;
51+
import cc.arduino.cli.commands.Lib.InstalledLibrary;
52+
import cc.arduino.cli.commands.Lib.LibraryListReq;
53+
import cc.arduino.cli.commands.Lib.LibraryListResp;
5154
import cc.arduino.cli.commands.Lib.LibrarySearchReq;
5255
import cc.arduino.cli.commands.Lib.LibrarySearchResp;
5356
import cc.arduino.cli.commands.Lib.SearchedLibrary;
@@ -152,6 +155,18 @@ public List<SearchedLibrary> searchLibrary(String query)
152155
}
153156
}
154157

158+
public List<InstalledLibrary> libraryList(boolean listAll) throws StatusException {
159+
try {
160+
LibraryListResp resp = stub.libraryList(LibraryListReq.newBuilder() //
161+
.setInstance(instance) //
162+
.setAll(listAll) //
163+
.build());
164+
return resp.getInstalledLibraryList();
165+
} catch (StatusRuntimeException e) {
166+
throw e.getStatus().asException();
167+
}
168+
}
169+
155170
public List<ContributedLibraryRelease> libraryResolveDependecies(ContributedLibraryRelease lib) {
156171
return new ArrayList<>();
157172
}

0 commit comments

Comments
 (0)