aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2024-08-09 14:52:42 -0600
committerNavan Chauhan <navanchauhan@gmail.com>2024-08-09 14:52:42 -0600
commitc736b833f360576bc0c436bb65eebc4ce05b708a (patch)
treec4e5ea08cd717632c7683d491700125809c8814a
parent132f13bb3f1f305126c26949f2be60febdf10bb4 (diff)
script to combine into a single file
-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)