Class: Fastlane::Actions::HuaweiAppgalleryConnectSetGmsDependencyAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_set_gms_dependency.rb

Class Method Summary collapse

Class Method Details

.authorsObject



26
27
28
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_set_gms_dependency.rb', line 26

def self.authors
  ["Shreejan Shrestha"]
end

.available_optionsObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_set_gms_dependency.rb', line 39

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :client_id,
                                 env_name: "HUAWEI_APPGALLERY_CONNECT_CLIENT_ID",
                                 description: "Huawei AppGallery Connect Client ID",
                                 optional: false,
                                 type: String),

    FastlaneCore::ConfigItem.new(key: :client_secret,
                                 env_name: "HUAWEI_APPGALLERY_CONNECT_CLIENT_SECRET",
                                 description: "Huawei AppGallery Connect Client Secret",
                                 optional: false,
                                 type: String),

    FastlaneCore::ConfigItem.new(key: :app_id,
                                 env_name: "HUAWEI_APPGALLERY_CONNECT_APP_ID",
                                 description: "Huawei AppGallery Connect App ID",
                                 optional: false,
                                 type: String),

    FastlaneCore::ConfigItem.new(key: :gms_dependency,
                                 env_name: "HUAWEI_APPGALLERY_CONNECT_GMS_DEPENDENCY",
                                 description: "GMS Dependency of the app. (0 for no, 1 for yes)",
                                 optional: false,
                                 type: Integer),

  ]
end

.descriptionObject



22
23
24
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_set_gms_dependency.rb', line 22

def self.description
  "Huawei AppGallery Connect Plugin"
end

.detailsObject



34
35
36
37
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_set_gms_dependency.rb', line 34

def self.details
  # Optional:
  "Set GMS Dependency"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


68
69
70
71
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_set_gms_dependency.rb', line 68

def self.is_supported?(platform)
  [:android].include?(platform)
  true
end

.return_valueObject



30
31
32
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_set_gms_dependency.rb', line 30

def self.return_value
  # If your method provides a return value, you can describe here what it does
end

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_set_gms_dependency.rb', line 8

def self.run(params)
  token = Helper::HuaweiAppgalleryConnectHelper.get_token(params[:client_id], params[:client_secret])

  if token.nil?
    UI.message("Cannot retrieve token, please check your client ID and client secret")
  else
    Helper::HuaweiAppgalleryConnectHelper.set_gms_dependency(token,
                                                             params[:client_id],
                                                             params[:app_id],
                                                             params[:gms_dependency]
    )
  end
end