|
25 | 25 | """
|
26 | 26 | import sh
|
27 | 27 | import os
|
| 28 | +from pythonforandroid.build import Context |
| 29 | +from pythonforandroid.graph import get_recipe_order_and_bootstrap |
28 | 30 | from pythonforandroid.toolchain import current_directory
|
29 | 31 | from ci.constants import TargetPython, CORE_RECIPES, BROKEN_RECIPES
|
30 | 32 |
|
@@ -77,11 +79,21 @@ def main():
|
77 | 79 | target_python = TargetPython.python3crystax
|
78 | 80 | recipes = modified_recipes()
|
79 | 81 | print('recipes modified:', recipes)
|
80 |
| - broken_recipes = BROKEN_RECIPES[target_python] |
81 |
| - recipes = recipes - (CORE_RECIPES | broken_recipes) |
| 82 | + recipes -= CORE_RECIPES |
82 | 83 | print('recipes to build:', recipes)
|
| 84 | + context = Context() |
| 85 | + build_order, python_modules, bs = get_recipe_order_and_bootstrap( |
| 86 | + context, recipes, None) |
| 87 | + # fallback to python2 if default target is not compatible |
| 88 | + if target_python.name not in build_order: |
| 89 | + print('incompatible with {}'.format(target_python.name)) |
| 90 | + target_python = TargetPython.python2 |
| 91 | + print('falling back to {}'.format(target_python.name)) |
| 92 | + # removing the known broken recipe for the given target |
| 93 | + broken_recipes = BROKEN_RECIPES[target_python] |
| 94 | + recipes -= broken_recipes |
| 95 | + print('recipes to build (no broken):', recipes) |
83 | 96 | build(target_python, recipes)
|
84 |
| - print(recipes) |
85 | 97 |
|
86 | 98 |
|
87 | 99 | if __name__ == '__main__':
|
|
0 commit comments