aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--combine.py16
1 files changed, 16 insertions, 0 deletions
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)