fastlane-plugin-apptics 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43a74d0a2389519e0ee30b3bf62cc3af5173b4a685415ab2f513be754c433370
4
- data.tar.gz: e1603f1d1e0d00e54b8d5a5adcf8a025f2ea68611f4546e60030103d753d9fb7
3
+ metadata.gz: fd305ff780b399f51584bfd1c7d70546aae0b69304b2561dee3e98a93d537936
4
+ data.tar.gz: 2a70a81e4294a45490227ae251b461ce038da02c17851cf7943b0a417fd7eac8
5
5
  SHA512:
6
- metadata.gz: ed606bc65f8aa4784bab0d379ff31a4537ae3f25906e223a68f94a347e7300725313e8c66f8f57529999ac13d75ae8f73d219836e01b530bec2f9f479bb67861
7
- data.tar.gz: 486d02dee328bda38c83901e54b095f46e915afb3a9685e9ca2691f40d595168b3b8b79a156c4dfb04aaf6504af232ca077737c1f13e2a3dc6fdb906bb22d3fc
6
+ metadata.gz: fbfedb73529cfad37e8224a6b8a8fa13631e72bf6d8b4534c6d897452c45abb4be87cf51913f939f5d3148679fcf6a76c21c5ea0e86ea1624c0881154952681b
7
+ data.tar.gz: 49205174044a27184d4bfbcdea05df6158452dfcb0e4450ca02baf82100d4e04be8d242ab7824ee841185d3dec8001eb3426ad7ba677d8aefee2850f3e10fcc7
@@ -1,21 +1,25 @@
1
+
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  module SharedValues
4
6
  UPLOAD_DSYM_TO_APPTICS_CUSTOM_VALUE = :UPLOAD_DSYM_TO_APPTICS_CUSTOM_VALUE
5
7
  end
6
-
8
+
7
9
  class UploadDsymToAppticsAction < Action
8
-
10
+
9
11
  def self.run(params)
10
-
11
- if params[:APP_VERSION] && params[:BUILD_VERSION] && params[:DSYM_FILE_PATH] && options_from_info_plist(params[:CONFIG_FILE_PATH]) != nil
12
-
12
+
13
+ if params[:APP_VERSION] && params[:MODE_VALUE] && params[:PLATFORM_VALUE] && params[:BUNDLE_ID] && params[:BUILD_VERSION] && params[:DSYM_FILE_PATH] && options_from_info_plist(params[:CONFIG_FILE_PATH]) != nil
13
14
  dsym_zip_file = params[:DSYM_FILE_PATH]
14
15
  app_version = params[:APP_VERSION]
15
16
  build_version = params[:BUILD_VERSION]
17
+ mode_value = params[:MODE_VALUE]
18
+ platform_value = params[:PLATFORM_VALUE]
19
+ bundleid = params[:BUNDLE_ID]
16
20
  config_file = options_from_info_plist(params[:CONFIG_FILE_PATH])
17
- upload(config_file, dsym_zip_file,app_version,build_version)
18
-
21
+ upload(config_file, dsym_zip_file,app_version,build_version,mode_value,platform_value,bundleid)
22
+
19
23
  end
20
24
  end
21
25
  def self.valid_json?(string)
@@ -23,18 +27,47 @@ module Fastlane
23
27
  rescue JSON::ParserError
24
28
  false
25
29
  end
26
-
27
- def self.upload(apptics_config, dsym_zip_file,app_version,build_version)
30
+
31
+ def self.upload(apptics_config, dsym_zip_file,app_version,build_version,mode_value,platform_value,bundleid)
28
32
  api_key = apptics_config[:API_KEY]
29
33
  server_url = apptics_config[:SERVER_URL]
30
34
  bundle_id = apptics_config[:BUNDLE_ID]
