From 58defaf2f5f4d25429c82aac94364ffe38327435 Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Tue, 23 Mar 2021 10:57:42 +0100 Subject: [PATCH] Fix casing of assembly sketch files --- arduino/builder/sketch.go | 2 +- arduino/globals/globals.go | 4 ++-- arduino/sketch/sketch.go | 2 +- legacy/builder/builder.go | 4 ++-- legacy/builder/create_cmake_rule.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arduino/builder/sketch.go b/arduino/builder/sketch.go index 791d7f0e28b..a1a761f795d 100644 --- a/arduino/builder/sketch.go +++ b/arduino/builder/sketch.go @@ -187,7 +187,7 @@ func SketchLoad(sketchPath, buildPath string) (*sketch.Sketch, error) { } // ignore if file extension doesn't match - ext := strings.ToLower(filepath.Ext(path)) + ext := filepath.Ext(path) _, isMain := globals.MainFileValidExtensions[ext] _, isAdditional := globals.AdditionalFileValidExtensions[ext] if !(isMain || isAdditional) { diff --git a/arduino/globals/globals.go b/arduino/globals/globals.go index b58d00f3e0e..c6281d89cad 100644 --- a/arduino/globals/globals.go +++ b/arduino/globals/globals.go @@ -35,13 +35,13 @@ var ( ".hpp": empty, ".hh": empty, ".cpp": empty, - ".s": empty, + ".S": empty, } // SourceFilesValidExtensions lists valid extensions for source files (no headers) SourceFilesValidExtensions = map[string]struct{}{ ".c": empty, ".cpp": empty, - ".s": empty, + ".S": empty, } ) diff --git a/arduino/sketch/sketch.go b/arduino/sketch/sketch.go index a67e6ad6bb9..9de4fdfd077 100644 --- a/arduino/sketch/sketch.go +++ b/arduino/sketch/sketch.go @@ -99,7 +99,7 @@ func New(sketchFolderPath, mainFilePath, buildPath string, allFilesPaths []strin otherSketchFiles := []*Item{} rootFolderFiles := []*Item{} for p, item := range pathToItem { - ext := strings.ToLower(filepath.Ext(p)) + ext := filepath.Ext(p) if _, found := globals.MainFileValidExtensions[ext]; found { // item is a valid main file, see if it's stored at the // sketch root and ignore if it's not. diff --git a/legacy/builder/builder.go b/legacy/builder/builder.go index 27d93f81ca8..420c459e49b 100644 --- a/legacy/builder/builder.go +++ b/legacy/builder/builder.go @@ -31,8 +31,8 @@ import ( ) var MAIN_FILE_VALID_EXTENSIONS = map[string]bool{".ino": true, ".pde": true} -var ADDITIONAL_FILE_VALID_EXTENSIONS = map[string]bool{".h": true, ".c": true, ".hpp": true, ".hh": true, ".cpp": true, ".s": true} -var ADDITIONAL_FILE_VALID_EXTENSIONS_NO_HEADERS = map[string]bool{".c": true, ".cpp": true, ".s": true} +var ADDITIONAL_FILE_VALID_EXTENSIONS = map[string]bool{".h": true, ".c": true, ".hpp": true, ".hh": true, ".cpp": true, ".S": true} +var ADDITIONAL_FILE_VALID_EXTENSIONS_NO_HEADERS = map[string]bool{".c": true, ".cpp": true, ".S": true} const DEFAULT_DEBUG_LEVEL = 5 const DEFAULT_WARNINGS_LEVEL = "none" diff --git a/legacy/builder/create_cmake_rule.go b/legacy/builder/create_cmake_rule.go index a61bb7c2b62..a976819a790 100644 --- a/legacy/builder/create_cmake_rule.go +++ b/legacy/builder/create_cmake_rule.go @@ -32,7 +32,7 @@ import ( "github.com/arduino/arduino-cli/legacy/builder/utils" ) -var VALID_EXPORT_EXTENSIONS = map[string]bool{".h": true, ".c": true, ".hpp": true, ".hh": true, ".cpp": true, ".s": true, ".a": true, ".properties": true} +var VALID_EXPORT_EXTENSIONS = map[string]bool{".h": true, ".c": true, ".hpp": true, ".hh": true, ".cpp": true, ".S": true, ".a": true, ".properties": true} var DOTHEXTENSION = map[string]bool{".h": true, ".hh": true, ".hpp": true} var DOTAEXTENSION = map[string]bool{".a": true}