diff --git a/meson.build b/meson.build index 437bb62..b52fc70 100644 --- a/meson.build +++ b/meson.build @@ -84,19 +84,7 @@ frida_core_dep = dependency('frida-core-1.0', default_options: [ pkg_install_dir = get_option('libdir') / 'node_modules' / 'frida' -package_json = custom_target('package.json', - input: 'package.json', - output: 'package.json', - command: [ - python, - files('scripts' / 'adjust-version.py'), - version, - '@INPUT@', - '@OUTPUT@', - ], - install: true, - install_dir: pkg_install_dir, -) +package_json = files('package.json') tsconfig_json = files('tsconfig.json') subdir('src') diff --git a/scripts/adjust-version.py b/src/assets/adjust-version.py similarity index 100% rename from scripts/adjust-version.py rename to src/assets/adjust-version.py diff --git a/src/assets/meson.build b/src/assets/meson.build new file mode 100644 index 0000000..75a49f7 --- /dev/null +++ b/src/assets/meson.build @@ -0,0 +1,13 @@ +adjusted_package_json = custom_target('package.json', + input: package_json, + output: 'package.json', + command: [ + python, + files('adjust-version.py'), + version, + '@INPUT@', + '@OUTPUT@', + ], + install: true, + install_dir: pkg_install_dir, +) diff --git a/src/frida_bindgen/codegen.py b/src/frida_bindgen/codegen.py index 50c720c..7601e5c 100644 --- a/src/frida_bindgen/codegen.py +++ b/src/frida_bindgen/codegen.py @@ -57,7 +57,7 @@ def generate_ts(model: Model) -> str: const binding: FridaBinding = bindings({ bindings: "frida_binding", try: [ - ["module_root", "bindings"], + ["module_root", "build", "bindings"], [process.cwd(), "bindings"], ] });""" diff --git a/src/meson.build b/src/meson.build index d0984f2..cdb831f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,3 +1,5 @@ +subdir('assets') + if frida_core_dep.type_name() == 'internal' frida_core_subprj = subproject('frida-core') frida_gir = frida_core_subprj.get_variable('core_public_gir') @@ -78,7 +80,7 @@ custom_target('js', '@OUTDIR@', '@PRIVATE_DIR@', npm, - package_json, + adjusted_package_json, tsconfig_json, '@INPUT@', ],