From c736b833f360576bc0c436bb65eebc4ce05b708a Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Fri, 9 Aug 2024 14:52:42 -0600 Subject: script to combine into a single file --- combine.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 combine.py diff --git a/combine.py b/combine.py new file mode 100644 index 0000000..afb11bb --- /dev/null +++ b/combine.py @@ -0,0 +1,16 @@ +import glob +import os + +def combine_files(directory, out_file): + with open(out_file, "w") as f: + for file_path in glob.glob(f"{directory}/**/*.swift", recursive=True): + with open(file_path, "r") as infile: + content = infile.read() + content = content.replace("return lv_event_code_t(rawValue: UInt32(self.rawValue))", "return lv_event_code_t(rawValue: UInt16(self.rawValue))") # Stupid patch for Pico + f.write(content.replace("import CLVGL", "")) + f.write("\n\n") + +if __name__ == "__main__": + directory = "Sources/SwiftLVGL" + out_file = "SwiftyLVGL.swift" + combine_files(directory, out_file) -- cgit v1.2.3