Skip to content

Commit

Permalink
setup: Copy in the built agents
Browse files Browse the repository at this point in the history
So they end up where they should in the sdist. There might be a way to
avoid polluting the source tree, but this will have to do for now.
  • Loading branch information
oleavr committed May 17, 2024
1 parent d7a8792 commit 947fc55
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import shutil
import sys
from pathlib import Path
from typing import Iterator
Expand Down Expand Up @@ -50,7 +51,7 @@ def main():
],
packages=["frida_tools"],
package_data={
"frida_tools": detect_built_agents(),
"frida_tools": copy_in_built_agents(),
},
entry_points={
"console_scripts": [
Expand Down Expand Up @@ -94,13 +95,15 @@ def detect_version() -> str:
return version


def detect_built_agents() -> list[str]:
def copy_in_built_agents() -> list[str]:
agents = []
agents_builddir = SOURCE_ROOT / "build" / "agents"
if agents_builddir.exists():
for child in agents_builddir.iterdir():
if child.is_dir():
agents += [str(f) for f in child.glob("*_agent.js")]
for f in child.glob("*_agent.js"):
shutil.copy(f, SOURCE_ROOT / "frida_tools")
agents.append(f.name)
return agents


Expand Down

0 comments on commit 947fc55

Please sign in to comment.