Skip to content

Commit 1e0c0ce

Browse files
committed
feat: support Xcode 13.3 and iOS 15.4 (#150)
1 parent 3c23fd8 commit 1e0c0ce

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

metadata-generator/build-step-metadata-generator.py

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,38 @@ def map_and_list(func, iterable):
3535

3636

3737
# process environment variables
38+
effective_platofrm_name = env("EFFECTIVE_PLATFORM_NAME")
39+
docset_platform = "iOS"
40+
default_deployment_target_flag_name = "-mios-simulator-version-min"
41+
default_deployment_target_clang_env_name = "IPHONEOS_DEPLOYMENT_TARGET"
42+
if effective_platofrm_name is "-macosx":
43+
docset_platform = "OSX"
44+
default_deployment_target_flag_name = "-mmacosx-version-min"
45+
default_deployment_target_clang_env_name = "MACOSX_DEPLOYMENT_TARGET"
46+
elif effective_platofrm_name is "-watchos":
47+
docset_platform = "watchOS"
48+
default_deployment_target_flag_name = "-mwatchos-version-min"
49+
default_deployment_target_clang_env_name = "WATCHOS_DEPLOYMENT_TARGET"
50+
elif effective_platofrm_name is "-watchsimulator":
51+
docset_platform = "watchOS"
52+
default_deployment_target_flag_name = "-mwatchos-simulator-version-min"
53+
default_deployment_target_clang_env_name = "WATCHOS_DEPLOYMENT_TARGET"
54+
elif effective_platofrm_name is "-appletvos":
55+
docset_platform = "tvOS"
56+
default_deployment_target_flag_name = "-mappletvos-version-min"
57+
default_deployment_target_clang_env_name = "APPLETVOS_DEPLOYMENT_TARGET"
58+
elif effective_platofrm_name is "-appletvsimulator":
59+
docset_platform = "tvOS"
60+
default_deployment_target_flag_name = "-mappletvsimulator-version-min"
61+
default_deployment_target_clang_env_name = "APPLETVOS_DEPLOYMENT_TARGET"
62+
elif effective_platofrm_name is "-iphoneos":
63+
default_deployment_target_flag_name = "-miphoneos-version-min"
64+
3865
conf_build_dir = env("CONFIGURATION_BUILD_DIR")
3966
sdk_root = env("SDKROOT")
4067
src_root = env("SRCROOT")
41-
deployment_target_flag_name = env("DEPLOYMENT_TARGET_CLANG_FLAG_NAME")
42-
deployment_target = env(env("DEPLOYMENT_TARGET_CLANG_ENV_NAME"))
68+
deployment_target_flag_name = env_or_empty("DEPLOYMENT_TARGET_CLANG_FLAG_NAME") or default_deployment_target_flag_name
69+
deployment_target = env(env_or_empty("DEPLOYMENT_TARGET_CLANG_ENV_NAME") or default_deployment_target_clang_env_name)
4370
std = env("GCC_C_LANGUAGE_STANDARD")
4471
header_search_paths = env_or_empty("HEADER_SEARCH_PATHS")
4572
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):
5178
preprocessor_defs = env_or_empty("GCC_PREPROCESSOR_DEFINITIONS")
5279
preprocessor_defs_parsed = map_and_list((lambda s: "-D" + s), shlex.split(preprocessor_defs, '\''))
5380
typescript_output_folder = env_or_none("TNS_TYPESCRIPT_DECLARATIONS_PATH")
54-
docset_platform = "iOS"
55-
effective_platofrm_name = env("EFFECTIVE_PLATFORM_NAME")
5681

57-
if effective_platofrm_name is "-macosx":
58-
docset_platform = "OSX"
59-
elif effective_platofrm_name is "-watchos" or effective_platofrm_name is "-watchsimulator":
60-
docset_platform = "watchOS"
61-
elif effective_platofrm_name is "-appletvos" or effective_platofrm_name is "-appletvsimulator":
62-
docset_platform = "tvOS"
82+
83+
6384

6485
docset_path = os.path.join(os.path.expanduser("~"),
6586
"Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.{}.docset"

0 commit comments

Comments
 (0)