Skip to content

Commit

Permalink
Adding -built-in-libraries command line param: this way built in libr…
Browse files Browse the repository at this point in the history
…aries,

less important than those coming with cores and stored into user's
sketchbook, are correctly prioritized

Signed-off-by: Federico Fissore <f.fissore@arduino.cc>
  • Loading branch information
Federico Fissore committed Oct 29, 2015
1 parent 2058479 commit 7f7eb7a
Show file tree
Hide file tree
Showing 15 changed files with 205 additions and 115 deletions.
12 changes: 11 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const FLAG_DUMP_PREFS = "dump-prefs"
const FLAG_BUILD_OPTIONS_FILE = "build-options-file"
const FLAG_HARDWARE = "hardware"
const FLAG_TOOLS = "tools"
const FLAG_BUILT_IN_LIBRARIES = "built-in-libraries"
const FLAG_LIBRARIES = "libraries"
const FLAG_PREFS = "prefs"
const FLAG_FQBN = "fqbn"
Expand Down Expand Up @@ -100,6 +101,7 @@ var dumpPrefsFlag *bool
var buildOptionsFileFlag *string
var hardwareFoldersFlag slice
var toolsFoldersFlag slice
var librariesBuiltInFoldersFlag slice
var librariesFoldersFlag slice
var customBuildPropertiesFlag slice
var fqbnFlag *string
Expand All @@ -119,6 +121,7 @@ func init() {
buildOptionsFileFlag = flag.String(FLAG_BUILD_OPTIONS_FILE, "", "Instead of specifying --"+FLAG_HARDWARE+", --"+FLAG_TOOLS+" etc every time, you can load all such options from a file")
flag.Var(&hardwareFoldersFlag, FLAG_HARDWARE, "Specify a 'hardware' folder. Can be added multiple times for specifying multiple 'hardware' folders")
flag.Var(&toolsFoldersFlag, FLAG_TOOLS, "Specify a 'tools' folder. Can be added multiple times for specifying multiple 'tools' folders")
flag.Var(&librariesBuiltInFoldersFlag, FLAG_BUILT_IN_LIBRARIES, "Specify a built-in 'libraries' folder. These are low priority libraries. Can be added multiple times for specifying multiple built-in 'libraries' folders")
flag.Var(&librariesFoldersFlag, FLAG_LIBRARIES, "Specify a 'libraries' folder. Can be added multiple times for specifying multiple 'libraries' folders")
flag.Var(&customBuildPropertiesFlag, FLAG_PREFS, "Specify a custom preference. Can be added multiple times for specifying multiple custom preferences")
fqbnFlag = flag.String(FLAG_FQBN, "", "fully qualified board name")
Expand Down Expand Up @@ -195,7 +198,14 @@ func main() {
return
}

err, printStackTrace = setContextSliceKeyOrLoadItFromOptions(context, librariesFoldersFlag, buildOptions, constants.CTX_LIBRARIES_FOLDERS, FLAG_LIBRARIES, false)
err, printStackTrace = setContextSliceKeyOrLoadItFromOptions(context, librariesFoldersFlag, buildOptions, constants.CTX_OTHER_LIBRARIES_FOLDERS, FLAG_LIBRARIES, false)
if err != nil {
printError(err, printStackTrace)
defer os.Exit(1)
return
}

err, printStackTrace = setContextSliceKeyOrLoadItFromOptions(context, librariesBuiltInFoldersFlag, buildOptions, constants.CTX_BUILT_IN_LIBRARIES_FOLDERS, FLAG_BUILT_IN_LIBRARIES, false)
if err != nil {
printError(err, printStackTrace)
defer os.Exit(1)
Expand Down
6 changes: 4 additions & 2 deletions src/arduino.cc/builder/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const CTX_BUILD_OPTIONS_PREVIOUS_JSON = "buildOptionsPreviousJson"
const CTX_BUILD_PATH = "buildPath"
const CTX_BUILD_PROPERTIES = "buildProperties"
const CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION = "runtime.ide.version"
const CTX_BUILT_IN_LIBRARIES_FOLDERS = "builtInLibrariesFolders"
const CTX_COLLECTED_SOURCE_FILES_QUEUE = "collectedSourceFilesQueue"
const CTX_CORE_BUILD_PATH = "coreBuildPath"
const CTX_CTAGS_OUTPUT = "ctagsOutput"
Expand Down Expand Up @@ -108,6 +109,7 @@ const CTX_LINE_OFFSET = "lineOffset"
const CTX_LOGGER = "logger"
const CTX_OBJECT_FILES_LIBRARIES = "objectFilesLibraries"
const CTX_OBJECT_FILES_SKETCH = "objectFilesSketch"
const CTX_OTHER_LIBRARIES_FOLDERS = "otherLibrariesFolders"
const CTX_PLATFORM_KEYS_REWRITE = "platformKeysRewrite"
const CTX_PREPROC_PATH = "preprocPath"
const CTX_PROTOTYPE_SECTION = "prototypeSection"
Expand Down Expand Up @@ -194,8 +196,6 @@ const LIBRARY_SENTENCE = "sentence"
const LIBRARY_URL = "url"
const LIBRARY_VERSION = "version"
const MSG_ARCH_FOLDER_NOT_SUPPORTED = "'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information"
const MSG_WRONG_PROPERTIES_FILE = "Property line '{0}' in file {1} is invalid"
const MSG_WRONG_PROPERTIES = "Property line '{0}' is invalid"
const MSG_BOARD_UNKNOWN = "Board {0} (platform {1}, package {2}) is unknown"
const MSG_BOOTLOADER_FILE_MISSING = "Bootloader file specified but missing: {0}"
const MSG_BUILD_OPTIONS_CHANGED = "Build options changed, rebuilding all"
Expand Down Expand Up @@ -229,6 +229,8 @@ const MSG_WARNING_LIB_INVALID_CATEGORY = "WARNING: Category '{0}' in library {1}
const MSG_WARNING_PLATFORM_MISSING_VALUE = "Warning: platform.txt from core '{0}' misses property '{1}', using default value '{2}'. Consider upgrading this core."
const MSG_WARNING_PLATFORM_OLD_VALUES = "Warning: platform.txt from core '{0}' contains deprecated {1}, automatically converted to {2}. Consider upgrading this core."
const MSG_WARNING_SPURIOUS_FILE_IN_LIB = "WARNING: Spurious {0} folder in '{1}' library"
const MSG_WRONG_PROPERTIES_FILE = "Property line '{0}' in file {1} is invalid"
const MSG_WRONG_PROPERTIES = "Property line '{0}' is invalid"
const PACKAGE_NAME = "name"
const PACKAGE_TOOLS = "tools"
const PLATFORM_ARCHITECTURE = "architecture"
Expand Down
3 changes: 2 additions & 1 deletion src/arduino.cc/builder/create_build_options_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ func (s *CreateBuildOptionsMap) Run(context map[string]interface{}) error {
buildOptionsMapKeys := []string{
constants.CTX_HARDWARE_FOLDERS,
constants.CTX_TOOLS_FOLDERS,
constants.CTX_LIBRARIES_FOLDERS,
constants.CTX_BUILT_IN_LIBRARIES_FOLDERS,
constants.CTX_OTHER_LIBRARIES_FOLDERS,
constants.CTX_FQBN,
constants.CTX_SKETCH_LOCATION,
constants.CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION,
Expand Down
57 changes: 17 additions & 40 deletions src/arduino.cc/builder/includes_to_include_folders.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (s *IncludesToIncludeFolders) Run(context map[string]interface{}) error {
if utils.MapHas(context, constants.CTX_IMPORTED_LIBRARIES) {
importedLibraries = context[constants.CTX_IMPORTED_LIBRARIES].([]*types.Library)
}
newlyImportedLibraries, err := resolveLibraries(includes, headerToLibraries, importedLibraries, []*types.Platform{platform, actualPlatform}, libraryResolutionResults)
newlyImportedLibraries, err := resolveLibraries(includes, headerToLibraries, importedLibraries, []*types.Platform{actualPlatform, platform}, libraryResolutionResults)
if err != nil {
return utils.WrapError(err)
}
Expand Down Expand Up @@ -114,7 +114,7 @@ func resolveLibraries(includes []string, headerToLibraries map[string][]*types.L
}

func resolveLibrary(header string, headerToLibraries map[string][]*types.Library, markImportedLibrary map[*types.Library]bool, platforms []*types.Platform, libraryResolutionResults map[string]types.LibraryResolutionResult) {
libraries := headerToLibraries[header]
libraries := append([]*types.Library{}, headerToLibraries[header]...)

if libraries == nil || len(libraries) == 0 {
return
Expand All @@ -129,17 +129,24 @@ func resolveLibrary(header string, headerToLibraries map[string][]*types.Library
return
}

reverse(libraries)

librariesInPlatforms := librariesInSomePlatform(libraries, platforms)
librariesOutsidePlatforms := filterOutLibrariesFrom(libraries, librariesInPlatforms)

library := findBestLibraryOutsideAnyPlatform(header, librariesOutsidePlatforms, platforms)
var library *types.Library

for _, platform := range platforms {
if platform != nil && library == nil {
library = findBestLibraryWithHeader(header, librariesCompatibleWithPlatform(libraries, platform))
}
}

if library == nil {
library = findBestLibraryInPlatforms(header, librariesInPlatforms, platforms)
library = findBestLibraryWithHeader(header, libraries)
}

if library == nil {
library = libraries[len(libraries)-1]
library = libraries[0]
}

library = useAlreadyImportedLibraryWithSameNameIfExists(library, markImportedLibrary)
Expand All @@ -150,31 +157,11 @@ func resolveLibrary(header string, headerToLibraries map[string][]*types.Library
markImportedLibrary[library] = true
}

func findBestLibraryInPlatforms(header string, librariesInPlatforms []*types.Library, platforms []*types.Platform) *types.Library {
for _, platform := range platforms {
if platform != nil {
librariesWithinSpecifiedPlatform := librariesWithinPlatform(librariesInPlatforms, platform)
library := findBestLibraryWithHeader(header, librariesWithinSpecifiedPlatform)
if library != nil {
return library
}
}
}

return nil
}

func findBestLibraryOutsideAnyPlatform(header string, librariesOutsidePlatforms []*types.Library, platforms []*types.Platform) *types.Library {
for _, platform := range platforms {
if platform != nil {
library := findBestLibraryWithHeader(header, librariesCompatibleWithPlatform(librariesOutsidePlatforms, platform))
if library != nil {
return library
}
}
//facepalm. sort.Reverse needs an Interface that implements Len/Less/Swap. It's a slice! What else for reversing it?!?
func reverse(data []*types.Library) {
for i, j := 0, len(data)-1; i < j; i, j = i+1, j-1 {
data[i], data[j] = data[j], data[i]
}

return findBestLibraryWithHeader(header, librariesOutsidePlatforms)
}

func librariesInSomePlatform(libraries []*types.Library, platforms []*types.Platform) []*types.Library {
Expand Down Expand Up @@ -218,16 +205,6 @@ func filterOutLibraryFrom(libraries []*types.Library, libraryToRemove *types.Lib
return filteredOutLibraries
}

func filterOutLibrariesFrom(libraries []*types.Library, librariesToRemove []*types.Library) []*types.Library {
filteredOutLibraries := []*types.Library{}
for _, lib := range libraries {
if findLibraryIn(librariesToRemove, lib) == nil {
filteredOutLibraries = append(filteredOutLibraries, lib)
}
}
return filteredOutLibraries
}

func findLibraryIn(libraries []*types.Library, library *types.Library) *types.Library {
for _, lib := range libraries {
if lib == library {
Expand Down
41 changes: 22 additions & 19 deletions src/arduino.cc/builder/libraries_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,36 +43,43 @@ import (
type LibrariesLoader struct{}

func (s *LibrariesLoader) Run(context map[string]interface{}) error {
librariesFolders := []string{}
if utils.MapHas(context, constants.CTX_LIBRARIES_FOLDERS) {
librariesFolders = context[constants.CTX_LIBRARIES_FOLDERS].([]string)
}

platform := context[constants.CTX_TARGET_PLATFORM].(*types.Platform)
debugLevel := utils.DebugLevel(context)
logger := context[constants.CTX_LOGGER].(i18n.Logger)
sortedLibrariesFolders := []string{}

librariesFolders, err := utils.AbsolutizePaths(librariesFolders)
builtInLibrariesFolders := []string{}
if utils.MapHas(context, constants.CTX_BUILT_IN_LIBRARIES_FOLDERS) {
builtInLibrariesFolders = context[constants.CTX_BUILT_IN_LIBRARIES_FOLDERS].([]string)
}
builtInLibrariesFolders, err := utils.AbsolutizePaths(builtInLibrariesFolders)
if err != nil {
return utils.WrapError(err)
}
sortedLibrariesFolders = utils.AppendIfNotPresent(sortedLibrariesFolders, builtInLibrariesFolders...)

librariesFolders = prependPathToLibrariesFolders(librariesFolders, filepath.Join(platform.Folder, constants.FOLDER_LIBRARIES))
platform := context[constants.CTX_TARGET_PLATFORM].(*types.Platform)
debugLevel := utils.DebugLevel(context)
logger := context[constants.CTX_LOGGER].(i18n.Logger)

actualPlatform := context[constants.CTX_ACTUAL_PLATFORM].(*types.Platform)
if actualPlatform != platform {
librariesFolders = prependPathToLibrariesFolders(librariesFolders, filepath.Join(actualPlatform.Folder, constants.FOLDER_LIBRARIES))
sortedLibrariesFolders = appendPathToLibrariesFolders(sortedLibrariesFolders, filepath.Join(actualPlatform.Folder, constants.FOLDER_LIBRARIES))
}

sortedLibrariesFolders = appendPathToLibrariesFolders(sortedLibrariesFolders, filepath.Join(platform.Folder, constants.FOLDER_LIBRARIES))

librariesFolders := []string{}
if utils.MapHas(context, constants.CTX_OTHER_LIBRARIES_FOLDERS) {
librariesFolders = context[constants.CTX_OTHER_LIBRARIES_FOLDERS].([]string)
}
librariesFolders, err = utils.AbsolutizePaths(librariesFolders)
if err != nil {
return utils.WrapError(err)
}
sortedLibrariesFolders = utils.AppendIfNotPresent(sortedLibrariesFolders, librariesFolders...)

context[constants.CTX_LIBRARIES_FOLDERS] = librariesFolders
context[constants.CTX_LIBRARIES_FOLDERS] = sortedLibrariesFolders

var libraries []*types.Library
for _, libraryFolder := range librariesFolders {
for _, libraryFolder := range sortedLibrariesFolders {
subFolders, err := utils.ReadDirFiltered(libraryFolder, utils.FilterDirs)
if err != nil {
return utils.WrapError(err)
Expand Down Expand Up @@ -208,14 +215,10 @@ func makeLegacyLibrary(libraryFolder string) (*types.Library, error) {
return library, nil
}

func prependPathToLibrariesFolders(librariesFolders []string, newLibrariesFolder string) []string {
func appendPathToLibrariesFolders(librariesFolders []string, newLibrariesFolder string) []string {
if stat, err := os.Stat(newLibrariesFolder); os.IsNotExist(err) || !stat.IsDir() {
return librariesFolders
}

if utils.SliceContains(librariesFolders, newLibrariesFolder) {
return librariesFolders
}

return append([]string{newLibrariesFolder}, librariesFolders...)
return utils.AppendIfNotPresent(librariesFolders, newLibrariesFolder)
}
24 changes: 16 additions & 8 deletions src/arduino.cc/builder/test/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ func TestBuilderEmptySketch(t *testing.T) {
context[constants.CTX_TOOLS_FOLDERS] = []string{"downloaded_tools"}
context[constants.CTX_FQBN] = "arduino:avr:uno"
context[constants.CTX_SKETCH_LOCATION] = filepath.Join("sketch1", "sketch.ino")
context[constants.CTX_LIBRARIES_FOLDERS] = []string{"libraries", "downloaded_libraries"}
context[constants.CTX_BUILT_IN_LIBRARIES_FOLDERS] = []string{"downloaded_libraries"}
context[constants.CTX_OTHER_LIBRARIES_FOLDERS] = []string{"libraries"}
context[constants.CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION] = "10600"
// context[constants.CTX_VERBOSE] = true
// context[constants.CTX_DEBUG_LEVEL] = 10
Expand Down Expand Up @@ -83,7 +84,8 @@ func TestBuilderBridge(t *testing.T) {
context[constants.CTX_TOOLS_FOLDERS] = []string{"downloaded_tools"}
context[constants.CTX_FQBN] = "arduino:avr:leonardo"
context[constants.CTX_SKETCH_LOCATION] = filepath.Join("downloaded_libraries", "Bridge", "examples", "Bridge", "Bridge.ino")
context[constants.CTX_LIBRARIES_FOLDERS] = []string{"libraries", "downloaded_libraries"}
context[constants.CTX_BUILT_IN_LIBRARIES_FOLDERS] = []string{"downloaded_libraries"}
context[constants.CTX_OTHER_LIBRARIES_FOLDERS] = []string{"libraries"}
context[constants.CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION] = "10600"

command := builder.Builder{}
Expand Down Expand Up @@ -116,7 +118,8 @@ func TestBuilderSketchWithConfig(t *testing.T) {
context[constants.CTX_TOOLS_FOLDERS] = []string{"downloaded_tools"}
context[constants.CTX_FQBN] = "arduino:avr:leonardo"
context[constants.CTX_SKETCH_LOCATION] = filepath.Join("sketch_with_config", "sketch_with_config.ino")
context[constants.CTX_LIBRARIES_FOLDERS] = []string{"libraries", "downloaded_libraries"}
context[constants.CTX_BUILT_IN_LIBRARIES_FOLDERS] = []string{"downloaded_libraries"}
context[constants.CTX_OTHER_LIBRARIES_FOLDERS] = []string{"libraries"}
context[constants.CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION] = "10600"

command := builder.Builder{}
Expand Down Expand Up @@ -149,7 +152,8 @@ func TestBuilderBridgeTwice(t *testing.T) {
context[constants.CTX_TOOLS_FOLDERS] = []string{"downloaded_tools"}
context[constants.CTX_FQBN] = "arduino:avr:leonardo"
context[constants.CTX_SKETCH_LOCATION] = filepath.Join("downloaded_libraries", "Bridge", "examples", "Bridge", "Bridge.ino")
context[constants.CTX_LIBRARIES_FOLDERS] = []string{"libraries", "downloaded_libraries"}
context[constants.CTX_BUILT_IN_LIBRARIES_FOLDERS] = []string{"downloaded_libraries"}
context[constants.CTX_OTHER_LIBRARIES_FOLDERS] = []string{"libraries"}
context[constants.CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION] = "10600"

command := builder.Builder{}
Expand Down Expand Up @@ -186,7 +190,8 @@ func TestBuilderBridgeSAM(t *testing.T) {
context[constants.CTX_TOOLS_FOLDERS] = []string{"downloaded_tools"}
context[constants.CTX_FQBN] = "arduino:sam:arduino_due_x_dbg"
context[constants.CTX_SKETCH_LOCATION] = filepath.Join("downloaded_libraries", "Bridge", "examples", "Bridge", "Bridge.ino")
context[constants.CTX_LIBRARIES_FOLDERS] = []string{"libraries", "downloaded_libraries"}
context[constants.CTX_BUILT_IN_LIBRARIES_FOLDERS] = []string{"downloaded_libraries"}
context[constants.CTX_OTHER_LIBRARIES_FOLDERS] = []string{"libraries"}
context[constants.CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION] = "10600"
context[constants.CTX_WARNINGS_LEVEL] = "all"

Expand Down Expand Up @@ -224,7 +229,8 @@ func TestBuilderBridgeRedBearLab(t *testing.T) {
context[constants.CTX_TOOLS_FOLDERS] = []string{"downloaded_tools", "downloaded_board_manager_stuff"}
context[constants.CTX_FQBN] = "RedBearLab:avr:blend"
context[constants.CTX_SKETCH_LOCATION] = filepath.Join("downloaded_libraries", "Bridge", "examples", "Bridge", "Bridge.ino")
context[constants.CTX_LIBRARIES_FOLDERS] = []string{"libraries", "downloaded_libraries"}
context[constants.CTX_BUILT_IN_LIBRARIES_FOLDERS] = []string{"downloaded_libraries"}
context[constants.CTX_OTHER_LIBRARIES_FOLDERS] = []string{"libraries"}
context[constants.CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION] = "10600"

command := builder.Builder{}
Expand Down Expand Up @@ -257,7 +263,8 @@ func TestBuilderSketchNoFunctions(t *testing.T) {
context[constants.CTX_TOOLS_FOLDERS] = []string{"downloaded_tools", "downloaded_board_manager_stuff"}
context[constants.CTX_FQBN] = "RedBearLab:avr:blend"
context[constants.CTX_SKETCH_LOCATION] = filepath.Join("sketch_no_functions", "main.ino")
context[constants.CTX_LIBRARIES_FOLDERS] = []string{"libraries", "downloaded_libraries"}
context[constants.CTX_BUILT_IN_LIBRARIES_FOLDERS] = []string{"downloaded_libraries"}
context[constants.CTX_OTHER_LIBRARIES_FOLDERS] = []string{"libraries"}
context[constants.CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION] = "10600"

command := builder.Builder{}
Expand All @@ -277,7 +284,8 @@ func TestBuilderSketchWithBackup(t *testing.T) {
context[constants.CTX_TOOLS_FOLDERS] = []string{"downloaded_tools", "downloaded_board_manager_stuff"}
context[constants.CTX_FQBN] = "arduino:avr:uno"
context[constants.CTX_SKETCH_LOCATION] = filepath.Join("sketch_with_backup_files", "sketch.ino")
context[constants.CTX_LIBRARIES_FOLDERS] = []string{"libraries", "downloaded_libraries"}
context[constants.CTX_BUILT_IN_LIBRARIES_FOLDERS] = []string{"downloaded_libraries"}
context[constants.CTX_OTHER_LIBRARIES_FOLDERS] = []string{"libraries"}
context[constants.CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION] = "10600"

command := builder.Builder{}
Expand Down
6 changes: 3 additions & 3 deletions src/arduino.cc/builder/test/create_build_options_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestCreateBuildOptionsMap(t *testing.T) {
context[constants.CTX_BUILD_PATH] = "buildPath"
context[constants.CTX_HARDWARE_FOLDERS] = []string{"hardware", "hardware2"}
context[constants.CTX_TOOLS_FOLDERS] = []string{"tools"}
context[constants.CTX_LIBRARIES_FOLDERS] = []string{"libraries"}
context[constants.CTX_OTHER_LIBRARIES_FOLDERS] = []string{"libraries"}
context[constants.CTX_FQBN] = "fqbn"
context[constants.CTX_SKETCH_LOCATION] = "sketchLocation"
context[constants.CTX_VERBOSE] = true
Expand All @@ -58,15 +58,15 @@ func TestCreateBuildOptionsMap(t *testing.T) {
require.Equal(t, 6, len(utils.KeysOfMapOfString(buildOptions)))
require.Equal(t, "hardware,hardware2", buildOptions[constants.CTX_HARDWARE_FOLDERS])
require.Equal(t, "tools", buildOptions[constants.CTX_TOOLS_FOLDERS])
require.Equal(t, "libraries", buildOptions[constants.CTX_LIBRARIES_FOLDERS])
require.Equal(t, "libraries", buildOptions[constants.CTX_OTHER_LIBRARIES_FOLDERS])
require.Equal(t, "fqbn", buildOptions[constants.CTX_FQBN])
require.Equal(t, "sketchLocation", buildOptions[constants.CTX_SKETCH_LOCATION])
require.Equal(t, "ideVersion", buildOptions[constants.CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION])

require.Equal(t, "{\n"+
" \"fqbn\": \"fqbn\",\n"+
" \"hardwareFolders\": \"hardware,hardware2\",\n"+
" \"librariesFolders\": \"libraries\",\n"+
" \"otherLibrariesFolders\": \"libraries\",\n"+
" \"runtime.ide.version\": \"ideVersion\",\n"+
" \"sketchLocation\": \"sketchLocation\",\n"+
" \"toolsFolders\": \"tools\"\n"+
Expand Down
Loading

0 comments on commit 7f7eb7a

Please sign in to comment.