Skip to content

Commit b6fbd0b

Browse files
committed
[dist] Fix Recipe.clean_build for BootstrapNDKRecipe
1 parent d1b3e9a commit b6fbd0b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pythonforandroid/recipe.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,21 @@ class BootstrapNDKRecipe(Recipe):
642642

643643
dir_name = None # The name of the recipe build folder in the jni dir
644644

645+
def clean_build(self, arch=None):
646+
# we must set python recipe first or `get_recipe_env` will fail
647+
self.ctx.python_recipe = Recipe.get_recipe(
648+
'python3'
649+
if 'python3' in self.ctx.recipe_build_order
650+
else 'python2',
651+
self.ctx,
652+
)
653+
for arch in self.ctx.archs if not arch else [arch]:
654+
env = self.get_recipe_env(arch)
655+
# to clean sdl2 recipe, we also needs below to set nel variable
656+
env['APP_ALLOW_MISSING_DEPS'] = 'true'
657+
with current_directory(self.get_build_dir(arch.arch)):
658+
shprint(sh.ndk_build, 'clean', _env=env)
659+
645660
def get_build_container_dir(self, arch):
646661
return self.get_jni_dir()
647662

0 commit comments

Comments
 (0)