class Fastlane::Actions::PropertyFileWriteAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/property_file_write/actions/property_file_write_action.rb, line 31
def self.authors
  ["Jan Meier"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/property_file_write/actions/property_file_write_action.rb, line 44
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :file,
          env_name: "PROPERTY_FILE_WRITE_FILE",
       description: "Property file to write",
          optional: false,
              type: String),
    FastlaneCore::ConfigItem.new(key: :key,
          env_name: "PROPERTY_FILE_WRITE_KEY",
       description: "Property key of file to alter",
          optional: false,
              type: String),
    FastlaneCore::ConfigItem.new(key: :value,
          env_name: "PROPERTY_FILE_WRITE_VALUE",
       description: "Value of property to set",
          optional: false,
              type: String)
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/property_file_write/actions/property_file_write_action.rb, line 27
def self.description
  "Writes value into properties file"
end
details() click to toggle source
# File lib/fastlane/plugin/property_file_write/actions/property_file_write_action.rb, line 39
def self.details
  # Optional:
  "Writes into property files. Used mostly in Android development as configuration files for gradle builds."
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/property_file_write/actions/property_file_write_action.rb, line 64
def self.is_supported?(platform)
  # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
  # See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
  #
  # [:ios, :mac, :android].include?(platform)
  true
end
return_value() click to toggle source
# File lib/fastlane/plugin/property_file_write/actions/property_file_write_action.rb, line 35
def self.return_value
  # If your method provides a return value, you can describe here what it does
end
run(params) click to toggle source
# File lib/fastlane/plugin/property_file_write/actions/property_file_write_action.rb, line 9
def self.run(params)

  property_file = params[:file]

  property_key = params[:key]
  property_value = params[:value]

  # read in content of file
  content = JavaProperties.load(property_file)

  # alter content
  content[property_key.to_sym] = property_value

  # save back to file
  JavaProperties.write(content, property_file)
  true
end