禁用xcode build阶段在fastlane中

发布于 2025-02-06 18:21:23 字数 397 浏览 3 评论 0原文

我有一个使用Fastlane将其带到CI的Xcode项目。 现在一切都在起作用,我添加了一个单独的车道来打电话给Swiftlint。

现在,我已经在Xcode项目中有一个runscript,可以调用Swiftlint。因此,现在基本上,该应用程序被覆盖了两次。

因此,在Fastlane构建项目时,是否可以在Xcode项目中禁用运行脚本?

现在您可能想说:“那你为什么在fastlane中问一个单独的Swiftlint车道?无论如何它将被执行!'。好吧...您是对的,但是当皮棉失败时,我想在管道中单独失败,所以我想我需要为此创建一个单独的车道。

我看到一个解决方案:在XCode中创建一个单独的目标,该目标仅包含Swiftlint事物。 “问题”是解决方案是Swiftlint在开发人员制造时不会在开发人员机器上自动戴上。

I have an xcode project that I am bringing to CI using Fastlane.
All is now working, and I have added a separate Lane to call SwiftLint.

Now I already have a Runscript in the xcode project to call SwiftLint. So now basically, the app is being Linted twice.

So, is there a way to disable the Run script in the xcode project when the project is being built by Fastlane??

Now you might wanna say 'why then did you ask a separate SwiftLint lane in Fastlane? It is going to be executed anyway!'. Well ... you are right, but I want to get a separate fail in the pipeline when the Lint fails, so I assume I need to create a separate lane for that.

I see one solution: Create a separate Target in xcode that only contains the SwiftLint thing. 'Problem' with that is that solution is that the SwiftLint is not automatically don on the Developers machine when he/she builds.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寒冷纷飞旳雪 2025-02-13 18:21:23

我已经能够通过将脚本阶段限制为调试配置来解决此问题,以便它仅在我本地构建时运行。

当使用Fastlane在CI上构建应用程序时,它会使用Release Config,并且不会触发脚本。

if [ "${CONFIGURATION}" == "Debug" ]; then
  # SwiftLint Script
fi

运行脚本“构建阶段到我的版本配置?

I have been able to get around this by limiting the Script Phase to the Debug config so that it only runs when I'm building locally.

When the app is built on CI using Fastlane it uses the Release config and doesn't trigger the script.

if [ "${CONFIGURATION}" == "Debug" ]; then
  # SwiftLint Script
fi

How can I limit a "Run Script" build phase to my release configuration?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文