35
+
36
+ puts "bundleid #{bundleid}"
37
+ puts "mode_value #{mode_value}"
38
+ puts "platform_value #{platform_value}"
39
+ #check mode value empty or nil
40
+ if mode_value.nil? || mode_value.empty?
41
+ puts "mode_value is empty or nil "
42
+ mode_value = 1
43
+ else
44
+ puts "mode_value is not empty"
45
+ end
46
+ #check platform value empty or nil
47
+
48
+ if platform_value.nil? || platform_value.empty?
49
+ puts "platform_value is empty or nil "
50
+ platform_value = 'iOS'
51
+
52
+ else
53
+ puts "platform_value is not empty"
54
+ end
55
+ #check bundleid from config file is equals to the fastfile bundleid
56
+
57
+ if bundleid == bundle_id
58
+ else
59
+ UI.error "ABORTED! BUNDLE_ID mismatch replace #{bundle_id} to #{bundleid} "
60
+ exit(true)
61
+ end
62
+ puts "mode_value #{mode_value}"
31
63
  puts"dsym_zip_file #{dsym_zip_file}"
32
64
  puts "api_key #{api_key}"
33
- server_url = "#{server_url}/api/janalytic/v3/addDsymfile?mode=1&platform=iOS&identifier=#{bundle_id}&appversion=#{app_version}&host=macbuild&remoteaddress=192.168.113.85&buildversion=#{build_version}&minosversion=10.13&frameworkversion=1.2.1"
34
-
35
-
65
+
66
+ server_url = "#{server_url}/api/janalytic/v3/addDsymfile?mode=#{mode_value}&platform=#{platform_value}&identifier=#{bundle_id}&appversion=#{app_version}&host=&remoteaddress=&buildversion=#{build_version}&minosversion=&frameworkversion=#{Apptics::VERSION}"
67
+
68
+
36
69
  puts "server_url #{server_url}"
37
-
70
+
38
71
  url = URI.parse(server_url)
39
72
  File.open(dsym_zip_file) do |zip|
40
73
  req = Net::HTTP::Post.new(url)
@@ -44,7 +77,7 @@ module Fastlane
44
77
  res = Net::HTTP.start(url.host, url.port, use_ssl: true, open_timeout:60, read_timeout: 300) do |http|
45
78
  http.request(req)
46
79
  end
47
-
80
+
48
81
  # Status
49
82
  puts res.code # => '200'
50
83
  puts res.class.name # => 'HTTPOK'
@@ -63,41 +96,62 @@ module Fastlane
63
96
  end
64
97
  end
65
98
  end
66
-
99
+
67
100
  #####################################################
68
101
  # @!group Documentation
69
102
  #####################################################
70
-
103
+
71
104
  def self.description
72
105
  "A short description with <= 80 characters of what this action does"
73
106
  end
74
-
107
+
75
108
  def self.details
76
109
  # Optional:
77
110
  # this is your chance to provide a more detailed description of this action
78
111
  "You can use this action to do cool things..."
79
112
  end
80
-
113
+
81
114
  def self.available_options
82
115
  # Define all options your action supports.
83
-
116
+
84
117
  # Below a few examples
