我试图弄清楚为什么在应该相同的 podspec 文件上运行 pod install 后会得到两个不同的结果。该组件名为 EarlGreyApp,今年发布了 2.0.0。2.0.0 版本的 podspec 位于 EarlGrey 存储库的 earlgrey2 分支中:https ://github.com/google/EarlGrey/blob/earlgrey2/EarlGreyApp.podspec
当我在 podfile 中定义了这个(我正在使用 Demo/EarlGreyExample 来重现):
target 'EarlGreyExampleSwift' do
pod 'EarlGreyApp', '2.0.0'
end
它正确修改了 EarlGreyExample.xcodeproj/project.pbxproj 的这一部分以引用 EarlGrepApp 的 AppFramework.framework 组件:
/* Begin PBXShellScriptBuildPhase section */
4D216774E658C2E4470F936E /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-EarlGreyExampleSwift/Pods-EarlGreyExampleSwift-frameworks.sh",
"${PODS_ROOT}/EarlGreyApp/AppFramework.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AppFramework.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-EarlGreyExampleSwift/Pods-EarlGreyExampleSwift-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
但是,当我将 podfile 更改为指向分支时:
target 'EarlGreyExampleSwift' do
pod 'EarlGreyApp', :git => 'https://github.com/google/EarlGrey.git', :branch => 'earlgrey2'
end
上述部分不会生成到 project.pbxproj 文件中。
我无法解释为什么为 EarlGreyApp 注册的 podspec 应该是相同的。当我执行pod spec cat EarlGreyApp 时,我看到的内容与 earlgrey2 分支中的内容相同。
pod spec cat EarlGreyApp --show-all 显示只有两个 Podspecs 可用,2.0.0 和 2.0.0-rc
关于可能有什么不同的任何想法?