使用Fastlane / Jenkins生成代码覆盖率

时间:2016-08-23 15:47:29

标签: jenkins jenkins-plugins fastlane

我正在尝试使用Fastlane的Sonar / Jenkins生成代码覆盖率。

我使用Jenkins运行的脚本:Fastlane测试。

在我的快速文件中,我这样做:

desc "Runs all the tests"
lane :test do
  scan(scheme: "XXX-icTests",
    clean: true,
    code_coverage: true,
    output_directory: "sonar-reports",
    output_types: "junit,json-compilation-database",
    buildlog_path: "sonar-reports",
    derived_data_path: "sonar-reports",
    use_clang_report_name: true,
    xcargs: "ONLY_ACTIVE_ARCH=YES"
  )
  slather(
    cobertura_xml: true,
    output_directory: "sonar-reports",
    proj: " XXX.xcodeproj",
    workspace: " XXX.xcworkspace",
    scheme: " XXX-ic",
    build_directory: "sonar-reports",
    ignore:[]
  )
  oclint(
    compile_commands: "sonar-reports/compile_commands.json",
    report_type: 'pmd',
    select_regex: /XXX/,
    max_priority_1: 10,
    max_priority_2: 400,
    max_priority_3: 4000,
    enable_clang_static_analyzer: false,
    allow_duplicated_violations: false,
    list_enabled_rules: true,
    report_path: "sonar-reports/oclint.xml"
  ) 
  sonar
end

但是当在模拟器上构建应用程序时,它会停在这里:

enter image description here

在这种情况下可能出现什么问题?

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

我在fastlane扫描之前使用下一个..在shell脚本上

FASTLANE_EXPLICIT_OPEN_SIMULATOR = 2 fastlane scan --scheme $ job

这将触发模拟器