MYNEWT-527; allow build machine OS dependent overrides in bsp.yml.

Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/188d8b60
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/188d8b60
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/188d8b60

Branch: refs/heads/mynewt_1_0_0
Commit: 188d8b6096cd301732176206a1369b2d72c1e7ec
Parents: 65aab9c
Author: Marko Kiiskila <[email protected]>
Authored: Mon Feb 27 21:02:51 2017 -0800
Committer: Marko Kiiskila <[email protected]>
Committed: Mon Mar 6 13:36:31 2017 -0800

----------------------------------------------------------------------
 newt/pkg/bsp_package.go | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/188d8b60/newt/pkg/bsp_package.go
----------------------------------------------------------------------
diff --git a/newt/pkg/bsp_package.go b/newt/pkg/bsp_package.go
index 572255c..146347f 100644
--- a/newt/pkg/bsp_package.go
+++ b/newt/pkg/bsp_package.go
@@ -20,6 +20,7 @@
 package pkg
 
 import (
+       "runtime"
        "strings"
 
        "mynewt.apache.org/newt/newt/flash"
@@ -101,6 +102,13 @@ func (bsp *BspPackage) resolveLinkerScriptSetting(
 func (bsp *BspPackage) Reload(features map[string]bool) error {
        var err error
 
+       if features == nil {
+               features = map[string]bool{
+                       strings.ToUpper(runtime.GOOS): true,
+               }
+       } else {
+               features[strings.ToUpper(runtime.GOOS)] = true
+       }
        bsp.BspV, err = util.ReadConfig(bsp.BasePath(),
                strings.TrimSuffix(BSP_YAML_FILENAME, ".yml"))
        if err != nil {
@@ -131,7 +139,6 @@ func (bsp *BspPackage) Reload(features map[string]bool) 
error {
        if err != nil {
                return err
        }
-
        bsp.DebugScript, err = bsp.resolvePathSetting(
                features, "bsp.debugscript")
        if err != nil {

Reply via email to