# 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(:android)

platform :android do
  desc "Upload to beta channel"
  lane :beta do
    upload_to_play_store(track: 'beta', aab: './app/release/app-release.aab')
  end
  desc "Promote beta to production"
  lane :prod do
    # TO BE TESTED: haven't used yet. Should promote from beta to prod, but not sure about the track name. Should hopefully also update changelogs? Otherwise, check :sync
    upload_to_play_store(track_promote_to: 'release', track: 'beta')
  end
  desc "Update current production description"
  lane :sync do
    # Synchronize current prod version (make sure number is up to date). Useful to send changelogs
    # If you get an error message "badRequest: The requested language is not currently supported: und." => make sure to run this command from KISS main folder
    # If you get "please specify :version_code" => run fastlane sync, not fastlane supply
    supply(version_code: 183)
  end
  desc "Generate images for all locales"
  lane :images do
    sh('python3', 'generate_graphics.py')
  end
end
