gpt4 book ai didi

ios - 在 Nativescript 应用程序中修改 Podfile

转载 作者:行者123 更新时间:2023-12-03 08:48:17 28 4
gpt4 key购买 nike

我已向我的 Nativescript 应用添加了一个共享扩展程序,并且此扩展程序需要一个 Pod。

所以我需要修改 Nativescript 应用程序的 Podfile,以将我的共享扩展也定位到所需的 Pod,如下所示:

target :MyApp do
platform :ios, '8.0'
use_frameworks!

pod 'AFNetworking', '~> 2.0'
pod '...'
end

target :MyExtension do
use_frameworks!

pod 'AFNetworking', '~> 2.0'
end

post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
if target.name.start_with? "Pods-MyExtension"
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'AF_APP_EXTENSIONS=1']
end
end
end
end

这里的问题是,每次运行项目时,Podfile 都会被 Nativescript 覆盖。

那么,有一种方法可以“阻止”Podfile 以防止 Nativescript 覆盖它,或者可以使用“ Hook ”在 Nativescript Podfile 生成后向 Podfile 添加自定义内容?

我该如何继续此操作?

谢谢。

最佳答案

为了修改构建时在平台文件夹中生成的 Podfile,您可以在 App_Resources/iOS 文件夹中添加 Podfile。

App_Resources/iOS 文件夹中的 Podfile 将与在platforms 文件夹中生成的 Podfile 合并。

关于ios - 在 Nativescript 应用程序中修改 Podfile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60519167/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com