Class: Fastlane::Actions::FivIncrementBuildNoAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::FivIncrementBuildNoAction
- Defined in:
- lib/fastlane/plugin/fiv_increment_build_no/actions/fiv_increment_build_no_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
49 50 51 |
# File 'lib/fastlane/plugin/fiv_increment_build_no/actions/fiv_increment_build_no_action.rb', line 49 def self. ["Gary Großgarten"] end |
.available_options ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/fastlane/plugin/fiv_increment_build_no/actions/fiv_increment_build_no_action.rb', line 62 def self. [ FastlaneCore::ConfigItem.new(key: :ios, env_name: "FIV_INCREMENT_BUILD_NO_IOS", description: "---", optional: false, type: Boolean), FastlaneCore::ConfigItem.new(key: :pathToConfigXML, env_name: "FIV_INCREMENT_BUILD_CONFIG", description: "---", optional: false, verify_block: proc do | value | UI.user_error!("Couldnt find config.xml! Please change your path.") unless File.exist?(value) end , type: String) ] end |
.description ⇒ Object
45 46 47 |
# File 'lib/fastlane/plugin/fiv_increment_build_no/actions/fiv_increment_build_no_action.rb', line 45 def self.description "fastlane plugin for ionic 4" end |
.details ⇒ Object
57 58 59 60 |
# File 'lib/fastlane/plugin/fiv_increment_build_no/actions/fiv_increment_build_no_action.rb', line 57 def self.details # Optional: "" end |
.is_supported?(platform) ⇒ Boolean
80 81 82 83 84 85 86 |
# File 'lib/fastlane/plugin/fiv_increment_build_no/actions/fiv_increment_build_no_action.rb', line 80 def self.is_supported?(platform) # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example) # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform # # [:ios, :mac, :android].include?(platform) true end |
.return_value ⇒ Object
53 54 55 |
# File 'lib/fastlane/plugin/fiv_increment_build_no/actions/fiv_increment_build_no_action.rb', line 53 def self.return_value # If your method provides a return value, you can describe here what it does end |
.run(params) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/fastlane/plugin/fiv_increment_build_no/actions/fiv_increment_build_no_action.rb', line 7 def self.run(params) UI.("The fiv_increment_build_no plugin is working!") text = File.read("./config.xml") isIos = params[:ios] if (isIos) app_build_number = sh "echo \"cat //*[local-name()='widget']/@ios-CFBundleVersion\" | xmllint --shell #{params[:pathToConfigXML]}| awk -F'[=\"]' '!/>/{print $(NF-1)}'" puts app_build_number.length if(app_build_number.length == 0) new_contents = text .gsub(/<widget /, "<widget ios-CFBundleVersion=\"#{1}\" ") else build_number = app_build_number.to_i + 1 new_contents = text .gsub(/ios-CFBundleVersion="[0-9]*"/, "ios-CFBundleVersion=\"#{build_number}\"") end else app_build_number = sh "echo \"cat //*[local-name()='widget']/@android-versionCode\" | xmllint --shell #{params[:pathToConfigXML]}| awk -F'[=\"]' '!/>/{print $(NF-1)}'" puts app_build_number.length if(app_build_number.length == 0) new_contents = text .gsub(/<widget /, "<widget android-versionCode=\"#{1}\" ") else build_number = app_build_number.to_i + 1 new_contents = text .gsub(/android-versionCode="[0-9]*"/, "android-versionCode=\"#{build_number}\"") end end puts build_number File.open("./config.xml", "w") {|file| file.puts new_contents} end |