Class: Fastlane::Actions::BuildNumberSetToXcconfigAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::BuildNumberSetToXcconfigAction
- Defined in:
- lib/fastlane/plugin/yalantis_ci/actions/build_number_set_to_xcconfig.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .run(options) ⇒ Object
Class Method Details
.authors ⇒ Object
49 50 51 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/build_number_set_to_xcconfig.rb', line 49 def self. ["Dima Vorona", "Yalantis"] end |
.available_options ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/build_number_set_to_xcconfig.rb', line 25 def self. [ FastlaneCore::ConfigItem.new( key: :build_number, env_name: "BUILD_NUMBER", description: "Build number to be set to the .xcconfig", type: Integer ), FastlaneCore::ConfigItem.new( key: :xcconfig_path, env_name: "BUILD_NUMBER_XCCONFIG_PATH", description: "Path to the xcconfig file with Build Number", type: String, verify_block: proc do |value| UI.user_error!("Couldn't find .xcconfig file at path '#{value}'") unless File.exist?(File.(value)) end ) ] end |
.description ⇒ Object
21 22 23 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/build_number_set_to_xcconfig.rb', line 21 def self.description "Stores a specified Build Number in the passed xcconfig" end |
.is_supported?(platform) ⇒ Boolean
53 54 55 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/build_number_set_to_xcconfig.rb', line 53 def self.is_supported?(platform) [:ios, :mac].include?(platform) end |
.output ⇒ Object
45 46 47 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/build_number_set_to_xcconfig.rb', line 45 def self.output [] end |
.run(options) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/build_number_set_to_xcconfig.rb', line 6 def self.run() build_number = [:build_number] path = [:xcconfig_path] File.open(path, 'r+') do |file| contents = file.read unless contents.nil? contents.gsub!(/(?<=\bCURRENT_PROJECT_VERSION\s=\s)([\d]+)/, build_number.to_s) file.truncate(0) file.write(contents) end end end |