Class: Fastlane::Actions::WritePropertiesFileAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/properties/actions/write_properties_file.rb

Class Method Summary collapse

Class Method Details

.authorsObject



16
17
18
# File 'lib/fastlane/plugin/properties/actions/write_properties_file.rb', line 16

def self.authors
  ["Pavlo Pakholka"]
end

.available_optionsObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fastlane/plugin/properties/actions/write_properties_file.rb', line 29

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :key,
      env_name: "PROPERIES_WRITE_HASH_MAP",
      description: "Hashmap you want to convert and write to file",
      optional: false,
      type: Hash),
    FastlaneCore::ConfigItem.new(key: :path,
      env_name: "PROPERIES_WRITE_HASH_PATH",
      description: "Path to .properies file you want to update",
      type: String,
      optional: false,
      verify_block: proc do |value|
        UI.user_error!("Couldn't find .properties file at path '#{value}'") unless File.exist?(File.expand_path(value))
      end)
  ]
end

.descriptionObject



12
13
14
# File 'lib/fastlane/plugin/properties/actions/write_properties_file.rb', line 12

def self.description
  "Write any Hash-like structure as a properties file. This action won't create a new file."
end

.detailsObject



24
25
26
27
# File 'lib/fastlane/plugin/properties/actions/write_properties_file.rb', line 24

def self.details
  # Optional:
  ""
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


47
48
49
50
51
52
53
# File 'lib/fastlane/plugin/properties/actions/write_properties_file.rb', line 47

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_valueObject



20
21
22
# File 'lib/fastlane/plugin/properties/actions/write_properties_file.rb', line 20

def self.return_value
  ''
end

.run(params) ⇒ Object



7
8
9
10
# File 'lib/fastlane/plugin/properties/actions/write_properties_file.rb', line 7

def self.run(params)
  content = JavaProperties.write(params[:hash], params[:path])
  return content
end