Class: Fastlane::Actions::AppAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



21
22
23
# File 'lib/fastlane/plugin/rocket/actions/app_action.rb', line 21

def self.authors
  ["三块"]
end

.available_optionsObject



33
34
35
36
37
38
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/fastlane/plugin/rocket/actions/app_action.rb', line 33

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :code,
                                 env_name: 'R_APP_CODE',
                                 description: '应用的标识码,从rocket平台获取。用于获取应用的相关信息',
                                 optional: false,
                                 type: String,
                                 default_value: "fanDengBook",
                                 verify_block: proc do |value| 
                                   Tools.error("code不能为空") unless (value and not value.empty?)
                                   ENV["R_APP_CODE"] = value.to_s
                                 end),
    FastlaneCore::ConfigItem.new(key: :plan,
                                 env_name: 'R_APP_PLAN',
                                 description: '测试计划或发布计划。用于确定组件的版本和打包信息',
                                 optional: false,
                                 type: String,
                                 verify_block: proc do |value|
                                   Tools.error("plan不能为空") unless (value and not value.empty?)
                                   ENV["R_APP_PLAN"] = value.to_s
                                 end),
    FastlaneCore::ConfigItem.new(key: :config,
                                 env_name: 'R_APP_CONFIG',
                                 description: '打包环境:Debug/Release',
                                 optional: false,
                                 type: String,
                                 default_value: "Debug",
                                 verify_block: proc do |value|
                                   Tools.error("config不能为空") unless (value and not value.empty?)
                                   Tools.error("config没有#{value}选项") unless (value == "Debug" or value == "Release")
                                   ENV["R_APP_CONFIG"] = value.to_s
                                 end),
    FastlaneCore::ConfigItem.new(key: :channel,
                                 env_name: 'R_APP_CHANNEL',
                                 description: '打包方式:APP_STORE/DEVELOPMENT',
                                 optional: false,
                                 type: String,
                                 default_value: "DEVELOPMENT",
                                 verify_block: proc do |value|
                                   Tools.error("channel不能为空") unless (value and not value.empty?)
                                   ENV["R_APP_CHANNEL"] = value.to_s
                                 end),
    FastlaneCore::ConfigItem.new(key: :build,
                                 env_name: 'R_APP_BUILD',
                                 description: 'build number',
                                 optional: false,
                                 type: Integer,
                                 verify_block: proc do |value|
                                   ENV["R_APP_BUILD"] = value.to_s
                                 end),
    FastlaneCore::ConfigItem.new(key: :note,
                                 env_name: 'R_APP_NOTE',
                                 description: '打包日志',
                                 optional: false,
                                 type: String,
                                 verify_block: proc do |value|
                                   ENV["R_APP_NOTE"] = value.to_s
                                 end),

  ]
end

.descriptionObject



17
18
19
# File 'lib/fastlane/plugin/rocket/actions/app_action.rb', line 17

def self.description
  "APP打包"
end

.detailsObject



29
30
31
# File 'lib/fastlane/plugin/rocket/actions/app_action.rb', line 29

def self.details
  "开发者只能打开发者包,App Store包需要移步至rocket平台"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


95
96
97
98
99
100
101
# File 'lib/fastlane/plugin/rocket/actions/app_action.rb', line 95

def self.is_supported?(platform)
  # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
  # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
  #
  # [:ios, :mac, :android].include?(platform)
  true
end

.return_valueObject



25
26
27
# File 'lib/fastlane/plugin/rocket/actions/app_action.rb', line 25

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

.run(params) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/fastlane/plugin/rocket/actions/app_action.rb', line 7

def self.run(params)

  begin
    App::AppMain.run(params,available_options)
  rescue Exception => e
    Tools.error(e.message)
  end 
  Tools.title("完成!!!")
end