File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
lib/fastlane/plugin/wpmreleasetoolkit/actions/ios Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,16 @@ def self.run(params)
12
12
)
13
13
payload . add_metric ( name : 'File Size' , value : File . size ( params [ :ipa_path ] ) )
14
14
15
- if File . exist? ( params [ :app_thinning_plist_path ] )
16
- plist = Plist . parse_xml ( params [ :app_thinning_plist_path ] )
17
- payload . add_metric ( name : 'plist' , value : plist ) # TODO: Parse the actual plist
15
+ app_thinning_plist_path = params [ :app_thinning_plist_path ] || File . join ( File . dirname ( params [ :ipa_path ] ) , 'app-thinning.plist' )
16
+ if File . exist? ( app_thinning_plist_path )
17
+ plist = Plist . parse_xml ( app_thinning_plist_path )
18
+ plist [ 'variants' ] . each do |_key , variant |
19
+ # FIXME: We should probably not take only the first `variantDescriptor` from the list. But that'll do for now as a draft implementation.
20
+ vd = variant [ 'variantDescriptors' ] &.first
21
+ variant_metadata = vd . nil? ? { device : 'Universal' } : { device : vd [ 'device' ] , 'OS Version' : vd [ 'os-version' ] }
22
+ payload . add_metric ( name : 'Download Size' , value : variant [ 'sizeCompressedApp' ] , meta : variant_metadata )
23
+ payload . add_metric ( name : 'Install Size' , value : variant [ 'sizeUncompressedApp' ] , meta : variant_metadata )
24
+ end
18
25
end
19
26
20
27
payload . send_metrics (
You can’t perform that action at this time.
0 commit comments