fastlane-plugin-properties 0.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0a8ac1e69cf133ac155ad591626f376fef45a7c2
4
- data.tar.gz: 92885864e9474af63971a90cc378920ca410b1f5
2
+ SHA256:
3
+ metadata.gz: 2aa93e94b2bcf6b8d84a1b9f2c2249c16bc418b3bc3f8ad2d44be5aba2823b7d
4
+ data.tar.gz: a88eace38425870d601b2d8f92b0a6bf343d52fd46c28db6f6b08598db516572
5
5
  SHA512:
6
- metadata.gz: 8e2e199f5baee8a0c5cce5fdf50f6529c18e9ba98cd2c244f88952e6975292c126ade7fbe1c216445744cbf2b28dcf3807a9a0692a388c4d03db1cc32157bf38
7
- data.tar.gz: b05b000e8e878d4639148031e944884201c32a156ff4d38f8c7b8fd5c506a1fdb01c944764cc7d14f0013d04656e351e3449e5fadfc339ec87a79fc61297e89d
6
+ metadata.gz: 97498e511ed97cb975277690c4b2a02c2ea6bac6998b9cc171c96959f277a35beed9a5c540ddc9a95c9e41b529390539bd79c1f60618fa806009b9b4cca72bc3
7
+ data.tar.gz: b7dd159b6ff260a2118afca6e7b96bffea619adb0501f75beb066664b10f3fd252e98e3fbf28e6b7a5d68b25ac06d3dadf05ef2354cea1bb14df77336797f50a
data/README.md CHANGED
@@ -13,8 +13,11 @@ fastlane add_plugin properties
13
13
  ## About properties
14
14
 
15
15
  Adds 2 actions to fastlane to read and update properties files.
16
+ Adds 2 actions to read/write the whole properties file.
16
17
  Adds 2 more actions to increase versionCode and versionName fast.
17
18
 
19
+ Your file does not require to be `.properties`. This plugin can work with any file which content is in the `KEY=VALUE` format, ie `.env` files or etc.
20
+
18
21
  ## Example
19
22
 
20
23
  ```ruby
@@ -48,20 +51,18 @@ lane :test do
48
51
  update_type: "minor"
49
52
  )
50
53
 
51
- end
52
- ```
53
-
54
- ## Run tests for this plugin
55
-
56
- To run both the tests, and code style validation, run
54
+ # Read the versions.properties file and sttore it as a hash-map in the content variable
55
+ content = parse_properties_file(
56
+ path: "./Configs/versions.properties"
57
+ )
57
58
 
58
- ```
59
- rake
60
- ```
59
+ # Rewrites your versions.properties with new data, generated from some_hash
60
+ write_properties_file(
61
+ path: "./Configs/versions.properties",
62
+ hash: some_hash
63
+ )
61
64
 
62
- To automatically fix many of the styling issues, use
63
- ```
64
- rubocop -a
65
+ end
65
66
  ```
66
67
 
67
68
  ## Issues and Feedback
@@ -33,8 +33,7 @@ module Fastlane
33
33
  env_name: "PROPERIES_GET_VALUE_PARAM_KEY",
34
34
  description: "Key of properie in .properties file",
35
35
  optional: false,
36
- type: String
37
- ),
36
+ type: String),
38
37
  FastlaneCore::ConfigItem.new(key: :path,
39
38
  env_name: "PROPERIES_GET_VALUE_PARAM_PATH",
40
39
  description: "Path to .properies file you want to update",
@@ -42,8 +41,7 @@ module Fastlane
42
41
  optional: false,
43
42
  verify_block: proc do |value|
44
43
  UI.user_error!("Couldn't find .properties file at path '#{value}'") unless File.exist?(File.expand_path(value))
45
- end
46
- )
44
+ end)
47
45
  ]
48
46
  end
49
47
 
@@ -36,8 +36,7 @@ module Fastlane
36
36
  env_name: "PROPERIES_GET_VALUE_PARAM_KEY",
37
37
  description: "Key of properie in .properties file",
38
38
  optional: false,
39
- type: String
40
- ),
39
+ type: String),
41
40
  FastlaneCore::ConfigItem.new(key: :path,
42
41
  env_name: "PROPERIES_GET_VALUE_PARAM_PATH",
43
42
  description: "Path to .properies file you want to update",
@@ -45,8 +44,7 @@ module Fastlane
45
44
  optional: false,
46
45
  verify_block: proc do |value|
47
46
  UI.user_error!("Couldn't find .properties file at path '#{value}'") unless File.exist?(File.expand_path(value))
48
- end
49
- )
47
+ end)
50
48
  ]
