|
7 | 7 | import sh |
8 | 8 | import shlex |
9 | 9 | import shutil |
10 | | -from pathlib import Path |
11 | 10 |
|
12 | 11 | from pythonforandroid.logger import (shprint, info, info_main, logger, debug) |
13 | 12 | from pythonforandroid.util import ( |
@@ -41,36 +40,6 @@ def copy_files(src_root, dest_root, override=True, symlink=False): |
41 | 40 | os.makedirs(dest_file) |
42 | 41 |
|
43 | 42 |
|
44 | | -def copytree_filtered(src, dst, skip_dirs=None): |
45 | | - """ |
46 | | - Copy directory tree while skipping explicitly specified directories in src. |
47 | | - """ |
48 | | - |
49 | | - info(f"Copying {src} to {dst} with skip dirs: {skip_dirs}") |
50 | | - |
51 | | - src = Path(src) |
52 | | - dst = Path(dst) |
53 | | - skip_dirs = set(Path(p) for p in (skip_dirs or [])) |
54 | | - |
55 | | - def should_skip(rel_path): |
56 | | - # match exact directory path only |
57 | | - return any(rel_path == skip or skip in rel_path.parents for skip in skip_dirs) |
58 | | - |
59 | | - for item in src.rglob("*"): |
60 | | - rel = item.relative_to(src) |
61 | | - |
62 | | - if should_skip(rel): |
63 | | - continue |
64 | | - |
65 | | - target = dst / rel |
66 | | - |
67 | | - if item.is_dir(): |
68 | | - target.mkdir(parents=True, exist_ok=True) |
69 | | - else: |
70 | | - target.parent.mkdir(parents=True, exist_ok=True) |
71 | | - shutil.copy2(item, target) |
72 | | - |
73 | | - |
74 | 43 | default_recipe_priorities = [ |
75 | 44 | "webview", "sdl2", "sdl3", "service_only" # last is highest |
76 | 45 | ] |
@@ -122,10 +91,6 @@ class Bootstrap: |
122 | 91 | from Bootstrap.get_bootstrap_from_recipes. |
123 | 92 | ''' |
124 | 93 |
|
125 | | - # Directories to exclude during copy (relative to src root). |
126 | | - # Used to reduce final build size and exclude unnecessary sources for final build. |
127 | | - skip_dirs = [] |
128 | | - |
129 | 94 | # Other things a Bootstrap might need to track (maybe separately): |
130 | 95 | # ndk_main.c |
131 | 96 | # whitelist.txt |
@@ -246,7 +211,7 @@ def assemble_distribution(self): |
246 | 211 | info_main(f'# Creating Android project ({self.name})') |
247 | 212 |
|
248 | 213 | rmdir(self.dist_dir) |
249 | | - copytree_filtered(self.build_dir, self.dist_dir, skip_dirs=self.skip_dirs) |
| 214 | + shprint(sh.cp, '-r', self.build_dir, self.dist_dir) |
250 | 215 |
|
251 | 216 | with current_directory(self.dist_dir): |
252 | 217 | with open('local.properties', 'w') as fileh: |
|
0 commit comments