Created an amalgamation without handlers, and fixed some bugs. (#283)
* Created amalgamation with upb_msg but no handlers.
* Bugfix for upb_array_resize().
* Renamed "lite" amalgamation to "core", to avoid confusion.
Traditionally "lite" has meant "without reflection", but here we
mean it as "without handlers-based code."
* Build fixes from CI tests.
* Removed some more C++-style comments.
* Fix for out-of-order statements.
diff --git a/tools/amalgamate.py b/tools/amalgamate.py
index dff1bc3..b244eff 100755
--- a/tools/amalgamate.py
+++ b/tools/amalgamate.py
@@ -11,14 +11,14 @@
return match.groups()[0] if match else None
class Amalgamator:
- def __init__(self, output_path):
+ def __init__(self, output_path, prefix):
self.include_paths = ["."]
self.included = set(["upb/port_def.inc", "upb/port_undef.inc"])
- self.output_h = open(output_path + "upb.h", "w")
- self.output_c = open(output_path + "upb.c", "w")
+ self.output_h = open(output_path + prefix + "upb.h", "w")
+ self.output_c = open(output_path + prefix + "upb.c", "w")
self.output_c.write("/* Amalgamated source file */\n")
- self.output_c.write('#include "upb.h"\n')
+ self.output_c.write('#include "%supb.h"\n' % (prefix))
self.output_c.write(open("upb/port_def.inc").read())
self.output_h.write("/* Amalgamated source file */\n")
@@ -73,10 +73,11 @@
# ---- main ----
output_path = sys.argv[1]
-amalgamator = Amalgamator(output_path)
+prefix = sys.argv[2]
+amalgamator = Amalgamator(output_path, prefix)
files = []
-for arg in sys.argv[2:]:
+for arg in sys.argv[3:]:
arg = arg.strip()
if arg.startswith("-I"):
amalgamator.add_include_path(arg[2:])