From 1e0c0cec0e9627cd72652208347e760809f7d1e1 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Thu, 3 Mar 2022 11:48:39 -0800 Subject: [PATCH] feat: support Xcode 13.3 and iOS 15.4 (#150) --- .../build-step-metadata-generator.py | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/metadata-generator/build-step-metadata-generator.py b/metadata-generator/build-step-metadata-generator.py index f04e8dc0..1466d315 100755 --- a/metadata-generator/build-step-metadata-generator.py +++ b/metadata-generator/build-step-metadata-generator.py @@ -35,11 +35,38 @@ def map_and_list(func, iterable): # process environment variables +effective_platofrm_name = env("EFFECTIVE_PLATFORM_NAME") +docset_platform = "iOS" +default_deployment_target_flag_name = "-mios-simulator-version-min" +default_deployment_target_clang_env_name = "IPHONEOS_DEPLOYMENT_TARGET" +if effective_platofrm_name is "-macosx": + docset_platform = "OSX" + default_deployment_target_flag_name = "-mmacosx-version-min" + default_deployment_target_clang_env_name = "MACOSX_DEPLOYMENT_TARGET" +elif effective_platofrm_name is "-watchos": + docset_platform = "watchOS" + default_deployment_target_flag_name = "-mwatchos-version-min" + default_deployment_target_clang_env_name = "WATCHOS_DEPLOYMENT_TARGET" +elif effective_platofrm_name is "-watchsimulator": + docset_platform = "watchOS" + default_deployment_target_flag_name = "-mwatchos-simulator-version-min" + default_deployment_target_clang_env_name = "WATCHOS_DEPLOYMENT_TARGET" +elif effective_platofrm_name is "-appletvos": + docset_platform = "tvOS" + default_deployment_target_flag_name = "-mappletvos-version-min" + default_deployment_target_clang_env_name = "APPLETVOS_DEPLOYMENT_TARGET" +elif effective_platofrm_name is "-appletvsimulator": + docset_platform = "tvOS" + default_deployment_target_flag_name = "-mappletvsimulator-version-min" + default_deployment_target_clang_env_name = "APPLETVOS_DEPLOYMENT_TARGET" +elif effective_platofrm_name is "-iphoneos": + default_deployment_target_flag_name = "-miphoneos-version-min" + conf_build_dir = env("CONFIGURATION_BUILD_DIR") sdk_root = env("SDKROOT") src_root = env("SRCROOT") -deployment_target_flag_name = env("DEPLOYMENT_TARGET_CLANG_FLAG_NAME") -deployment_target = env(env("DEPLOYMENT_TARGET_CLANG_ENV_NAME")) +deployment_target_flag_name = env_or_empty("DEPLOYMENT_TARGET_CLANG_FLAG_NAME") or default_deployment_target_flag_name +deployment_target = env(env_or_empty("DEPLOYMENT_TARGET_CLANG_ENV_NAME") or default_deployment_target_clang_env_name) std = env("GCC_C_LANGUAGE_STANDARD") header_search_paths = env_or_empty("HEADER_SEARCH_PATHS") header_search_paths_parsed = map_and_list((lambda s: "-I" + s), shlex.split(header_search_paths)) @@ -51,15 +78,9 @@ def map_and_list(func, iterable): preprocessor_defs = env_or_empty("GCC_PREPROCESSOR_DEFINITIONS") preprocessor_defs_parsed = map_and_list((lambda s: "-D" + s), shlex.split(preprocessor_defs, '\'')) typescript_output_folder = env_or_none("TNS_TYPESCRIPT_DECLARATIONS_PATH") -docset_platform = "iOS" -effective_platofrm_name = env("EFFECTIVE_PLATFORM_NAME") -if effective_platofrm_name is "-macosx": - docset_platform = "OSX" -elif effective_platofrm_name is "-watchos" or effective_platofrm_name is "-watchsimulator": - docset_platform = "watchOS" -elif effective_platofrm_name is "-appletvos" or effective_platofrm_name is "-appletvsimulator": - docset_platform = "tvOS" + + docset_path = os.path.join(os.path.expanduser("~"), "Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.{}.docset"