# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do
  desc "Description of what the lane does"
  lane :test_ios do
    # test ios
    clear_derived_data
    sh("cd .. && xcodebuild -jobs `sysctl -n hw.ncpu` test -workspace Contentful.xcworkspace -scheme Contentful_iOS -sdk iphonesimulator -destination \"platform=iOS Simulator,name=iPhone 13,OS=15.4\" ONLY_ACTIVE_ARCH=YES CODE_SIGNING_IDENTITY="" CODE_SIGNING_REQUIRED=NO")
  end

  desc "Description of what the lane does"
  lane :test_macos do
    # test macos
    clear_derived_data
    sh("cd .. && xcodebuild -jobs `sysctl -n hw.ncpu` test -workspace Contentful.xcworkspace -scheme Contentful_macOS -sdk macosx -destination \"platform=macOS\" ONLY_ACTIVE_ARCH=YES CODE_SIGNING_IDENTITY="" CODE_SIGNING_REQUIRED=NO")
  end

  desc "Description of what the lane does"
  lane :test_tvos do
    # test tvos
    clear_derived_data
    sh("cd .. && xcodebuild -jobs `sysctl -n hw.ncpu` test -workspace Contentful.xcworkspace -scheme Contentful_tvOS -sdk appletvsimulator -destination \"platform=tvOS Simulator,name=Apple TV,OS=15.4\" ONLY_ACTIVE_ARCH=YES CODE_SIGNING_IDENTITY="" CODE_SIGNING_REQUIRED=NO")
  end

  desc "Description of what the lane does"
  lane :build do
    # verify project builds
    sh("cd .. && swift build")
  end
end
