Skip to content

Commit 6262c7c

Browse files
committed
Revert "optimize copy of bootstrap"
This reverts commit 6813d66.
1 parent e5ad1c2 commit 6262c7c

3 files changed

Lines changed: 2 additions & 39 deletions

File tree

pythonforandroid/bootstrap.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import sh
88
import shlex
99
import shutil
10-
from pathlib import Path
1110

1211
from pythonforandroid.logger import (shprint, info, info_main, logger, debug)
1312
from pythonforandroid.util import (
@@ -41,36 +40,6 @@ def copy_files(src_root, dest_root, override=True, symlink=False):
4140
os.makedirs(dest_file)
4241

4342

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-
7443
default_recipe_priorities = [
7544
"webview", "sdl2", "sdl3", "service_only" # last is highest
7645
]
@@ -122,10 +91,6 @@ class Bootstrap:
12291
from Bootstrap.get_bootstrap_from_recipes.
12392
'''
12493

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-
12994
# Other things a Bootstrap might need to track (maybe separately):
13095
# ndk_main.c
13196
# whitelist.txt
@@ -246,7 +211,7 @@ def assemble_distribution(self):
246211
info_main(f'# Creating Android project ({self.name})')
247212

248213
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)
250215

251216
with current_directory(self.dist_dir):
252217
with open('local.properties', 'w') as fileh:

pythonforandroid/bootstraps/_sdl_common/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ class SDLGradleBootstrap(Bootstrap):
99

1010
recipe_depends = []
1111

12-
skip_dirs = ["jni"]
13-
1412
def _assemble_distribution_for_arch(self, arch):
1513
"""SDL bootstrap skips distribute_aars() - handled differently."""
1614
self.distribute_libs(arch, [self.ctx.get_libs_dir(arch.arch)])

pythonforandroid/recipes/kivy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def is_kivy_affected_by_deadlock_issue(recipe=None, arch=None):
2525
def is_kivy_less_than_3(recipe=None, arch=None):
2626
return packaging.version.parse(
2727
str(get_kivy_version(recipe, arch))
28-
) < packaging.version.Version("3.0.0.dev0")
28+
) < packaging.version.Version("3.0.0")
2929

3030

3131
class KivyRecipe(PyProjectRecipe):

0 commit comments

Comments
 (0)