From bbfdc0438c101d56690b0ee4dcae21157dd7bde4 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 17 Oct 2023 16:32:34 +0200 Subject: [PATCH] Added 'sketch_path' to build properties (#2372) --- arduino/builder/builder.go | 4 +++- .../integrationtest/compile_3/compile_show_properties_test.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arduino/builder/builder.go b/arduino/builder/builder.go index d3c7f2b73ca..51646bdcf48 100644 --- a/arduino/builder/builder.go +++ b/arduino/builder/builder.go @@ -131,7 +131,9 @@ func NewBuilder( if boardBuildProperties != nil { buildProperties.Merge(boardBuildProperties) } - + if sk != nil { + buildProperties.SetPath("sketch_path", sk.FullPath) + } if buildPath != nil { buildProperties.SetPath("build.path", buildPath) } diff --git a/internal/integrationtest/compile_3/compile_show_properties_test.go b/internal/integrationtest/compile_3/compile_show_properties_test.go index a0dc1321ca3..1c17ef63d47 100644 --- a/internal/integrationtest/compile_3/compile_show_properties_test.go +++ b/internal/integrationtest/compile_3/compile_show_properties_test.go @@ -48,6 +48,7 @@ func TestCompileShowProperties(t *testing.T) { require.NoError(t, err, "Output must be a clean property list") require.Empty(t, stderr) require.True(t, props.ContainsKey("archive_file_path")) + require.True(t, props.ContainsKey("sketch_path")) require.NotContains(t, props.Get("archive_file_path"), "{build.path}") // Test --show-properties --format JSON output is clean