SvenTiigi/STLocationRequest

View on GitHub
fastlane/Fastfile

Summary

Maintainability
Test Coverage
fastlane_version "2.89.0"

default_platform :ios

platform :ios do

  desc "Release a new version of STLocationRequest"
  lane :release do |options|
    ensure_git_status_clean
    ensure_git_branch(branch: 'master')
    test
    version = options[:version]
    increment(version: version)
    add_git_tag(tag: version)
    push_git_tags()
    push_to_git_remote()
    pod_push()
  end

  desc "Increment Version"
  lane :increment do |options|
  version = options[:version]
  version_bump_podspec(
    path: "STLocationRequest.podspec", 
    version_number: version
  )
  set_info_plist_value(
    path: "Configs/STLocationRequest.plist", 
    key: "CFBundleShortVersionString", 
    value: version
  )
  set_info_plist_value(
    path: "Configs/STLocationRequestTests.plist", 
    key: "CFBundleShortVersionString", 
    value: version
  )
  set_info_plist_value(
    path: "Example-iOS/Resources/Info.plist", 
    key: "CFBundleShortVersionString", 
    value: version
  )
  set_info_plist_value(
    path: "Example-tvOS/Info.plist", 
    key: "CFBundleShortVersionString", 
    value: version
  )
  git_commit(
      path: [
        "STLocationRequest.podspec", 
        "Configs/STLocationRequest.plist", 
        "Configs/STLocationRequestTests.plist", 
        "Example-iOS/Resources/Info.plist",
        "Example-tvOS/Info.plist"
      ],
      message: "STLocationRequest Version #{version} 🚀"
  )
end

  desc "Runs Tests"
  lane :test do
    carthage(command: "build", no_skip_current: true, cache_builds: true)
    pod_lib_lint
    scan(
      project: "STLocationRequest.xcodeproj",
      scheme: "STLocationRequest-iOS",
      clean: true,
      code_coverage: true
    )
    scan(
      project: "STLocationRequest.xcodeproj",
      scheme: "STLocationRequest-tvOS",
      clean: true,
      code_coverage: true
    )
  end

  desc "Runs coverage"
  lane :coverage do
    slather(
      proj: "STLocationRequest.xcodeproj",
      scheme: "STLocationRequest-iOS",
      travis: true,
      cobertura_xml: true,
      ignore: ["Tests/*"]
    )
  end
  
end