mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
bc735bbe22
- unified makefile project for the whole repos - new separate project for tests
22 lines
746 B
Ruby
22 lines
746 B
Ruby
|
|
|
|
class PreprocessinatorFileHandler
|
|
|
|
constructor :preprocessinator_extractor, :configurator, :tool_executor, :file_path_utils, :file_wrapper
|
|
|
|
|
|
def preprocess_file(filepath, includes)
|
|
preprocessed_filepath = @file_path_utils.form_preprocessed_file_filepath(filepath)
|
|
|
|
command = @tool_executor.build_command_line(@configurator.tools_test_file_preprocessor, filepath, preprocessed_filepath)
|
|
@tool_executor.exec(command[:line], command[:options])
|
|
|
|
contents = @preprocessinator_extractor.extract_base_file_from_preprocessed_expansion(preprocessed_filepath)
|
|
|
|
includes.each{|include| contents.unshift("#include \"#{include}\"")}
|
|
|
|
@file_wrapper.write(preprocessed_filepath, contents.join("\n"))
|
|
end
|
|
|
|
end
|