File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,29 @@ package lib
1919
2020import  (
2121	"context" 
22+ 	"fmt" 
2223
24+ 	"github.com/arduino/arduino-cli/commands" 
2325	rpc "github.com/arduino/arduino-cli/rpc/commands" 
2426)
2527
2628// LibraryResolveDependencies FIXMEDOC 
2729func  LibraryResolveDependencies (ctx  context.Context , req  * rpc.LibraryResolveDependenciesReq ) (* rpc.LibraryResolveDependenciesResp , error ) {
28- 	return  & rpc.LibraryResolveDependenciesResp {}, nil 
30+ 	lm  :=  commands .GetLibraryManager (req .GetInstance ().GetId ())
31+ 
32+ 	reqLibRelease , err  :=  findLibraryIndexRelease (lm , req )
33+ 	if  err  !=  nil  {
34+ 		return  nil , fmt .Errorf ("looking for library: %s" , err )
35+ 	}
36+ 
37+ 	deps  :=  lm .Index .ResolveDependencies (reqLibRelease )
38+ 
39+ 	res  :=  []* rpc.LibraryReference {}
40+ 	for  _ , dep  :=  range  deps  {
41+ 		res  =  append (res , & rpc.LibraryReference {
42+ 			Name :    dep .GetName (),
43+ 			Version : dep .GetVersion ().String (),
44+ 		})
45+ 	}
46+ 	return  & rpc.LibraryResolveDependenciesResp {Dependencies : res }, nil 
2947}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments