10000 Made bootstraps use dependency-dependent build dir · latin1593/python-for-android@6af2ae7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6af2ae7

Browse files
committed
Made bootstraps use dependency-dependent build dir
1 parent 6aa81fd commit 6af2ae7

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

pythonforandroid/bootstrap.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,27 @@ def dist_dir(self):
5353
def jni_dir(self):
5454
return self.name + self.jni_subdir
5555

56+
def check_recipe_choices(self):
57+
'''Checks what recipes are being built to see which of the alternative
58+
and optional dependencies are being used,
59+
and returns a list of these.'''
60+
recipes = []
61+
built_recipes = self.ctx.recipe_build_order
62+
for recipe in self.recipe_depends:
63+
if isinstance(recipe, (tuple, list)):
64+
for alternative in recipe:
65+
if alternative in built_recipes:
66+
recipes.append(alternative)
67+
break
68+
return sorted(recipes)
69+
70+
def get_build_dir_name(self):
71+
choices = self.check_recipe_choices()
72+
dir_name = '-'.join([self.name] + choices)
73+
return dir_name
74+
5675
def get_build_dir(self):
57-
return join(self.ctx.build_dir, 'bootstrap_builds', self.name)
76+
return join(self.ctx.build_dir, 'bootstrap_builds', self.get_build_dir_name())
5877

5978
def get_dist_dir(self, name):
6079
return join(self.ctx.dist_dir, name)

pythonforandroid/build.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,6 @@ def build_recipes(build_order, python_modules, ctx):
518518
info_notify(
519519
('The requirements ({}) were not found as recipes, they will be '
520520
'installed with pip.').format(', '.join(python_modules)))
521-
ctx.recipe_build_order = build_order
522521

523522
recipes = [Recipe.get_recipe(name, ctx) for name in build_order]
524523

pythonforandroid/toolchain.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def build_dist_from_args(ctx, dist, args):
127127
bs = Bootstrap.get_bootstrap(args.bootstrap, ctx)
128128
build_order, python_modules, bs \
129129
= get_recipe_order_and_bootstrap(ctx, dist.recipes, bs)
130+
ctx.recipe_build_order = build_order
130131

131132
info('The selected bootstrap is {}'.format(bs.name))
132133
info_main('# Creating dist with {} bootstrap'.format(bs.name))

0 commit comments

Comments
 (0)
0