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
47 48 49 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/build_number_set_to_xcconfig.rb', line 47 def self. ["Dima Vorona", "Yalantis"] end |
.available_options ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/build_number_set_to_xcconfig.rb', line 22 def self. [ FastlaneCore::ConfigItem.new( key: :build_number, env_name: "BUILD_NUMBER", description: "Build number to be set to the .xcconfig", optional: true, 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
18 19 20 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/build_number_set_to_xcconfig.rb', line 18 def self.description "Stores a specified Build Number in the passed xcconfig" end |
.is_supported?(platform) ⇒ Boolean
51 52 53 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/build_number_set_to_xcconfig.rb', line 51 def self.is_supported?(platform) [:ios, :mac].include?(platform) end |
.output ⇒ Object
43 44 45 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/build_number_set_to_xcconfig.rb', line 43 def self.output [] end |
.run(options) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/fastlane/plugin/yalantis_ci/actions/build_number_set_to_xcconfig.rb', line 6 def self.run() build_number = [:build_number] || Actions.lane_context[SharedValues::BUILD_NUMBER] path = [:xcconfig_path] if build_number.nil? UI.error("build_number can't be nil") else contents = File.readlines(path).join.gsub!(/(?<=\bCURRENT_PROJECT_VERSION\s=\s)([\d]+)/, build_number.to_s) File.write(path, contents) unless contents.nil? end end |