class Fastlane::Actions::TwineGenerateAction
Public Class Methods
action_name()
click to toggle source
# File lib/fastlane/plugin/twine/actions/twine_generate_action.rb, line 51 def self.action_name name.split('::').last.gsub('Action', '').fastlane_underscore end
available_options()
click to toggle source
# File lib/fastlane/plugin/twine/actions/twine_generate_action.rb, line 24 def self.available_options [ FastlaneCore::ConfigItem.new(key: :configuration_path, env_name: 'TWINE_CONFIGURATION_PATH', description: 'Location to json file with configuration information', is_string: true, optional: false), FastlaneCore::ConfigItem.new(key: :use_bundle_exec, env_name: "TWINE_USE_BUNDLE_EXEC", description: "Use bundle exec when there is a Gemfile presented", is_string: false, default_value: true) ] end
category()
click to toggle source
# File lib/fastlane/plugin/twine/actions/twine_generate_action.rb, line 47 def self.category :building end
description()
click to toggle source
# File lib/fastlane/plugin/twine/actions/twine_generate_action.rb, line 20 def self.description 'Generates all localization files specified by the configuration file' end
is_supported?(_platform)
click to toggle source
# File lib/fastlane/plugin/twine/actions/twine_generate_action.rb, line 43 def self.is_supported?(_platform) true end
run(params)
click to toggle source
# File lib/fastlane/plugin/twine/actions/twine_generate_action.rb, line 4 def self.run(params) Actions.verify_gem!('twine') Helper::TwineConfigParser.parse(params).each do |config| if !File.exist?(config.source_path) UI.user_error!("Source file #{config.source_path} not found") else UI.message(config.description) cmd = Helper::TwineCommandHelper.generate_command(config.source_path, config.destination_path, config.twine_args) cmd.prepend('bundle exec ') if params[:use_bundle_exec] && shell_out_should_use_bundle_exec? Actions.sh(cmd, error_callback: lambda { |e| UI.user_error!('Error while generating localization file ' + config.destination_path) }) end end end