Skip to content

Commit 3c198fc

Browse files
committed
Adopting ordered properties map (part 2)
1 parent e74320a commit 3c198fc

6 files changed

+13
-13
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ install:
1010
- go get golang.org/x/tools/cmd/cover
1111
- go get github.com/mattn/goveralls
1212
- go get github.com/wadey/gocovmerge
13-
- go get github.com/arduino/go-properties-map
13+
- go get github.com/arduino/go-properties-orderedmap
1414
- go get github.com/arduino/go-timeutils
1515

1616
script:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ To build, run the following commands:
6363
go get github.com/go-errors/errors
6464
go get github.com/stretchr/testify
6565
go get github.com/jstemmer/go-junit-report
66-
go get -u github.com/arduino/go-properties-map
66+
go get -u github.com/arduino/go-properties-orderedmap
6767
go get -u github.com/arduino/go-timeutils
6868
go get google.golang.org/grpc
6969
go get github.com/golang/protobuf/proto

fail_if_imported_library_is_wrong.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (s *FailIfImportedLibraryIsWrong) Run(ctx *types.Context) error {
5151
return i18n.ErrorfWithLogger(logger, constants.MSG_ARCH_FOLDER_NOT_SUPPORTED)
5252
}
5353
for _, propName := range libraries.MandatoryProperties {
54-
if _, ok := library.Properties[propName]; !ok {
54+
if !library.Properties.ContainsKey(propName) {
5555
return i18n.ErrorfWithLogger(logger, constants.MSG_PROP_IN_LIBRARY, propName, library.InstallDir)
5656
}
5757
}

platform_keys_rewrite_loader.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
"github.com/arduino/arduino-builder/constants"
4040
"github.com/arduino/arduino-builder/i18n"
4141
"github.com/arduino/arduino-builder/types"
42-
"github.com/arduino/go-properties-map"
42+
"github.com/arduino/go-properties-orderedmap"
4343
)
4444

4545
type PlatformKeysRewriteLoader struct{}
@@ -73,8 +73,8 @@ func (s *PlatformKeysRewriteLoader) Run(ctx *types.Context) error {
7373
return i18n.WrapError(err)
7474
}
7575
rewriteKey := strings.Join(keyParts[2:], ".")
76-
oldValue := txt[key]
77-
newValue := txt[constants.PLATFORM_REWRITE_NEW+"."+strings.Join(keyParts[1:], ".")]
76+
oldValue := txt.Get(key)
77+
newValue := txt.Get(constants.PLATFORM_REWRITE_NEW + "." + strings.Join(keyParts[1:], "."))
7878
platformKeyRewrite := types.PlatforKeyRewrite{Key: rewriteKey, OldValue: oldValue, NewValue: newValue}
7979
platformKeysRewrite.Rewrites = growSliceOfRewrites(platformKeysRewrite.Rewrites, index)
8080
platformKeysRewrite.Rewrites[index] = platformKeyRewrite

test/helper_tools_downloader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import (
4747
"github.com/arduino/arduino-builder/i18n"
4848
"github.com/arduino/arduino-builder/utils"
4949
"github.com/arduino/go-paths-helper"
50-
"github.com/arduino/go-properties-map"
50+
"github.com/arduino/go-properties-orderedmap"
5151
"github.com/go-errors/errors"
5252
)
5353

wipeout_build_path_if_build_options_changed.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import (
3838
"github.com/arduino/arduino-builder/gohasissues"
3939
"github.com/arduino/arduino-builder/i18n"
4040
"github.com/arduino/arduino-builder/types"
41-
"github.com/arduino/go-properties-map"
41+
"github.com/arduino/go-properties-orderedmap"
4242
)
4343

4444
type WipeoutBuildPathIfBuildOptionsChanged struct{}
@@ -51,15 +51,15 @@ func (s *WipeoutBuildPathIfBuildOptionsChanged) Run(ctx *types.Context) error {
5151
previousBuildOptionsJson := ctx.BuildOptionsJsonPrevious
5252
logger := ctx.GetLogger()
5353

54-
var opts properties.Map
55-
var prevOpts properties.Map
54+
var opts *properties.Map
55+
var prevOpts *properties.Map
5656
json.Unmarshal([]byte(buildOptionsJson), &opts)
5757
json.Unmarshal([]byte(previousBuildOptionsJson), &prevOpts)
5858

5959
// If SketchLocation path is different but filename is the same, consider it equal
60-
if filepath.Base(opts["sketchLocation"]) == filepath.Base(prevOpts["sketchLocation"]) {
61-
delete(opts, "sketchLocation")
62-
delete(prevOpts, "sketchLocation")
60+
if filepath.Base(opts.Get("sketchLocation")) == filepath.Base(prevOpts.Get("sketchLocation")) {
61+
opts.Remove("sketchLocation")
62+
prevOpts.Remove("sketchLocation")
6363
}
6464

6565
// If options are not changed check if core has

0 commit comments

Comments
 (0)