Skip to content

Commit ad02827

Browse files
committed
Explicitly report config overrides and their paths
1 parent 0001550 commit ad02827

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
- C++ definitions of `ARDUINO_CI_COMPILATION_MOCKS` and `ARDUINO_CI_GODMODE` to aid in compilation macros
1111
- `CIConfig.available_override_config_path()` to search for available override files in standard locations
1212
- `CIConfig.override_file_from_project_library` and `CIConfig.override_file_from_example` to expose config locations
13+
- CI runner script now expliclty informs about config overrides
1314

1415
### Changed
1516
- `CIConfig` now uses `Pathname` instead of strings

exe/arduino_ci.rb

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ def assured_platform(purpose, name, config)
193193
platform_definition
194194
end
195195

196+
def inform_override(from_where, &block)
197+
inform("Using configuration override from #{from_where}") do
198+
file = block.call()
199+
file.nil? ? "<none>" : file
200+
end
201+
end
202+
196203
# Return true if the file (or one of the dirs containing it) is hidden
197204
def file_is_hidden_somewhere?(path)
198205
# this is clunkly but pre-2.2-ish ruby doesn't return ascend as an enumerator
@@ -493,7 +500,9 @@ def perform_example_compilation_tests(cpp_library, config)
493500
puts
494501
inform("Discovered example sketch") { example_name }
495502

496-
ovr_config = config.from_example(example_path)
503+
inform_override("example") { ex_config.override_file_from_example(example_path) }
504+
ovr_config = ex_config.from_example(example_path)
505+
497506
platforms = choose_platform_set(ovr_config, "library example", ovr_config.platforms_to_build, cpp_library.library_properties)
498507

499508
# having no platforms defined is probably an error
@@ -541,7 +550,10 @@ def perform_example_compilation_tests(cpp_library, config)
541550
inform("Working directory") { Dir.pwd }
542551

543552
# initialize command and config
544-
config = ArduinoCI::CIConfig.default.from_project_library
553+
default_config = ArduinoCI::CIConfig.default
554+
inform_override("project") { default_config.override_file_from_project_library }
555+
config = default_config.from_project_library
556+
545557
@backend = ArduinoCI::ArduinoInstallation.autolocate!
546558
inform("Located arduino-cli binary") { @backend.binary_path.to_s }
547559
if @backend.lib_dir.exist?

0 commit comments

Comments
 (0)