5

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.

Wouter
  • 118
  • 7

1 Answers1

3

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?

streem
  • 9,044
  • 5
  • 30
  • 41