+44
-0
lines changedFilter options
+44
-0
lines changed Original file line number Diff line number Diff line change
@@ -404,6 +404,7 @@ func (s *arduinoCoreServerImpl) Compile(req *rpc.CompileRequest, stream rpc.Ardu
404
404
return &cmderrors.PermissionDeniedError{Message: i18n.Tr("Error reading build directory"), Cause: err}
405
405
}
406
406
buildFiles.FilterPrefix(baseName)
407
+
buildFiles.FilterOutDirs()
407
408
for _, buildFile := range buildFiles {
408
409
exportedFile := exportPath.Join(buildFile.Base())
409
410
logrus.WithField("src", buildFile).WithField("dest", exportedFile).Trace("Copying artifact.")
Original file line number Diff line number Diff line change
@@ -1321,3 +1321,46 @@ func buildWithCustomBuildPathAndOUtputDirFlag(t *testing.T, env *integrationtest
1321
1321
require.NotEmpty(t, content)
1322
1322
}
1323
1323
}
1324
+
1325
+
func TestCompileWithOutputDirFlagIgnoringFoldersCreatedByEsp32RainMakerLib(t *testing.T) {
1326
+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
1327
+
defer env.CleanUp()
1328
+
1329
+
_, _, err := cli.Run("update")
1330
+
require.NoError(t, err)
1331
+
1332
+
// Update index with esp32 core and install it
1333
+
url := "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
1334
+
_, _, err = cli.Run("core", "update-index", "--additional-urls="+url)
1335
+
require.NoError(t, err)
1336
+
_, _, err = cli.Run("core", "install", "esp32:esp32@3.0.7", "--additional-urls="+url)
1337
+
require.NoError(t, err)
1338
+
1339
+
sketchName := "RainMakerSketch"
1340
+
sketchPath := cli.SketchbookDir().Join(sketchName)
1341
+
_, _, err = cli.Run("sketch", "new", sketchPath.String())
1342
+
require.NoError(t, err)
1343
+
1344
+
// When importing the `RMaker` library, the esp32 core produces in output a folder,
1345
+
// containing all the binaries exported. The name of the folder matches the sketch name.
1346
+
// In out case:
1347
+
// cache-dir/
1348
+
// |- RainMakerSketch.ino/ <--- This should be ignored
1349
+
// |- RainMakerSketch.ino.uf2
1350
+
// |- RainMakerSketch.ino.bin
1351
+
// |- ...
1352
+
err = sketchPath.Join(sketchName + ".ino").WriteFile([]byte(`
1353
+
#include "RMaker.h"
1354
+
void setup() { }
1355
+
void loop() { }`,
1356
+
))
1357
+
require.NoError(t, err)
1358
+
1359
+
buildPath := cli.DataDir().Join("test_dir", "build_dir")
1360
+
outputDir := cli.SketchbookDir().Join("test_dir", "output_dir")
1361
+
_, stderr, err := cli.Run("compile", "-b", "esp32:esp32:esp32", sketchPath.String(), "--build-path", buildPath.String(), "--output-dir", outputDir.String())
1362
+
require.NoError(t, err)
1363
+
require.NotContains(t, stderr, []byte("Error during build: Error copying output file"))
1364
+
require.DirExists(t, buildPath.Join(sketchName+".ino").String())
1365
+
require.NoDirExists(t, outputDir.Join(sketchName+".ino").String())
1366
+
}
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4