INNER CODE UNIT · Python
run_gradle_profiler
duckduckgo/Android · build-benchmarks/run-benchmark.py:50
def run_gradle_profiler(repo_root: Path, gradle_user_home: str) -> int:
"""Run gradle-profiler benchmark."""
build_benchmarks_dir = get_build_benchmarks_dir()
scenario_file = build_benchmarks_dir / "build-benchmark.scenarios"
output_dir = build_benchmarks_dir / "results"
# Clean and recreate output directory
if output_dir.exists():
print(f"Cleaning existing results directory: {output_dir}")
shutil.rmtree(output_dir)
output_dir.mkdir(parents=True, exist_ok=True)
# Build the gradle-profiler command
# Use relative paths from repo root
scenario_file_rel = scenario_file.relative_to(repo_root)
output_dir_rel = output_dir.relative_to(repo_root)
cmd = [