Skip to content

Fix casing of assembly sketch files #1231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arduino/builder/sketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions arduino/globals/globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
)
2 changes: 1 addition & 1 deletion arduino/sketch/sketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions legacy/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion legacy/builder/create_cmake_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down