Skip to content

Commit f5ba0ea

Browse files
committed
Copy the whole sketch into tmp folder
See arduino/Arduino#5186 Partially revert #148 Signed-off-by: Cristian Maglie <c.maglie@arduino.cc>
1 parent d0ac261 commit f5ba0ea

File tree

6 files changed

+3
-12
lines changed

6 files changed

+3
-12
lines changed

src/arduino.cc/builder/sketch_loader.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,11 @@ func collectAllSketchFiles(from string) ([]string, error) {
9292
// Source files in the root are compiled, non-recursively. This
9393
// is the only place where .ino files can be present.
9494
rootExtensions := func(ext string) bool { return MAIN_FILE_VALID_EXTENSIONS[ext] || ADDITIONAL_FILE_VALID_EXTENSIONS[ext] }
95-
err := utils.FindFilesInFolder(&filePaths, from, rootExtensions, false /* recurse */)
95+
err := utils.FindFilesInFolder(&filePaths, from, rootExtensions, true /* recurse */)
9696
if err != nil {
9797
return nil, i18n.WrapError(err)
9898
}
9999

100-
// The "src/" subdirectory of a sketch is compiled recursively
101-
// (but .ino files are *not* compiled)
102-
srcPath := filepath.Join(from, constants.SKETCH_FOLDER_SRC)
103-
if info, err := os.Stat(srcPath); err == nil && info.IsDir() {
104-
srcExtensions := func(ext string) bool { return ADDITIONAL_FILE_VALID_EXTENSIONS[ext] }
105-
err = utils.FindFilesInFolder(&filePaths, srcPath, srcExtensions, true /* recurse */)
106-
}
107100
return filePaths, i18n.WrapError(err)
108101
}
109102

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "src/subfolder/other.h"
1+
#include "subfolder/other.h"
22

33
MyClass myClass;
44

@@ -7,4 +7,4 @@ void setup() {
77
}
88

99
void loop() {
10-
}
10+
}

src/arduino.cc/builder/test/sketch_with_subfolders/src/subfolder/dont_load_me.ino

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/arduino.cc/builder/test/sketch_with_subfolders/subfolder/dont_load_me.cpp

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)