fastlane-plugin-increment_build_number 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7b77d132dd354766922104678c7a4b529f3b924f20413b8a6ccbdf195c5108d
|
4
|
+
data.tar.gz: e51b3d909eefe14218cc673a4071ee0f29d99782696c1a410f0bac77f5dcddbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70d376abcd7908be0f558c279e353b1f492bb01bf373f009c6682184144dc76d3208897aefa6d3bdeb16bfb48db0419ab5985062dc1db5f0928534c70826e5ad
|
7
|
+
data.tar.gz: e8acce84987919108a0b3947af65efa8ef6c5dfb771377c0e012b4ad7e4ca98514c3d8ee6a16e9a0af0077d52b83a37a2deb79cc4641295ffdf6b286f775c27e
|
@@ -5,13 +5,22 @@ module Fastlane
|
|
5
5
|
module Actions
|
6
6
|
class IncrementBundleVersionAction < Action
|
7
7
|
def self.run(params)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
org_version = Fastlane::Actions::GetInfoPlistValueAction.run(path: params[:info_plist], key: "CFBundleShortVersionString")
|
9
|
+
version = params[:version_number] || org_version
|
10
|
+
org_build = Fastlane::Actions::GetInfoPlistValueAction.run(path: params[:info_plist], key: "CFBundleVersion")
|
11
|
+
build = params[:build_number] || org_build
|
12
|
+
auto_increment = params[:auto_increment].nil? ? true : params[:auto_increment]
|
13
|
+
new_build = if self.number?(build).nil?
|
14
|
+
nil
|
15
|
+
else
|
16
|
+
auto_increment ? build.to_i + 1 : build.to_i
|
17
|
+
end
|
18
|
+
if new_build.nil?
|
19
|
+
UI.user_error!("Failure - Increment/Change bundle version #{params[:info_plist]} from #{org_build} to #{new_build} and change version from #{org_version} to #{version}.")
|
12
20
|
else
|
13
|
-
Fastlane::Actions::SetInfoPlistValueAction.run(path: params[:info_plist], key: "
|
14
|
-
|
21
|
+
Fastlane::Actions::SetInfoPlistValueAction.run(path: params[:info_plist], key: "CFBundleShortVersionString", value: version.to_s)
|
22
|
+
Fastlane::Actions::SetInfoPlistValueAction.run(path: params[:info_plist], key: "CFBundleVersion", value: new_build.to_s)
|
23
|
+
UI.success("Success - Increment/Change bundle version #{params[:info_plist]} from #{org_build} to #{new_build} and change version from #{org_version} to #{version}!")
|
15
24
|
end
|
16
25
|
end
|
17
26
|
|
@@ -41,10 +50,29 @@ module Fastlane
|
|
41
50
|
FastlaneCore::ConfigItem.new(key: :info_plist,
|
42
51
|
env_name: "FL_BUILD_NUMBER_INFO_PLIST",
|
43
52
|
description: "optional, you must specify the path to your Info.plist file if it is not in the project root directory",
|
53
|
+
type: String,
|
44
54
|
optional: true,
|
45
55
|
verify_block: proc do |value|
|
46
56
|
UI.user_error!("Could not find Info.plist") if !File.exist?(value) && !Helper.test?
|
47
57
|
end),
|
58
|
+
FastlaneCore::ConfigItem.new(key: :version_number,
|
59
|
+
env_name: "FL_INCREMENT_BUILD_NUMBER_VERSION_NUMBER",
|
60
|
+
description: "Change to a specific version number. This will replace the bump type value",
|
61
|
+
type: String,
|
62
|
+
optional: true,
|
63
|
+
skip_type_validation: true),
|
64
|
+
FastlaneCore::ConfigItem.new(key: :build_number,
|
65
|
+
env_name: "FL_INCREMENT_BUILD_NUMBER_BUILD_NUMBER",
|
66
|
+
description: "Change to a specific build number",
|
67
|
+
type: String,
|
68
|
+
optional: true,
|
69
|
+
skip_type_validation: true),
|
70
|
+
FastlaneCore::ConfigItem.new(key: :auto_increment,
|
71
|
+
env_name: "FL_INCREMENT_BUILD_NUMBER_AUTO_INCREMENT",
|
72
|
+
description: "Auto increment version code from your AndroidManifest.xml's original version code",
|
73
|
+
type: Boolean,
|
74
|
+
optional: true,
|
75
|
+
default_value: true)
|
48
76
|
]
|
49
77
|
end
|
50
78
|
|
@@ -8,15 +8,24 @@ module Fastlane
|
|
8
8
|
require "nokogiri"
|
9
9
|
require "open-uri"
|
10
10
|
|
11
|
-
manifest = Nokogiri::XML(open(params[:manifest]))
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
manifest = Nokogiri::XML(File.open(params[:manifest]))
|
12
|
+
org_name = manifest.xpath("//manifest").first["android:versionName"]
|
13
|
+
ver_name = params[:version_name] || org_name
|
14
|
+
org_code = manifest.xpath("//manifest").first["android:versionCode"]
|
15
|
+
ver_code = params[:version_code] || org_code
|
16
|
+
auto_increment = params[:auto_increment].nil? ? true : params[:auto_increment]
|
17
|
+
new_code = if self.number?(ver_code).nil?
|
18
|
+
nil
|
19
|
+
else
|
20
|
+
auto_increment ? ver_code.to_i + 1 : ver_code.to_i
|
21
|
+
end
|
22
|
+
if new_code.nil?
|
23
|
+
UI.user_error!("Failure - Increment/Change version code #{params[:manifest]} from #{org_code} to #{new_code} and change version name from #{org_name} to #{ver_name}.")
|
16
24
|
else
|
17
|
-
manifest.xpath("//manifest").first["android:
|
25
|
+
manifest.xpath("//manifest").first["android:versionName"] = ver_name
|
26
|
+
manifest.xpath("//manifest").first["android:versionCode"] = new_code
|
18
27
|
File.write(params[:manifest], manifest.to_xml)
|
19
|
-
UI.success("Success - Increment version code #{params[:manifest]} from #{
|
28
|
+
UI.success("Success - Increment/Change version code #{params[:manifest]} from #{org_code} to #{new_code} and change version name from #{org_name} to #{ver_name}!")
|
20
29
|
end
|
21
30
|
end
|
22
31
|
|
@@ -44,12 +53,28 @@ module Fastlane
|
|
44
53
|
def self.available_options
|
45
54
|
[
|
46
55
|
FastlaneCore::ConfigItem.new(key: :manifest,
|
47
|
-
env_name: "
|
56
|
+
env_name: "FL_INCREMENT_BUILD_NUMBER_MANIFEST",
|
48
57
|
description: "optional, you must specify the path to your AndroidManifest.xml file if it is not in the project root directory",
|
49
58
|
optional: true,
|
50
59
|
verify_block: proc do |value|
|
51
60
|
UI.user_error!("Could not find AndroidManifest.xml") if !File.exist?(value) && !Helper.test?
|
52
61
|
end),
|
62
|
+
FastlaneCore::ConfigItem.new(key: :version_name,
|
63
|
+
env_name: "FL_INCREMENT_BUILD_NUMBER_VERSION_NAME",
|
64
|
+
description: "Change to a specific version name. This will replace the bump type value",
|
65
|
+
optional: true,
|
66
|
+
skip_type_validation: true),
|
67
|
+
FastlaneCore::ConfigItem.new(key: :version_code,
|
68
|
+
env_name: "FL_INCREMENT_BUILD_NUMBER_VERSION_CODE",
|
69
|
+
description: "Change to a specific version code.",
|
70
|
+
optional: true,
|
71
|
+
skip_type_validation: true),
|
72
|
+
FastlaneCore::ConfigItem.new(key: :auto_increment,
|
73
|
+
env_name: "FL_INCREMENT_BUILD_NUMBER_AUTO_INCREMENT",
|
74
|
+
description: "Auto increment version code from your AndroidManifest.xml's original version code",
|
75
|
+
type: Boolean,
|
76
|
+
optional: true,
|
77
|
+
default_value: true)
|
53
78
|
]
|
54
79
|
end
|
55
80
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-increment_build_number
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miyabi Ogino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.198.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: nokogiri
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: pry
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,20 +164,6 @@ dependencies:
|
|
150
164
|
- - ">="
|
151
165
|
- !ruby/object:Gem::Version
|
152
166
|
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: nokogiri
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
167
167
|
description:
|
168
168
|
email: miyabichan@aol.jp
|
169
169
|
executables: []
|