9 // SDK Define a cross tool chain used to build application
18 // NewCrossSDK creates a new instance of Syncthing
19 func NewCrossSDK(path string) (*SDK, error) {
20 // Assume that we have .../<profile>/<version>/<arch>
23 s.Arch = filepath.Base(path)
25 d := filepath.Dir(path)
26 s.Version = filepath.Base(d)
29 s.Profile = filepath.Base(d)
31 envFile := filepath.Join(path, "environment-setup*")
32 ef, err := filepath.Glob(envFile)
34 return nil, fmt.Errorf("Cannot retrieve environment setup file: %v", err)
37 return nil, fmt.Errorf("No environment setup file found match %s", envFile)
44 // GetEnvCmd returns the command to initialized the environment to use a cross SDK
45 func (s *SDK) GetEnvCmd() string {
46 return ". " + path.Join(s.Path, s.EnvFile)