85
118
  [
86
119
  FastlaneCore::ConfigItem.new(key: :APP_VERSION,
87
120
  env_name: "APP_VERSION", # The name of the environment variable
88
- description: "App Version Token for UploadDsymToAppticsAction", # a short description of this parameter
121
+ description: "App Version needed for UploadDsymToAppticsAction", # a short description of this parameter
89
122
  verify_block: proc do |value|
90
123
  UI.user_error!("No App Version for UploadDsymToAppticsAction given") unless (value and not value.empty?)
91
124
  end),
92
-
125
+
93
126
  FastlaneCore::ConfigItem.new(key: :DSYM_FILE_PATH,
94
127
  env_name: "DSYM_FILE_PATH", # The name of the environment variable
95
- description: "API Token for UploadDsymToAppticsAction", # a short description of this parameter
128
+ description: "DSYM path for UploadDsymToAppticsAction", # a short description of this parameter
96
129
  verify_block: proc do |value|
97
- UI.user_error!("No API token for UploadDsymToAppticsAction given, pass using `api_token: 'token'`") unless (value and not value.empty?)
130
+ UI.user_error!("No DSYM path for UploadDsymToAppticsAction given, pass using `api_token: 'token'`") unless (value and not value.empty?)
98
131
  # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
99
132
  end),
100
-
133
+ FastlaneCore::ConfigItem.new(key: :MODE_VALUE,
134
+ env_name: "MODE_VALUE", # The name of the environment variable
135
+ description: "mode for UploadDsymToAppticsAction", # a short description of this parameter
136
+ verify_block: proc do |value|
137
+ #UI.user_error!("mode for UploadDsymToAppticsAction given, pass using `api_token: 'token'`") unless (value and not value.empty?)
138
+ # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
139
+ end),
140
+ FastlaneCore::ConfigItem.new(key: :PLATFORM_VALUE,
141
+ env_name: "PLATFORM_VALUE", # The name of the environment variable
142
+ description: "platform for UploadDsymToAppticsAction", # a short description of this parameter
143
+ verify_block: proc do |value|
144
+ #UI.user_error!("mode for UploadDsymToAppticsAction given, pass using `api_token: 'token'`") unless (value and not value.empty?)
145
+ # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
146
+ end),
147
+ FastlaneCore::ConfigItem.new(key: :BUNDLE_ID,
148
+ env_name: "BUNDLE_ID", # The name of the environment variable
149
+ description: "bundleid for UploadDsymToAppticsAction", # a short description of this parameter
150
+ verify_block: proc do |value|
151
+ #UI.user_error!("mode for UploadDsymToAppticsAction given, pass using `api_token: 'token'`") unless (value and not value.empty?)
152
+ # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
153
+ end),
154
+
101
155
  FastlaneCore::ConfigItem.new(key: :BUILD_VERSION,
102
156
  env_name: "BUILD_VERSION]", # The name of the environment variable
103
157
  description: "Build version for UploadDsymToAppticsAction", # a short description of this parameter
@@ -105,17 +159,18 @@ module Fastlane
105
159
  UI.user_error!("No Build version for UploadDsymToAppticsAction given") unless (value and not value.empty?)
106
160
  # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
107
161
  end),
108
-
162
+
109
163
  FastlaneCore::ConfigItem.new(key: :CONFIG_FILE_PATH,
110
164
  env_name: "CONFIG_FILE_PATH", # The name of the environment variable
111
165
  description: "Config File for UploadDsymToAppticsAction", # a short description of this parameter
112
166
  verify_block: proc do |value|
113
167
  UI.user_error!("No Config File for UploadDsymToAppticsAction given") unless (value and not value.empty?)
114
168
  # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
115
- end)
169
+ end)
170
+
116
171
  ]
117
172
  end
118
-
173
+
119
174
  def self.output
120
175
  # Define the shared values you are going to provide
121
176
  # Example
@@ -123,45 +178,39 @@ module Fastlane
123
178
  ['UPLOAD_DSYM_TO_APPTICS_CUSTOM_VALUE', 'A description of what this value contains']
124
179
  ]
125
180
  end
126
-
181
+
127
182
  def self.options_from_info_plist file_path
128
-
183
+
129
184
  plist_getter = Fastlane::Actions::GetInfoPlistValueAction
130
185
  api_key = plist_getter.run(path: file_path, key: "API_KEY")
131
186
  server_url = plist_getter.run(path: file_path, key: "SERVER_URL")
132
187
  app_version_meta = plist_getter.run(path: file_path, key: "APP_VERSION_META")
133
188
  bundle_id = plist_getter.run(path: file_path, key: "BUNDLE_ID")
134
-
189
+
135
190
  {
136
191
  API_KEY: api_key,
137
192
  SERVER_URL:server_url,
138
193
  BUNDLE_ID:bundle_id,
139
194
  APP_VERSION_META: app_version_meta
140
195
  }
141
-
142
-
196
+
197
+
143
198
  end
144
-
145
-
146
-
199
+
200
+
201
+
147
202
  def self.return_value
148
203
  # If your method provides a return value, you can describe here what it does
149
204
  end
150
-
205
+
151
206
  def self.authors
152
207
  # So no one will ever forget your contribution to fastlane :) You are awesome btw!
153
208
  ["Your GitHub/Twitter Name"]
154
209
  end
155
-
210
+
156
211
  def self.is_supported?(platform)
157
212
  [:ios, :mac, :tvos].include?(platform)
158
213
  end
159
214
  end
160
215
  end
161
216
  end
162
-
163
-
164
-
165
-
166
-
167
-
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Apptics
3
- VERSION = "1.0.2"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-apptics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaikarthick R
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-16 00:00:00.000000000 Z
11
+ date: 2022-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler