aboutsummaryrefslogtreecommitdiffstats
path: root/lib/apiv1/make.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-18 11:01:13 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-18 11:01:13 +0200
commit2c9ae6a5a27ae2f2e23495c613e7a53aed8e786c (patch)
treeb23dbe9051c50a7ed8f666ae71c833fd52823770 /lib/apiv1/make.go
parent51da3506a296b7d5d4185b17364f188292136888 (diff)
Add Cross SDKs support (part 2)
Diffstat (limited to 'lib/apiv1/make.go')
-rw-r--r--lib/apiv1/make.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/apiv1/make.go b/lib/apiv1/make.go
index 1e6d937..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
}
@@ -138,9 +139,10 @@ func (s *APIService) buildMake(c *gin.Context) {
cmdID := makeCommandID
makeCommandID++
- /* SEB TODO . /opt/poky-agl/3.90.0+snapshot/environment-setup-aarch64-agl-linux
- env := os.Environ()
- */
+ // 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)