Objective-C build-wrapper with fastlane

sonarcfamily
(Andrew) #1

Versions: SonarQube 7.6, Sonar-Scanner 3.3.0.1492, SonarCFamily 6.1

What are you trying to achieve: run build-wrapper-macosx-x86 and fastlane scan together, or optimize running them separately.

I am currently running build-wrapper-macosx-x86 with xcodebuild as a shell command, then the scan command.

sh("cd .. && build-wrapper-macosx-x86 --out-dir sonar-reports xcodebuild -workspace workspace.xcworkspace -scheme scheme clean build")

scan(
        scheme: "scheme",
        output_directory: "./sonar-reports",
        code_coverage: true,
        workspace: "workspace.xcworkspace",
        skip_build: true
      )

However, this builds twice and takes a long time on larger projects. Ideally, fastlane will add the option to include the build-wrapper command. Until that happens, I would be happy with any recommendations to optimize the order/settings of these commands.

Is anyone else using build-wrapper-macosx-x86 with fastlane?

(Massimo Paladin) #2

Hello @aclaus,

in order to build once you should run it externally and not plug it inside fastlane configuration file:

build-wrapper-macosx-x86 --out-dir sonar-reports
sonar-scanner -D sonar.cfamily.build-wrapper-output=sonar-reports …