X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fcrosssdk%2Fsdk.go;h=5be8954e507b834224f3483d5617be4dbf5123ae;hb=985b32b78da6e5ea008e45f6cf2df140df350ea9;hp=9aeec90de438de7331ad566a3d6a5a139b46b63c;hpb=2c9ae6a5a27ae2f2e23495c613e7a53aed8e786c;p=src%2Fxds%2Fxds-server.git diff --git a/lib/crosssdk/sdk.go b/lib/crosssdk/sdk.go index 9aeec90..5be8954 100644 --- a/lib/crosssdk/sdk.go +++ b/lib/crosssdk/sdk.go @@ -3,6 +3,8 @@ package crosssdk import ( "fmt" "path/filepath" + + uuid "github.com/satori/go.uuid" ) // SDK Define a cross tool chain used to build application @@ -31,8 +33,9 @@ func NewCrossSDK(path string) (*SDK, error) { d = filepath.Dir(d) s.Profile = filepath.Base(d) - s.ID = s.Profile + "_" + s.Arch + "_" + s.Version - s.Name = s.Arch + " (" + s.Version + ")" + // Use V3 to ensure that we get same uuid on restart + s.ID = uuid.NewV3(uuid.FromStringOrNil("sdks"), s.Profile+"_"+s.Arch+"_"+s.Version).String() + s.Name = s.Arch + " (" + s.Version + ")" envFile := filepath.Join(path, "environment-setup*") ef, err := filepath.Glob(envFile) @@ -48,6 +51,6 @@ func NewCrossSDK(path string) (*SDK, error) { } // GetEnvCmd returns the command used to initialized the environment -func (s *SDK) GetEnvCmd() string { - return ". " + s.EnvFile +func (s *SDK) GetEnvCmd() []string { + return []string{"source", s.EnvFile} }