Class: Fastlane::Actions::UpdateUrbanAirshipConfigurationAction
- Inherits:
-
Fastlane::Action
- Object
- Fastlane::Action
- Fastlane::Actions::UpdateUrbanAirshipConfigurationAction
- Defined in:
- fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb
Constant Summary
Constants inherited from Fastlane::Action
Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .category ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .example_code ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .run(params) ⇒ Object
Methods inherited from Fastlane::Action
action_name, author, deprecated_notes, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text
Class Method Details
.authors ⇒ Object
67 68 69 |
# File 'fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb', line 67 def self. ["kcharwood"] end |
.available_options ⇒ Object
31 32 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 |
# File 'fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb', line 31 def self. [ FastlaneCore::ConfigItem.new(key: :plist_path, env_name: "URBAN_AIRSHIP_PLIST_PATH", description: "Path to Urban Airship configuration Plist", verify_block: proc do |value| UI.user_errror!("Could not find Urban Airship plist file") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :development_app_key, optional: true, env_name: "URBAN_AIRSHIP_DEVELOPMENT_APP_KEY", sensitive: true, description: "The development app key"), FastlaneCore::ConfigItem.new(key: :development_app_secret, optional: true, env_name: "URBAN_AIRSHIP_DEVELOPMENT_APP_SECRET", sensitive: true, description: "The development app secret"), FastlaneCore::ConfigItem.new(key: :production_app_key, optional: true, env_name: "URBAN_AIRSHIP_PRODUCTION_APP_KEY", sensitive: true, description: "The production app key"), FastlaneCore::ConfigItem.new(key: :production_app_secret, optional: true, env_name: "URBAN_AIRSHIP_PRODUCTION_APP_SECRET", sensitive: true, description: "The production app secret"), FastlaneCore::ConfigItem.new(key: :detect_provisioning_mode, env_name: "URBAN_AIRSHIP_DETECT_PROVISIONING_MODE", type: Boolean, optional: true, description: "Automatically detect provisioning mode") ] end |
.category ⇒ Object
85 86 87 |
# File 'fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb', line 85 def self.category :push end |
.description ⇒ Object
23 24 25 |
# File 'fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb', line 23 def self.description "Set [Urban Airship](https://www.urbanairship.com/) plist configuration values" end |
.details ⇒ Object
27 28 29 |
# File 'fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb', line 27 def self.details "This action updates the `AirshipConfig.plist` needed to configure the Urban Airship SDK at runtime, allowing keys and secrets to easily be set for the Enterprise and Production versions of the application." end |
.example_code ⇒ Object
75 76 77 78 79 80 81 82 83 |
# File 'fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb', line 75 def self.example_code [ 'update_urban_airship_configuration( plist_path: "AirshipConfig.plist", production_app_key: "PRODKEY", production_app_secret: "PRODSECRET" )' ] end |
.is_supported?(platform) ⇒ Boolean
71 72 73 |
# File 'fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb', line 71 def self.is_supported?(platform) platform == :ios end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb', line 4 def self.run(params) require "plist" begin path = File.(params[:plist_path]) plist = Plist.parse_xml(path) plist['developmentAppKey'] = params[:development_app_key] unless params[:development_app_key].nil? plist['developmentAppSecret'] = params[:development_app_secret] unless params[:development_app_secret].nil? plist['productionAppKey'] = params[:production_app_key] unless params[:production_app_key].nil? plist['productionAppSecret'] = params[:production_app_secret] unless params[:production_app_secret].nil? plist['detectProvisioningMode'] = params[:detect_provisioning_mode] unless params[:detect_provisioning_mode].nil? new_plist = plist.to_plist File.write(path, new_plist) rescue => ex UI.error(ex) UI.error("Unable to update Urban Airship configuration for plist file at '#{path}'") end end |