X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fapiv1%2Fmake.go;h=fb6435e009f0c2e2716cec2751b1acdfee2a2f22;hb=2c9ae6a5a27ae2f2e23495c613e7a53aed8e786c;hp=9596e1389822ef12eecac0700eea54c6c4e7f50c;hpb=2028752efc680c4c409f6f36bcf88104493d42c4;p=src%2Fxds%2Fxds-server.git diff --git a/lib/apiv1/make.go b/lib/apiv1/make.go index 9596e13..fb6435e 100644 --- a/lib/apiv1/make.go +++ b/lib/apiv1/make.go @@ -14,8 +14,9 @@ import ( // MakeArgs is the parameters (json format) of /make command type MakeArgs struct { ID string `json:"id"` - RPath string `json:"rpath"` // relative path into project - Args string `json:"args"` + RPath string `json:"rpath"` // relative path into project + Args string `json:"args"` // args to pass to make command + SdkID string `json:"sdkid"` // sdk ID to use for setting env CmdTimeout int `json:"timeout"` // command completion timeout in Second } @@ -72,7 +73,7 @@ func (s *APIService) buildMake(c *gin.Context) { return } - prj := s.cfg.GetFolderFromID(id) + prj := s.mfolder.GetFolderFromID(id) if prj == nil { common.APIError(c, "Unknown id") return @@ -138,6 +139,11 @@ func (s *APIService) buildMake(c *gin.Context) { cmdID := makeCommandID makeCommandID++ + // Retrieve env command regarding Sdk ID + if envCmd := s.sdks.GetEnvCmd(args.SdkID, prj.DefaultSdk); envCmd != "" { + cmd = envCmd + " && " + cmd + } + s.log.Debugf("Execute [Cmd ID %d]: %v", cmdID, cmd) err := common.ExecPipeWs(cmd, sop, sess.ID, cmdID, execTmo, s.log, oCB, eCB) if err != nil {