// 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
}
return
}
- prj := s.cfg.GetFolderFromID(id)
+ prj := s.mfolder.GetFolderFromID(id)
if prj == nil {
common.APIError(c, "Unknown id")
return
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 {