class Fastlane::Actions::UploadToBuglyAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/upload_to_bugly/actions/upload_to_bugly_action.rb, line 84
def self.authors
  ["fisherman"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/upload_to_bugly/actions/upload_to_bugly_action.rb, line 43
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :appid,
                                 env_name: "FL_UPLOAD_TO_BUGLY_APPID", # The name of the environment variable
                                 description: "bugly appid", # a short description of this parameter
                                 verify_block: proc do |value|
                                    UI.user_error!("No appid for UploadToBuglyAction given, pass using `appid: 'xxx'`") unless (value and not value.empty?)
                                 end),
    FastlaneCore::ConfigItem.new(key: :appkey,
                                 env_name: "FL_UPLOAD_TO_BUGLY_APPKEY", # The name of the environment variable
                                 description: "bugly appkey", # a short description of this parameter
                                 verify_block: proc do |value|
                                    UI.user_error!("No appkey for UploadToBuglyAction given, pass using `appkey: 'xxx'`") unless (value and not value.empty?)
                                 end),
    FastlaneCore::ConfigItem.new(key: :bundleid,
                                 env_name: "FL_UPLOAD_TO_BUGLY_BUNDLEID", # The name of the environment variable
                                 description: "app bundleid", # a short description of this parameter
                                 verify_block: proc do |value|
                                    UI.user_error!("No bundleid for UploadToBuglyAction given, pass using `bundleid: 'xxx'`") unless (value and not value.empty?)
                                 end),
    FastlaneCore::ConfigItem.new(key: :version,
                                 env_name: "FL_UPLOAD_TO_BUGLY_VERSION", # The name of the environment variable
                                 description: "app version", # a short description of this parameter
                                 verify_block: proc do |value|
                                    UI.user_error!("No version for UploadToBuglyAction given, pass using `version: 'xxx'`") unless (value and not value.empty?)
                                 end),
    FastlaneCore::ConfigItem.new(key: :platform,
                                 env_name: "FL_UPLOAD_TO_BUGLY_PLATFORM",
                                 description: "app platform",
                                 optional: true,
                                 is_string: true, # true: verifies the input is a string, false: every kind of value
                                 default_value: "IOS"), # the default value if the user didn't provide one
    FastlaneCore::ConfigItem.new(key: :inputSymbol,
                                env_name: "FL_UPLOAD_TO_BUGLY_INPUTSYMBOL", # The name of the environment variable
                                description: ".dsym path", # a short description of this parameter
                                verify_block: proc do |value|
                                  UI.user_error!("No inputSymbol for UploadToBuglyAction given, pass using `inputSymbol: 'xxx'`") unless (value and not value.empty?)
                                end)
  ]
end
call_error_callback(params, result) click to toggle source
# File lib/fastlane/plugin/upload_to_bugly/actions/upload_to_bugly_action.rb, line 25
def self.call_error_callback(params, result)
  if params[:error_callback]
    Dir.chdir(FastlaneCore::FastlaneFolder.path) do
      params[:error_callback].call(result)
    end
  else
    UI.shell_error!(result)
  end
end
description() click to toggle source

@!group Documentation

# File lib/fastlane/plugin/upload_to_bugly/actions/upload_to_bugly_action.rb, line 39
def self.description
  "通过 buglyqq-upload-symbol.jar 来上传 .dSYM 到 bugly"
end
details() click to toggle source
# File lib/fastlane/plugin/upload_to_bugly/actions/upload_to_bugly_action.rb, line 88
def self.details
  "upload .dSYM to bugly with buglyqq-upload-symbol.jar,具体操作查看 README.md"
end
example_code() click to toggle source
# File lib/fastlane/plugin/upload_to_bugly/actions/upload_to_bugly_action.rb, line 96
def self.example_code
  [
    'upload_to_bugly(
      appid: "xxx",
      appkey: "xxx",
      bundleid: "xxx",
      version: "a.b.c",
      inputSymbol: "./xxx.dSYM"
    )
    '
  ]
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/upload_to_bugly/actions/upload_to_bugly_action.rb, line 92
def self.is_supported?(platform)
  platform == :ios
end
run(params) click to toggle source
# File lib/fastlane/plugin/upload_to_bugly/actions/upload_to_bugly_action.rb, line 8
def self.run(params)
  cmd = []

  cmd << ["java -jar ~/bin/buglyqq-upload-symbol.jar"]
  cmd << "-appid #{params[:appid]}" 
  cmd << "-appkey #{params[:appkey]}" 
  cmd << "-bundleid #{params[:bundleid]}" 
  cmd << "-version #{params[:version]}" 
  cmd << "-platform #{params[:platform]}" 
  cmd << "-inputSymbol #{params[:inputSymbol]}" 

  Action.sh(cmd.join(' '), error_callback: lambda { |result|
    call_error_callback(params, result)
  })

end