From 795d34dc4958533d4c6e0b077978b4e30fd38b4a Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Wed, 24 May 2023 19:11:43 +0800 Subject: [PATCH] Update amalgamate.py --- amalgamate.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/amalgamate.py b/amalgamate.py index cd043024..9512eead 100644 --- a/amalgamate.py +++ b/amalgamate.py @@ -66,10 +66,16 @@ if sys.platform == 'linux': print("amalgamated/pocketpy.h") +content = [] +for i in ["src/export.h", "c_bindings/pocketpy_c.h", "c_bindings/pocketpy_c.cpp"]: + with open(i, "rt", encoding='utf-8') as g: + content.append(g.read()) + with open("amalgamated/pocketpy.cpp", "wt", encoding='utf-8') as f: - for i in ["src/export.h", "c_bindings/pocketpy_c.h", "c_bindings/pocketpy_c.cpp"]: - with open(i, "rt", encoding='utf-8') as g: - f.write(g.read() + '\n\n') + content = '\n\n'.join(content) + content.replace('#include "export.h"', '') + f.write(content) + shutil.copy("amalgamated/pocketpy.h", "plugins/flutter/src/pocketpy.h") shutil.copy("amalgamated/pocketpy.cpp", "plugins/flutter/src/pocketpy.cpp")