Skip to content

Commit 8789cb0

Browse files
committed
toolchain: add a build command to rebuild a specific recipe
1 parent 0f63441 commit 8789cb0

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

pythonforandroid/toolchain.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,6 +2971,29 @@ def hostpython(self, args):
29712971
pprint(ctx.include_dirs)
29722972
os.execve(hostpython, [hostpython] + args, env)
29732973

2974+
def build(self, args):
2975+
'''Build a recipe
2976+
'''
2977+
parser = argparse.ArgumentParser(
2978+
description='Build a specific recipe')
2979+
parser.add_argument('recipe', help=('The recipe to build'))
2980+
args, unknown = parser.parse_known_args(args)
2981+
self.dist_args.requirements += ',{}'.format(args.recipe)
2982+
dist = self._dist
2983+
ctx = self.ctx
2984+
2985+
ctx.prepare_build_environment(user_sdk_dir=self.sdk_dir,
2986+
user_ndk_dir=self.ndk_dir,
2987+
user_android_api=self.android_api,
2988+
user_ndk_ver=self.ndk_version)
2989+
recipe = Recipe.get_recipe(args.recipe, self.ctx)
2990+
recipe.clean_build()
2991+
# TODO potentially, cleaning require compilation from all recipes
2992+
# that depends on the current one. (think about hostpython, sdl2
2993+
# for example)
2994+
build_dist_from_args(self.ctx, dist, "")
2995+
2996+
29742997
def main():
29752998
ToolchainCL()
29762999

0 commit comments

Comments
 (0)