Class: Fastlane::Actions::XamarinUpdateConfigurationAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::XamarinUpdateConfigurationAction
- Defined in:
- lib/fastlane/plugin/xamarin_build/actions/xamarin_update_configuration.rb
Documentation collapse
- TARGET =
['Release', 'Debug', 'Ad-Hoc', 'AppStore'].freeze
- PLATFORM =
%w(iPhone iPhoneSimulator AnyCPU).freeze
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .return_value ⇒ Object
Class Method Summary collapse
Class Method Details
.authors ⇒ Object
93 94 95 |
# File 'lib/fastlane/plugin/xamarin_build/actions/xamarin_update_configuration.rb', line 93 def self. ['punksta'] end |
.available_options ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/fastlane/plugin/xamarin_build/actions/xamarin_update_configuration.rb', line 45 def self. [ FastlaneCore::ConfigItem.new(key: :xamarin_project_file, env_name: 'FL_XAMARIN_UPDATE_CONFIGURATION_XAMARIN_PROJECT', description: 'path to xamarin .csproj project file', is_string: true, verify_block: proc do |value| UI.user_error!('Project file not found') unless File.exist? value end), FastlaneCore::ConfigItem.new(key: :target, env_name: 'FL_XAMARIN_UPDATE_CONFIGURATION_TARGET', description: 'Target of configuration PropertyGroup', is_string: true, verify_block: proc do |value| UI.user_error!("Unsupported target! Use one of #{TARGET}") unless TARGET.include? value end), FastlaneCore::ConfigItem.new(key: :platform, env_name: 'FL_XAMARIN_UPDATE_CONFIGURATION_PLATFORM', description: 'platform of configuration PropertyGroup', is_string: true, verify_block: proc do |value| UI.user_error!("Unsupported platform! use one of #{PLATFORM}") unless PLATFORM.include? value end), FastlaneCore::ConfigItem.new(key: :property, env_name: 'FL_XAMARIN_UPDATE_CONFIGURATION_PROPERTY', description: 'property in PropertyGroup', is_string: true), FastlaneCore::ConfigItem.new(key: :value, env_name: 'FL_XAMARIN_UPDATE_CONFIGURATION_VALUE', description: 'value of property', is_string: true, verify_block: proc do |value| UI.user_error!('Empty value') if value.nil? end) ] end |
.description ⇒ Object
34 35 36 |
# File 'lib/fastlane/plugin/xamarin_build/actions/xamarin_update_configuration.rb', line 34 def self.description 'Set properties of specific build configuration in Xamarin configuration file' end |
.details ⇒ Object
38 39 40 |
# File 'lib/fastlane/plugin/xamarin_build/actions/xamarin_update_configuration.rb', line 38 def self.details "You can use set properties like provision profile(CodesignProvision) and certificate name(CodesignKey)" \ end |
.is_supported?(platform) ⇒ Boolean
97 98 99 |
# File 'lib/fastlane/plugin/xamarin_build/actions/xamarin_update_configuration.rb', line 97 def self.is_supported?(platform) platform == :ios || platform == :android end |
.output ⇒ Object
86 87 |
# File 'lib/fastlane/plugin/xamarin_build/actions/xamarin_update_configuration.rb', line 86 def self.output end |
.return_value ⇒ Object
89 90 91 |
# File 'lib/fastlane/plugin/xamarin_build/actions/xamarin_update_configuration.rb', line 89 def self.return_value 'build artifact dir path or null if can not find it' end |
.run(params) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/fastlane/plugin/xamarin_build/actions/xamarin_update_configuration.rb', line 9 def self.run(params) project_path = params[:xamarin_project_file] doc = nil File.new(project_path) do |file| doc = Nokogiri::XML(file) end configuration = "'#{params[:target]}|#{params[:platform]}'" doc.search('PropertyGroup').each do |group| next unless !group['Condition'].nil? && group['Condition'].include?(configuration) propery = group.search(params[:property]) if propery.size > 0 propery[0].content = params[:value] end end File.write(project_path, doc.to_xml) end |