fastlane-plugin-versioning 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastlane/plugin/versioning/actions/get_app_store_version_number.rb +17 -4
- data/lib/fastlane/plugin/versioning/actions/get_version_number_from_xcodeproj.rb +14 -1
- data/lib/fastlane/plugin/versioning/actions/increment_version_number_in_xcodeproj.rb +11 -4
- data/lib/fastlane/plugin/versioning/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31846ea92bbacc5b95feebd8e2dd1e9df3494d4aeef5373410b12adc2dabb881
|
4
|
+
data.tar.gz: 34853fe36a10ee78737918dbcd6ffdeda1322bfe55305f842288d6c7adb9557e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24b894e961b6a22a26c50ab83f02fc2d78e814bb6a4f7d7c4db30d5d717c419d35ac0c44ab3586401120e7e17988e0fc50955d6bbf446c6d988bedf2ee3a93e6
|
7
|
+
data.tar.gz: 57f1527939970e9513536c9767ee7bb8dbde29ada4e2eb1890741f13b0f296ed711604ea1747429789f14975d38f1b9bcb94328778b2876bd54abdfa79878936
|
@@ -20,15 +20,28 @@ module Fastlane
|
|
20
20
|
random = Helper.test? ? "123" : SecureRandom.uuid
|
21
21
|
|
22
22
|
if params[:country]
|
23
|
-
uri = URI("
|
23
|
+
uri = URI("https://itunes.apple.com/lookup?bundleId=#{bundle_id}&country=#{params[:country]}&rand=#{random}")
|
24
24
|
else
|
25
|
-
uri = URI("
|
25
|
+
uri = URI("https://itunes.apple.com/lookup?bundleId=#{bundle_id}&rand=#{random}")
|
26
26
|
end
|
27
27
|
Net::HTTP.get(uri)
|
28
28
|
|
29
29
|
response = Net::HTTP.get_response(uri)
|
30
|
-
|
31
|
-
|
30
|
+
case response
|
31
|
+
when Net::HTTPSuccess
|
32
|
+
response_body = JSON.parse(response.body)
|
33
|
+
when Net::HTTPRedirection
|
34
|
+
UI.crash!("iTunes Search API resolved with status code 302, but no redirect url has been received") unless response['location']
|
35
|
+
UI.important("iTunes Search API resolved with status code 302, redirecting to new url")
|
36
|
+
|
37
|
+
new_url = response['location']
|
38
|
+
response = Net::HTTP.get_response(URI(new_url))
|
39
|
+
UI.crash!("Unexpected status code from iTunes Search API") unless response.kind_of?(Net::HTTPSuccess)
|
40
|
+
|
41
|
+
response_body = JSON.parse(response.body)
|
42
|
+
else
|
43
|
+
UI.crash!("Unexpected status code from iTunes Search API")
|
44
|
+
end
|
32
45
|
|
33
46
|
UI.user_error!("Cannot find app with #{bundle_id} bundle ID in the App Store") if response_body["resultCount"] == 0
|
34
47
|
|
@@ -16,7 +16,8 @@ module Fastlane
|
|
16
16
|
if params[:target]
|
17
17
|
version_number = get_version_number_using_target(params)
|
18
18
|
else
|
19
|
-
version_number =
|
19
|
+
version_number = get_version_number_using_project(params) if params[:scheme].nil?
|
20
|
+
version_number = get_version_number_using_scheme(params) if version_number.nil?
|
20
21
|
end
|
21
22
|
|
22
23
|
Actions.lane_context[SharedValues::VERSION_NUMBER] = version_number
|
@@ -66,6 +67,18 @@ module Fastlane
|
|
66
67
|
build_number
|
67
68
|
end
|
68
69
|
|
70
|
+
def self.get_version_number_using_project(params)
|
71
|
+
project = Xcodeproj::Project.open(params[:xcodeproj])
|
72
|
+
|
73
|
+
if params[:build_configuration_name] && !params[:build_configuration_name].empty?
|
74
|
+
build_configuration_name = params[:build_configuration_name]
|
75
|
+
else
|
76
|
+
build_configuration_name = project.build_configurations.first.name
|
77
|
+
end
|
78
|
+
|
79
|
+
version_number = project.build_settings(build_configuration_name)["MARKETING_VERSION"]
|
80
|
+
end
|
81
|
+
|
69
82
|
#####################################################
|
70
83
|
# @!group Documentation
|
71
84
|
#####################################################
|
@@ -32,7 +32,7 @@ module Fastlane
|
|
32
32
|
next_version_number = version_array.join(".")
|
33
33
|
end
|
34
34
|
|
35
|
-
if Helper.test?
|
35
|
+
if Helper.test? && params[:xcodeproj].nil?
|
36
36
|
params[:xcodeproj] = "/tmp/fastlane/tests/fastlane/xcodeproj/versioning_fixture_project.xcodeproj"
|
37
37
|
else
|
38
38
|
params[:xcodeproj] = Dir["*.xcodeproj"][0] unless params[:xcodeproj]
|
@@ -52,9 +52,16 @@ module Fastlane
|
|
52
52
|
|
53
53
|
def self.set_all_xcodeproj_version_numbers(params, next_version_number)
|
54
54
|
project = Xcodeproj::Project.open(params[:xcodeproj])
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
|
56
|
+
if project.build_configurations.find { |config| !config.build_settings["MARKETING_VERSION"].nil? }
|
57
|
+
project.build_configurations.each do |config|
|
58
|
+
config.build_settings["MARKETING_VERSION"] = next_version_number
|
59
|
+
end
|
60
|
+
else
|
61
|
+
configs = project.objects.select { |obj| select_build_configuration_predicate(nil, obj) }
|
62
|
+
configs.each do |config|
|
63
|
+
config.build_settings["MARKETING_VERSION"] = next_version_number
|
64
|
+
end
|
58
65
|
end
|
59
66
|
project.save
|
60
67
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-versioning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siarhei Fiedartsou
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-11-
|
12
|
+
date: 2024-11-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pry
|