mirror of
https://github.com/Z3Prover/z3
synced 2025-06-06 22:23:22 +00:00
Partially refactor the code in `update_api.py
` so that it can
be used as a script for other build systems and is callable via a new ``generate_files()`` function from ``mk_util.py``. This removes the horrible ``_execfile()`` hack that was previously in ``mk_util.py``. Unfortunately lots of bad code is still in ``update_api.py`` but fixing all of its problems is too much work right now.
This commit is contained in:
parent
2b3fe3d02c
commit
db34baa979
2 changed files with 246 additions and 140 deletions
|
@ -2957,7 +2957,28 @@ def mk_bindings(api_files):
|
|||
if is_java_enabled():
|
||||
check_java()
|
||||
mk_z3consts_java(api_files)
|
||||
_execfile(os.path.join('scripts', 'update_api.py'), g) # HACK
|
||||
# Generate some of the bindings and "api" module files
|
||||
import update_api
|
||||
dotnet_output_dir = None
|
||||
if is_dotnet_enabled():
|
||||
dotnet_output_dir = get_component('dotnet').src_dir
|
||||
java_output_dir = None
|
||||
java_package_name = None
|
||||
if is_java_enabled():
|
||||
java_output_dir = get_component('java').src_dir
|
||||
java_package_name = get_component('java').package_name
|
||||
ml_output_dir = None
|
||||
if is_ml_enabled():
|
||||
ml_output_dir = get_component('ml').src_dir
|
||||
# Get the update_api module to do the work for us
|
||||
update_api.generate_files(api_files=new_api_files,
|
||||
api_output_dir=get_component('api').src_dir,
|
||||
z3py_output_dir=get_z3py_dir(),
|
||||
dotnet_output_dir=dotnet_output_dir,
|
||||
java_output_dir=java_output_dir,
|
||||
java_package_name=java_package_name,
|
||||
ml_output_dir=ml_output_dir
|
||||
)
|
||||
cp_z3py_to_build()
|
||||
if is_ml_enabled():
|
||||
check_ml()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue