Skip to content

Instantly share code, notes, and snippets.

@ulhas
Created March 20, 2016 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ulhas/80295b68f30de2eabf52 to your computer and use it in GitHub Desktop.
Save ulhas/80295b68f30de2eabf52 to your computer and use it in GitHub Desktop.
Fastlane Action for updating version number of HyperTrack iOS SDK
require_relative "../helper/ht_helper"
module Fastlane
module Actions
module SharedValues
HT_UPDATE_VERSION_NUMBER_VALUE = :HT_UPDATE_VERSION_NUMBER_VALUE
end
class HtUpdateVersionNumberAction < Action
def self.run(params)
Helper.log.info "Framework version: #{params[:version_number]}"
# Get variable
version_number = params[:version_number]
# Parse and Write Version number
ht_helper = Helper::HTHelper.new()
ht_helper.update_version(version_number)
# Shared Value
Actions.lane_context[SharedValues::HT_UPDATE_VERSION_NUMBER_VALUE] = version_number
end
def self.description
"Updates hypertrack framework constant"
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :version_number,
env_name: "", # The name of the environment variable
description: "Framework version constant for HtUpdateVersionNumberAction", # a short description of this parameter
verify_block: proc do |value|
raise "No Framework version constant for HtUpdateVersionNumberAction given, pass using `version_number: 'version_number'`".red unless (value and not value.empty?)
end,
is_string: true,
optional: false)
]
end
def self.output
[
['HT_UPDATE_VERSION_NUMBER_VALUE', 'Updated version number']
]
end
def self.return_value
HT_UPDATE_VERSION_NUMBER_VALUE
end
def self.authors
["ulhas", "ulhas_sm"]
end
def self.is_supported?(platform)
platform == :ios
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment