Class: Fastlane::Actions::XcsizeDiffAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::XcsizeDiffAction
- Defined in:
- lib/fastlane/plugin/xcsize/actions/xcsize_diff_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .example_code ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
24 25 26 |
# File 'lib/fastlane/plugin/xcsize/actions/xcsize_diff_action.rb', line 24 def self. ['Alexey Alter-Pesotskiy'] end |
.available_options ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/fastlane/plugin/xcsize/actions/xcsize_diff_action.rb', line 28 def self. [ FastlaneCore::ConfigItem.new( key: :old_linkmap, description: 'Set old linkmap path', is_string: true, optional: false ), FastlaneCore::ConfigItem.new( key: :new_linkmap, description: 'Set new linkmap path', is_string: true, optional: false ), FastlaneCore::ConfigItem.new( key: :threshold, description: 'Set minimum size difference threshold in bytes', is_string: false, optional: true ) ] end |
.description ⇒ Object
20 21 22 |
# File 'lib/fastlane/plugin/xcsize/actions/xcsize_diff_action.rb', line 20 def self.description 'Compare two iOS and macOS binary sizes using linkmaps.' end |
.example_code ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/fastlane/plugin/xcsize/actions/xcsize_diff_action.rb', line 51 def self.example_code [ 'report = xcsize_diff( old_linkmap: "path/to/your/old_linkmap.txt", new_linkmap: "path/to/your/new_linkmap.txt", threshold: 1024 ) p report[:old_total_size] p report[:new_total_size] p report[:difference] p report[:details]' ] end |
.is_supported?(platform) ⇒ Boolean
65 66 67 |
# File 'lib/fastlane/plugin/xcsize/actions/xcsize_diff_action.rb', line 65 def self.is_supported?(platform) [:ios, :mac].include?(platform) end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/fastlane/plugin/xcsize/actions/xcsize_diff_action.rb', line 4 def self.run(params) Actions.verify_gem!('xcsize') require 'xcsize' = {} params.all_keys.each { |k| [k] = params[k] } comparator = ::Xcsize::Comparator.new( old_linkmap_path: [:old_linkmap], new_linkmap_path: [:new_linkmap], threshold: [:threshold] ) comparator.compare end |