Class: Fastlane::Actions::PlistValueAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::PlistValueAction
- Defined in:
- lib/fastlane/plugin/rearchive/actions/plist_value_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
37 38 39 |
# File 'lib/fastlane/plugin/rearchive/actions/plist_value_action.rb', line 37 def self. ["naoigcat"] end |
.available_options ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/fastlane/plugin/rearchive/actions/plist_value_action.rb', line 41 def self. [ FastlaneCore::ConfigItem.new(key: :archive_path, description: "The path of the .ipa or .xcarchive to be modified", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :plist_path, description: "The name of the .plist file to modify, relative to the .app bundle", optional: true, default_value: "Info.plist", type: String), FastlaneCore::ConfigItem.new(key: :plist_values, description: "Hash of plist values to set to the plist file", optional: false, type: Hash) ] end |
.description ⇒ Object
33 34 35 |
# File 'lib/fastlane/plugin/rearchive/actions/plist_value_action.rb', line 33 def self.description "Overwrite values of .plists inside .ipa/.xcarchive" end |
.is_supported?(platform) ⇒ Boolean
61 62 63 |
# File 'lib/fastlane/plugin/rearchive/actions/plist_value_action.rb', line 61 def self.is_supported?(platform) [:ios].include?(platform) end |
.run(params) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fastlane/plugin/rearchive/actions/plist_value_action.rb', line 10 def self.run(params) archive_path = File.(params[:archive_path]) raise "Archive path #{archive_path} does not exist" unless File.exist?(archive_path) if File.directory?(archive_path) archive = RearchiveHelper::XCArchive.new(archive_path) else archive = RearchiveHelper::IPAArchive.new(archive_path) end if params[:plist_path] plist_path = archive.app_path(params[:plist_path]) else plist_path = archive.app_path("Info.plist") end FastlaneCore::UI.("Patching Plist: #{plist_path}") archive.extract(plist_path) plist_buddy = RearchiveHelper::PlistBuddy.new(archive.local_path(plist_path)) params[:plist_values].each do |key, value| plist_buddy.exec("Set #{key} #{value}") end archive.replace(plist_path) end |