@@ -44,6 +44,7 @@ import (
4444 "github.com/arduino/arduino-app-cli/internal/helpers"
4545 "github.com/arduino/arduino-app-cli/internal/micro"
4646 "github.com/arduino/arduino-app-cli/internal/orchestrator/app"
47+ appspecification "github.com/arduino/arduino-app-cli/internal/orchestrator/app"
4748 appgenerator "github.com/arduino/arduino-app-cli/internal/orchestrator/app/generator"
4849 "github.com/arduino/arduino-app-cli/internal/orchestrator/bricksindex"
4950 "github.com/arduino/arduino-app-cli/internal/orchestrator/config"
@@ -114,15 +115,15 @@ func StartApp(
114115 provisioner * Provision ,
115116 modelsIndex * modelsindex.ModelsIndex ,
116117 bricksIndex * bricksindex.BricksIndex ,
117- app app .ArduinoApp ,
118+ app appspecification .ArduinoApp ,
118119 cfg config.Configuration ,
119120 staticStore * store.StaticStore ,
120121) iter.Seq [StreamMessage ] {
121122 return func (yield func (StreamMessage ) bool ) {
122123 ctx , cancel := context .WithCancel (ctx )
123124 defer cancel ()
124125
125- err := app . Descriptor . ValidateBricks (bricksIndex )
126+ err := appspecification . ValidateBricks (app . Descriptor , bricksIndex )
126127 if err != nil {
127128 yield (StreamMessage {error : err })
128129 return
@@ -255,7 +256,7 @@ func StartApp(
255256// - model configuration variables (variables defined in the model configuration)
256257// - brick instance variables (variables defined in the app.yaml for the brick instance)
257258// In addition, it adds some useful environment variables like APP_HOME and HOST_IP.
258- func getAppEnvironmentVariables (app app .ArduinoApp , brickIndex * bricksindex.BricksIndex , modelsIndex * modelsindex.ModelsIndex ) helpers.EnvVars {
259+ func getAppEnvironmentVariables (app appspecification .ArduinoApp , brickIndex * bricksindex.BricksIndex , modelsIndex * modelsindex.ModelsIndex ) helpers.EnvVars {
259260 envs := make (helpers.EnvVars )
260261
261262 for _ , brick := range app .Descriptor .Bricks {
@@ -383,7 +384,7 @@ func getVideoDevices() map[int]string {
383384 return deviceMap
384385}
385386
386- func stopAppWithCmd (ctx context.Context , app app .ArduinoApp , cmd string ) iter.Seq [StreamMessage ] {
387+ func stopAppWithCmd (ctx context.Context , app appspecification .ArduinoApp , cmd string ) iter.Seq [StreamMessage ] {
387388 return func (yield func (StreamMessage ) bool ) {
388389 ctx , cancel := context .WithCancel (ctx )
389390 defer cancel ()
@@ -431,11 +432,11 @@ func stopAppWithCmd(ctx context.Context, app app.ArduinoApp, cmd string) iter.Se
431432 }
432433}
433434
434- func StopApp (ctx context.Context , app app .ArduinoApp ) iter.Seq [StreamMessage ] {
435+ func StopApp (ctx context.Context , app appspecification .ArduinoApp ) iter.Seq [StreamMessage ] {
435436 return stopAppWithCmd (ctx , app , "stop" )
436437}
437438
438- func StopAndDestroyApp (ctx context.Context , app app .ArduinoApp ) iter.Seq [StreamMessage ] {
439+ func StopAndDestroyApp (ctx context.Context , app appspecification .ArduinoApp ) iter.Seq [StreamMessage ] {
439440 return stopAppWithCmd (ctx , app , "down" )
440441}
441442
@@ -445,15 +446,15 @@ func RestartApp(
445446 provisioner * Provision ,
446447 modelsIndex * modelsindex.ModelsIndex ,
447448 bricksIndex * bricksindex.BricksIndex ,
448- appToStart app .ArduinoApp ,
449+ appToStart appspecification .ArduinoApp ,
449450 cfg config.Configuration ,
450451 staticStore * store.StaticStore ,
451452) iter.Seq [StreamMessage ] {
452453 return func (yield func (StreamMessage ) bool ) {
453454 ctx , cancel := context .WithCancel (ctx )
454455 defer cancel ()
455456
456- err := appToStart . Descriptor . ValidateBricks (bricksIndex )
457+ err := appspecification . ValidateBricks (appToStart . Descriptor , bricksIndex )
457458 if err != nil {
458459 yield (StreamMessage {error : err })
459460 return
@@ -677,7 +678,7 @@ type AppDetailedBrick struct {
677678func AppDetails (
678679 ctx context.Context ,
679680 docker command.Cli ,
680- userApp app .ArduinoApp ,
681+ userApp appspecification .ArduinoApp ,
681682 bricksIndex * bricksindex.BricksIndex ,
682683 idProvider * app.IDProvider ,
683684 cfg config.Configuration ,
@@ -901,7 +902,7 @@ func CloneApp(
901902 return CloneAppResponse {ID : id }, nil
902903}
903904
904- func DeleteApp (ctx context.Context , app app .ArduinoApp ) error {
905+ func DeleteApp (ctx context.Context , app appspecification .ArduinoApp ) error {
905906 for msg := range StopApp (ctx , app ) {
906907 if msg .error != nil {
907908 return fmt .Errorf ("failed to stop app: %w" , msg .error )
@@ -912,7 +913,7 @@ func DeleteApp(ctx context.Context, app app.ArduinoApp) error {
912913
913914const defaultAppFileName = "default.app"
914915
915- func SetDefaultApp (app * app .ArduinoApp , cfg config.Configuration ) error {
916+ func SetDefaultApp (app * appspecification .ArduinoApp , cfg config.Configuration ) error {
916917 defaultAppPath := cfg .DataDir ().Join (defaultAppFileName )
917918
918919 // Remove the default app file if the app is nil.
@@ -927,7 +928,7 @@ func SetDefaultApp(app *app.ArduinoApp, cfg config.Configuration) error {
927928 return fatomic .WriteFile (defaultAppPath .String (), []byte (app .FullPath .String ()), os .FileMode (0644 ))
928929}
929930
930- func GetDefaultApp (cfg config.Configuration ) (* app .ArduinoApp , error ) {
931+ func GetDefaultApp (cfg config.Configuration ) (* appspecification .ArduinoApp , error ) {
931932 defaultAppFilePath := cfg .DataDir ().Join (defaultAppFileName )
932933 if ! defaultAppFilePath .Exist () {
933934 return nil , nil
@@ -965,7 +966,7 @@ type AppEditRequest struct {
965966
966967func EditApp (
967968 req AppEditRequest ,
968- editApp * app .ArduinoApp ,
969+ editApp * appspecification .ArduinoApp ,
969970 cfg config.Configuration ,
970971) (editErr error ) {
971972 if req .Default != nil {
@@ -1005,7 +1006,7 @@ func EditApp(
10051006 return nil
10061007}
10071008
1008- func editAppDefaults (userApp * app .ArduinoApp , isDefault bool , cfg config.Configuration ) error {
1009+ func editAppDefaults (userApp * appspecification .ArduinoApp , isDefault bool , cfg config.Configuration ) error {
10091010 if isDefault {
10101011 if err := SetDefaultApp (userApp , cfg ); err != nil {
10111012 return fmt .Errorf ("failed to set default app: %w" , err )
@@ -1134,7 +1135,7 @@ func addLedControl(volumes []volume) []volume {
11341135
11351136func compileUploadSketch (
11361137 ctx context.Context ,
1137- arduinoApp * app .ArduinoApp ,
1138+ arduinoApp * appspecification .ArduinoApp ,
11381139 w io.Writer ,
11391140) error {
11401141 logrus .SetLevel (logrus .ErrorLevel ) // Reduce the log level of arduino-cli
0 commit comments