xcode给出的错误是:
./../SourcePackages/checkouts/apollo-ios/scripts: No such file or directory我在官方网站上的官方脚本中看到了这行代码,我有xcode11,我在Swift软件包管理器中使用阿波罗iOS 0.16.0
发布于 2019-10-02 20:32:23
几周前我也有同样的问题。事实上,这是阿波罗iOS网站文档中的一个错误。我意识到,当构建发布配置时,脚本不会在正确的文件夹中找到脚本。但是,在构建Debug配置时,path可以正常工作。我指的是这一行../../SourcePackages/checkouts/apollo-ios/scripts
因此,为了解决这个问题,我们必须检测构建配置类型,如下所示:
# Go to the build root and go back up to where SPM keeps the Apollo iOS repo checked out.
cd "${BUILD_ROOT}"
if [ "${CONFIGURATION}" == "Release" ]; then
cd "../../../../../SourcePackages/checkouts/apollo-ios/scripts"
fi
if [ "${CONFIGURATION}" == "Debug" ]; then
cd "../../SourcePackages/checkouts/apollo-ios/scripts"
fi
APOLLO_SCRIPT_PATH="$(pwd)"
if [ -z "${APOLLO_SCRIPT_PATH}" ]; then
echo "error: Couldn't find the CLI script in your checked out SPM packages; make sure to add the framework to your project."
exit 1
fi
cd "${SRCROOT}/${TARGET_NAME}"
"${APOLLO_SCRIPT_PATH}"/run-bundled-codegen.sh codegen:generate --target=swift --includes=./**/*.graphql --localSchemaFile="schema.json" API.swifthttps://stackoverflow.com/questions/58208867
复制相似问题