成員
- apple_host_system_env
- apple_toolchain
- AppleDebugOutputs
- AppleDynamicFramework
- AppleExecutableBinary
- dotted_version
- link_multi_arch_binary
- link_multi_arch_static_library
- multi_arch_split
- new_dynamic_framework_provider
- new_executable_binary_provider
- new_objc_provider
- Objc
- 平台
- platform_type
- target_apple_env
- XcodeProperties
- XcodeVersionConfig
apple_host_system_env
dict apple_common.apple_host_system_env(xcode_config)
參數
| 參數 | 說明 |
|---|---|
xcode_config
|
必要 提供者,內含 Xcode 設定相關資訊。 |
apple_toolchain
apple_toolchain apple_common.apple_toolchain()
AppleDebugOutputs
Provider apple_common.AppleDebugOutputs
AppleDebugOutputs 提供者的建構函式/金鑰。如果目標會傳播 AppleDebugOutputs 提供者,請使用這個做為擷取目標的鍵。範例:
dep = ctx.attr.deps[0] p = dep[apple_common.AppleDebugOutputs]
AppleDynamicFramework
Provider apple_common.AppleDynamicFramework
AppleDynamicFramework 提供者的建構函式/金鑰。如果目標會傳播 AppleDynamicFramework 提供者,請使用這個做為擷取目標的鍵。範例:
dep = ctx.attr.deps[0] p = dep[apple_common.AppleDynamicFramework]
AppleExecutableBinary
Provider apple_common.AppleExecutableBinary
AppleExecutableBinary 提供者的建構函式/金鑰。如果目標會傳播 AppleExecutableBinary 提供者,請使用這個做為擷取目標的鍵。範例:
dep = ctx.attr.deps[0] p = dep[apple_common.AppleExecutableBinary]
dotted_version
DottedVersion apple_common.dotted_version(version)
參數
| 參數 | 說明 |
|---|---|
version
|
必要 以字串形式表示的 DottedVersion。 |
link_multi_arch_binary
struct apple_common.link_multi_arch_binary(ctx, avoid_deps=None, extra_linkopts=[], extra_link_inputs=[], stamp=-1)
apple_binary 規則的大部分邏輯,有助於將其連結邏輯遷移至 rules_apple 中的 Starlark。
這項 API 仍處於高度實驗階段,隨時可能變更。目前請勿依賴這項功能的穩定性。
參數
| 參數 | 說明 |
|---|---|
ctx
|
必要 Starlark 規則內容。 |
avoid_deps
|
sequence of Targets; or None;
default = NoneA list of Targets that are in the dependency graph of the binary but whose libraries should not be linked into the binary. 如果依附元件會在另一個映像檔的執行階段找到,例如套裝組合載入器,或這個二進位檔載入的任何動態程式庫/架構,就會發生這種情況。
|
extra_linkopts
|
sequence of strings;
default = []Extra linkopts to be passed to the linker action. |
extra_link_inputs
|
sequence of Files;
default = []Extra files to pass to the linker action. |
stamp
|
default = -1 是否要在連結的二進位檔中加入建構資訊。如果為 1,則一律會納入建構資訊。如果設為 0,系統一律會排除建構資訊。如果為 -1 (預設值),則行為由 --[no]stamp 旗標決定。為測試規則產生可執行輸出內容時,應將此值設為 0。 |
link_multi_arch_static_library
struct apple_common.link_multi_arch_static_library(ctx)
apple_static_library 規則邏輯的一部分,位於 rules_apple 網域中,可協助將連結邏輯遷移至 rules_apple 中的 Starlark。
這項 API 仍處於高度實驗階段,隨時可能變更。目前請勿依賴這項功能的穩定性。
參數
| 參數 | 說明 |
|---|---|
ctx
|
必要 Starlark 規則內容。 |
multi_arch_split
SplitTransitionProviderApi apple_common.multi_arch_split
如要使用這項轉換功能,請務必在規則中定義「platform_type」和「minimum_os_version」字串屬性。
platform_type 屬性的值會決定沿著這項設定轉換建構依附元件的目標架構。
選項如下:
ios:從--ios_multi_cpus收集的架構。macos:從--macos_cpus收集的架構。tvos:從--tvos_cpus收集的架構。watchos:從--watchos_cpus收集的架構。
minimum_os_version 應為以半形句號分隔的版本字串,例如「7.3」,用於根據平台類型,在設定中設定最低作業系統。舉例來說,指定 platform_type 為「ios」,且 minimum_os_version 為「8.0」,即可確保依附元件是以最低 iOS 版本「8.0」建構。
new_dynamic_framework_provider
AppleDynamicFramework apple_common.new_dynamic_framework_provider(binary=None, cc_info=None, objc, framework_dirs=None, framework_files=None)
參數
| 參數 | 說明 |
|---|---|
binary
|
File; or None;
default = None動態架構的 dylib 二進位檔構件。 |
cc_info
|
default = None CcInfo,其中包含連結至二進位的遞移依附元件相關資訊。 |
objc
|
必要 ObjcProvider,其中包含連結至二進位的遞移依附元件相關資訊。 |
framework_dirs
|
depset of strings; or None;
default = None用做連結輸入內容的架構路徑名稱,以便連結動態架構。 |
framework_files
|
depset of Files; or None;
default = NoneThe full set of artifacts that should be included as inputs to link against the dynamic framework |
new_executable_binary_provider
AppleExecutableBinary apple_common.new_executable_binary_provider(binary=None, cc_info=None, objc)
參數
| 參數 | 說明 |
|---|---|
binary
|
File; or None;
default = NoneThe binary artifact of the executable. |
cc_info
|
default = None CcInfo,其中包含連結至二進位的遞移依附元件相關資訊。 |
objc
|
必要 ObjcProvider,其中包含連結至二進位的遞移依附元件相關資訊。 |
new_objc_provider
ObjcProvider apple_common.new_objc_provider(**kwargs)
參數
| 參數 | 說明 |
|---|---|
kwargs
|
default = {} 引數字典。 |
Objc
Provider apple_common.Objc
Objc 提供者的建構函式/金鑰。如果目標會傳播 Objc 提供者,請使用這個做為擷取目標的鍵。範例:
dep = ctx.attr.deps[0] p = dep[apple_common.Objc]
platform
struct apple_common.platform
ios_deviceios_simulatormacostvos_devicetvos_simulatorwatchos_devicewatchos_simulator
這些值可以傳遞至預期平台的函式,例如 XcodeVersionConfig.sdk_version_for_platform。
platform_type
struct apple_common.platform_type
iosmacostvoswatchos
這些值可以傳遞至預期平台類型的方法,例如「apple」設定片段的 multi_arch_platform 方法。
範例:
ctx.fragments.apple.multi_arch_platform(apple_common.platform_type.ios)
target_apple_env
dict apple_common.target_apple_env(xcode_config, platform)
dict,這些變數應針對建構指定 Apple 平台類型目標的動作設定。舉例來說,這個字典包含的變數會標示要建構的平台名稱和 SDK 版本。鍵是變數名稱,值則是對應的值。
參數
| 參數 | 說明 |
|---|---|
xcode_config
|
必要 提供者,內含 Xcode 設定相關資訊。 |
platform
|
必要 Apple 平台。 |
XcodeProperties
Provider apple_common.XcodeProperties
XcodeVersionProperties 提供者的建構函式/金鑰。如果目標會傳播 XcodeVersionProperties 提供者,請使用這個做為擷取目標的鍵。範例:
dep = ctx.attr.deps[0] p = dep[apple_common.XcodeVersionProperties]
XcodeVersionConfig
Provider apple_common.XcodeVersionConfig
XcodeVersionConfig 提供者的建構函式/金鑰。