From d9ffd8817f9cd94cb27fedb713f850e43ff6a817 Mon Sep 17 00:00:00 2001 From: meow464 Date: Fri, 24 Sep 2021 18:41:03 -0300 Subject: [PATCH] Adds `--add-custom-recipe` to the `update` command Custom recipes were built but not added to the XCode project. See: https://github.com/kivy/kivy-ios/issues/642 --- .gitignore | 2 ++ kivy_ios/toolchain.py | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 554a3800b..0e661004f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ freetype-* build/* dist/* +.eggs/* +kivy_ios.egg-info/* src/SDL/Xcode-iPhoneOS/SDL/build/ src/SDL/Xcode-iOS/SDL/build/ tmp/* diff --git a/kivy_ios/toolchain.py b/kivy_ios/toolchain.py index f11301531..b92f7b11e 100755 --- a/kivy_ios/toolchain.py +++ b/kivy_ios/toolchain.py @@ -1188,7 +1188,7 @@ def _hostpython_pip(args): shprint(pip_cmd, *args) -def update_pbxproj(filename, pbx_frameworks=None): +def update_pbxproj(filename, pbx_frameworks=None, custom_recipes=None, custom_recipes_paths=None): # list all the compiled recipes ctx = Context() pbx_libraries = [] @@ -1197,7 +1197,17 @@ def update_pbxproj(filename, pbx_frameworks=None): frameworks = [] libraries = [] sources = [] + + if custom_recipes and custom_recipes_paths: + recipes = custom_recipes + ctx.custom_recipes_paths = custom_recipes_paths + else: + recipes = [] + for recipe in Recipe.list_recipes(): + recipes.append(recipe) + + for recipe in recipes: key = "{}.build_all".format(recipe) if key not in ctx.state: continue @@ -1457,6 +1467,9 @@ def update(self): parser = argparse.ArgumentParser( description="Update an existing xcode project") parser.add_argument("filename", help="Path to your project or xcodeproj") + parser.add_argument("recipes", nargs="+", help="Recipes to update") + parser.add_argument("--add-custom-recipe", action="append", default=[], + help="Path to custom recipe (the recipe must already have been built with the 'build' command)") parser.add_argument("--add-framework", action="append", help="Additional Frameworks to include with this project") args = parser.parse_args(sys.argv[2:]) @@ -1466,7 +1479,8 @@ def update(self): logger.error("{} not found".format(filename)) sys.exit(1) - update_pbxproj(filename, pbx_frameworks=args.add_framework) + update_pbxproj(filename, pbx_frameworks=args.add_framework, + custom_recipes=args.recipes, custom_recipes_paths=args.add_custom_recipe) print("--") print("Project {} updated".format(filename))