51
49
  end
52
50
 
@@ -23,7 +23,7 @@ module Fastlane
23
23
  end
24
24
 
25
25
  def self.return_value
26
- "New version name."
26
+ "New version name."
27
27
  end
28
28
 
29
29
  def self.details
@@ -37,8 +37,7 @@ module Fastlane
37
37
  env_name: "PROPERIES_GET_VALUE_PARAM_KEY",
38
38
  description: "Key of properie in .properties file",
39
39
  optional: false,
40
- type: String
41
- ),
40
+ type: String),
42
41
  FastlaneCore::ConfigItem.new(key: :path,
43
42
  env_name: "PROPERIES_GET_VALUE_PARAM_PATH",
44
43
  description: "Path to .properies file you want to update",
@@ -46,14 +45,12 @@ module Fastlane
46
45
  optional: false,
47
46
  verify_block: proc do |value|
48
47
  UI.user_error!("Couldn't find .properties file at path '#{value}'") unless File.exist?(File.expand_path(value))
49
- end
50
- ),
48
+ end),
51
49
  FastlaneCore::ConfigItem.new(key: :update_type,
52
50
  env_name: "PROPERIES_GET_VALUE_PARAM_KEY",
53
51
  description: "Key of properie in .properties file",
54
52
  optional: true,
55
- type: String
56
- )
53
+ type: String)
57
54
  ]
58
55
  end
59
56
 
@@ -0,0 +1,51 @@
1
+ require 'fastlane/action'
2
+ require 'java-properties'
3
+
4
+ module Fastlane
5
+ module Actions
6
+ class ParsePropertiesFileAction < Action
7
+ def self.run(params)
8
+ content = JavaProperties.load(params[:path])
9
+ return content
10
+ end
11
+
12
+ def self.description
13
+ "Load .properties file and returns it as a ruby hash-map."
14
+ end
15
+
16
+ def self.authors
17
+ ["Pavlo Pakholka"]
18
+ end
19
+
20
+ def self.return_value
21
+ 'Content of properties file.'
22
+ end
23
+
24
+ def self.details
25
+ # Optional:
26
+ ""
27
+ end
28
+
29
+ def self.available_options
30
+ [
31
+ FastlaneCore::ConfigItem.new(key: :path,
32
+ env_name: "PROPERIES_READ_HASH_PATH",
33
+ description: "Path to .properies file you want to read",
34
+ type: String,
35
+ optional: false,
36
+ verify_block: proc do |value|
37
+ UI.user_error!("Couldn't find .properties file at path '#{value}'") unless File.exist?(File.expand_path(value))
38
+ end)
39
+ ]
40
+ end
41
+
42
+ def self.is_supported?(platform)
43
+ # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
44
+ # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
45
+ #
46
+ # [:ios, :mac, :android].include?(platform)
47
+ true
48
+ end
49
+ end
50
+ end
51
+ end
@@ -20,7 +20,7 @@ module Fastlane
20
20
  end
21
21
 
22
22
  def self.return_value
23
- nil
23
+ nil
24
24
  end
25
25
 
26
26
  def self.details
@@ -34,15 +34,13 @@ module Fastlane
34
34
  env_name: "PROPERIES_GET_VALUE_PARAM_KEY",
35
35
  description: "Key of properie in .properties file",
36
36
  optional: false,
37
- type: String
38
- ),
37
+ type: String),
39
38
  FastlaneCore::ConfigItem.new(key: :value,
40
39
  env_name: "PROPERIES_SET_VALUE_PARAM_VALUE",
41
40
  description: "Value to set",
42
41
  skip_type_validation: true, # skipping type validation as fastlane converts YES/NO/true/false strings into booleans
43
42
  type: String,
44
- optional: false
45
- ),
43
+ optional: false),
46
44
  FastlaneCore::ConfigItem.new(key: :path,
47
45
  env_name: "PROPERIES_GET_VALUE_PARAM_PATH",
48
46
  description: "Path to .properies file you want to update",
@@ -50,8 +48,7 @@ module Fastlane
50
48
  optional: false,
51
49
  verify_block: proc do |value|
52
50
  UI.user_error!("Couldn't find .properties file at path '#{value}'") unless File.exist?(File.expand_path(value))
53
- end
54
- )
51
+ end)
55
52
  ]
56
53
  end
57
54
 
@@ -0,0 +1,56 @@
1
+ require 'fastlane/action'
2
+ require 'java-properties'
3
+
4
+ module Fastlane
5
+ module Actions
6
+ class WritePropertiesFileAction < Action
7
+ def self.run(params)
8
+ content = JavaProperties.write(params[:hash], params[:path])
9
+ return content
10
+ end
11
+
12
+ def self.description
13
+ "Write any Hash-like structure as a properties file. This action won't create a new file."
14
+ end
15
+
16
+ def self.authors
17
+ ["Pavlo Pakholka"]
18
+ end
19
+
20
+ def self.return_value
21
+ ''
22
+ end
23
+
24
+ def self.details
25
+ # Optional:
26
+ ""
27
+ end
28
+
29
+ def self.available_options
30
+ [
31
+ FastlaneCore::ConfigItem.new(key: :key,
32
+ env_name: "PROPERIES_WRITE_HASH_MAP",
33
+ description: "Hashmap you want to convert and write to file",
34
+ optional: false,
35
+ type: Hash),
36
+ FastlaneCore::ConfigItem.new(key: :path,
37
+ env_name: "PROPERIES_WRITE_HASH_PATH",
38
+ description: "Path to .properies file you want to update",
39
+ type: String,
40
+ optional: false,
41
+ verify_block: proc do |value|
42
+ UI.user_error!("Couldn't find .properties file at path '#{value}'") unless File.exist?(File.expand_path(value))
43
+ end)
44
+ ]
45
+ end
46
+
47
+ def self.is_supported?(platform)
48
+ # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
49
+ # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
50
+ #
51
+ # [:ios, :mac, :android].include?(platform)
52
+ true
53
+ end
54
+ end
55
+ end
56
+ end
@@ -7,27 +7,27 @@ module Fastlane
7
7
  class PropertiesHelper
8
8
  # Available in actions as `Helper::PropertiesHelper.update_semver_version`
9
9
  def self.update_semver_version(type, version_name)
10
- type = type || 'minor'
10
+ type ||= 'minor'
11
11
  version = version_name.split(".")
12
12
  major = version[0].to_i
13
13
  minor = version[1].to_i
14
14
  patch = version[2].to_i
15
-
15
+
16
16
  if type == 'major'
17
- major+=1
17
+ major += 1
18
18
  minor = 0
19
19
  patch = 0
20
20
  end
21
-
21
+
22
22
  if type == 'minor'
23
- minor+=1
23
+ minor += 1
24
24
  patch = 0
25
25
  end
26
-
26
+
27
27
  if type == 'patch'
28
- patch+=1
28
+ patch += 1
29
29
  end
30
-
30
+
31
31
  return "#{major}.#{minor}.#{patch}"
32
32
  end
33
33
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Properties
3
- VERSION = "0.1.0"
3
+ VERSION = "1.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-properties
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavlo Pakholka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-12 00:00:00.000000000 Z
11
+ date: 2019-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: java-properties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: pry
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +142,14 @@ dependencies:
128
142
  requirements:
129
143
  - - ">="
130
144
  - !ruby/object:Gem::Version
131
- version: 2.128.1
145
+ version: 2.130.0
132
146
  type: :development
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
150
  - - ">="
137
151
  - !ruby/object:Gem::Version
138
- version: 2.128.1
152
+ version: 2.130.0
139
153
  description:
140
154
  email: pavlo.pakholka@bolt.eu
141
155
  executables: []
@@ -148,10 +162,12 @@ files:
148
162
  - lib/fastlane/plugin/properties/actions/get_properties_value.rb
149
163
  - lib/fastlane/plugin/properties/actions/increment_version_code_in_properties_file.rb
150
164
  - lib/fastlane/plugin/properties/actions/increment_version_name_in_properties_file.rb
165
+ - lib/fastlane/plugin/properties/actions/parse_properties_file.rb
151
166
  - lib/fastlane/plugin/properties/actions/set_properties_value.rb
167
+ - lib/fastlane/plugin/properties/actions/write_properties_file.rb
152
168
  - lib/fastlane/plugin/properties/helper/properties_helper.rb
153
169
  - lib/fastlane/plugin/properties/version.rb
154
- homepage:
170
+ homepage: https://github.com/Kerizer/fastlane-plugin-properties
155
171
  licenses:
156
172
  - MIT
157
173
  metadata: {}
@@ -170,8 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
186
  - !ruby/object:Gem::Version
171
187
  version: '0'
172
188
  requirements: []
173
- rubyforge_project:
174
- rubygems_version: 2.5.2.3
189
+ rubygems_version: 3.0.3
175
190
  signing_key:
176
191
  specification_version: 4
177
192
  summary: Adds 4 actions to fastlane to read and update properties files.