fastlane-craft 1.4.5 → 1.5.0
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: f7ffbc1651b3397ebe0d68371744c450f8671df8a6f25910bff50cec6abf8803
|
4
|
+
data.tar.gz: 1c4c017f4b7b5e351749aa12bf0804fb11b64aa36fc47ddb43d1fcec9a0eb5e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d29aaf8b19147285e350a52ee13e2aa443c2893f17e21cb364cd39b1f29e9b50fb7eee70342525f4e9eb0c0ed30492dfa6076bf0013f8813ccf6c6c13a341cc
|
7
|
+
data.tar.gz: a180bf4f92989ebbbac494c39b8531228ee1254d41034163a0ccbd2402f999efdf127409d6588fdbab2c29c36d6fa783e3ed764a63dcf6ca3a95b5375f128869
|
@@ -5,9 +5,8 @@ module Fastlane
|
|
5
5
|
class AppReleaseAction < Action
|
6
6
|
def self.run(params)
|
7
7
|
FastlaneCraft::AppReleaseManager.new(
|
8
|
-
params[:
|
9
|
-
params[:
|
10
|
-
params[:extra_info_plists],
|
8
|
+
params[:schemes],
|
9
|
+
params[:project],
|
11
10
|
params[:branch],
|
12
11
|
params[:version],
|
13
12
|
params[:target_suffix]
|
@@ -29,28 +28,21 @@ module Fastlane
|
|
29
28
|
def self.available_options
|
30
29
|
[
|
31
30
|
FastlaneCore::ConfigItem.new(
|
32
|
-
key: :
|
33
|
-
description: '
|
34
|
-
|
35
|
-
UI.user_error!('empty scheme') if value.empty?
|
36
|
-
end
|
37
|
-
),
|
38
|
-
FastlaneCore::ConfigItem.new(
|
39
|
-
key: :info_plist,
|
40
|
-
description: 'target info plist path',
|
31
|
+
key: :schemes,
|
32
|
+
description: 'schemes',
|
33
|
+
type: Array,
|
41
34
|
verify_block: proc do |value|
|
42
|
-
msg = '
|
43
|
-
UI.user_error!(msg)
|
35
|
+
msg = 'invalid or empty schemes'
|
36
|
+
UI.user_error!(msg) if value.empty?
|
44
37
|
end
|
45
38
|
),
|
46
39
|
FastlaneCore::ConfigItem.new(
|
47
|
-
key: :
|
48
|
-
description: '
|
49
|
-
|
50
|
-
default_value: [],
|
40
|
+
key: :project,
|
41
|
+
description: 'path to xcodeproj',
|
42
|
+
default_value: Dir.glob('*.xcodeproj').first,
|
51
43
|
verify_block: proc do |value|
|
52
|
-
msg = '
|
53
|
-
UI.user_error!(msg) unless
|
44
|
+
msg = 'xcodeproj not found'
|
45
|
+
UI.user_error!(msg) unless File.directory?(value)
|
54
46
|
end
|
55
47
|
),
|
56
48
|
FastlaneCore::ConfigItem.new(
|
@@ -77,13 +69,11 @@ module Fastlane
|
|
77
69
|
def self.example_code
|
78
70
|
[
|
79
71
|
'app_release(
|
80
|
-
|
81
|
-
info_plist: "/path/to/info/plist"
|
72
|
+
schemes: ["AppScheme", "AppExtension"]
|
82
73
|
)',
|
83
74
|
'app_release(
|
84
|
-
|
85
|
-
|
86
|
-
extra_info_plists: ["plist1", "plist2"],
|
75
|
+
schemes: ["AppScheme", "AppExtension"],
|
76
|
+
project: "/path/to/xcodeproj",
|
87
77
|
branch: "master",
|
88
78
|
version: "2.3.0",
|
89
79
|
target_suffix: "_sfx"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative '
|
1
|
+
require_relative 'project_controller'
|
2
2
|
require 'fastlane_core/ui/ui'
|
3
3
|
|
4
4
|
module FastlaneCraft
|
@@ -12,16 +12,13 @@ module FastlaneCraft
|
|
12
12
|
include FastlaneCore
|
13
13
|
include Gem
|
14
14
|
|
15
|
-
def initialize(
|
16
|
-
raise 'Invalid Branch' if branch.empty?
|
17
|
-
raise 'Invalid Scheme' if scheme.empty?
|
15
|
+
def initialize(schemes, project, branch, version = nil, target_suffix = nil)
|
18
16
|
raise 'Invalid Version' if version && !version_valid?(version)
|
19
17
|
|
20
|
-
@scheme = scheme
|
21
18
|
@branch = branch
|
22
19
|
@target_suffix = target_suffix
|
23
|
-
@
|
24
|
-
@version = version.nil? ? @
|
20
|
+
@project_controller = ProjectController.new(project, schemes)
|
21
|
+
@version = version.nil? ? @project_controller.version : Version.new(version)
|
25
22
|
end
|
26
23
|
|
27
24
|
def release
|
@@ -29,7 +26,7 @@ module FastlaneCraft
|
|
29
26
|
archive
|
30
27
|
upload_to_tf
|
31
28
|
update_env
|
32
|
-
@
|
29
|
+
@project_controller.bump_build_version_patch
|
33
30
|
push_version_bump
|
34
31
|
|
35
32
|
remove_existing_git_tag
|
@@ -38,11 +35,11 @@ module FastlaneCraft
|
|
38
35
|
|
39
36
|
def bump_version
|
40
37
|
msg = 'Given version is less than the actual app version'
|
41
|
-
UI.user_error! msg if @version < @
|
42
|
-
return unless @version > @
|
38
|
+
UI.user_error! msg if @version < @project_controller.version
|
39
|
+
return unless @version > @project_controller.version
|
43
40
|
|
44
|
-
@
|
45
|
-
@
|
41
|
+
@project_controller.set_version(@version)
|
42
|
+
@project_controller.set_build_version(Version.new(@version.to_s + '.0'))
|
46
43
|
UI.success "Version was successfully bumped to #{version_dump}"
|
47
44
|
end
|
48
45
|
|
@@ -54,8 +51,8 @@ module FastlaneCraft
|
|
54
51
|
end
|
55
52
|
|
56
53
|
def update_env
|
57
|
-
ENV[SharedValues::APP_RELEASE_VERSION] = @
|
58
|
-
ENV[SharedValues::APP_RELEASE_BUILD_NUMBER] = @
|
54
|
+
ENV[SharedValues::APP_RELEASE_VERSION] = @project_controller.version.to_s
|
55
|
+
ENV[SharedValues::APP_RELEASE_BUILD_NUMBER] = @project_controller.build_version.to_s
|
59
56
|
ENV[SharedValues::APP_RELEASE_VERSION_TAG] = version_dump
|
60
57
|
end
|
61
58
|
|
@@ -112,7 +109,7 @@ module FastlaneCraft
|
|
112
109
|
end
|
113
110
|
|
114
111
|
def version_dump
|
115
|
-
"#{@
|
112
|
+
"#{@project_controller.version}/#{@project_controller.build_version}"
|
116
113
|
end
|
117
114
|
end
|
118
115
|
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'xcodeproj'
|
2
|
+
|
3
|
+
module FastlaneCraft
|
4
|
+
class ProjectController
|
5
|
+
include Gem
|
6
|
+
|
7
|
+
def initialize(path, schemes)
|
8
|
+
raise 'Invalid Path' unless File.directory?(path)
|
9
|
+
|
10
|
+
@project = Xcodeproj::Project.open(path)
|
11
|
+
@schemes = schemes
|
12
|
+
end
|
13
|
+
|
14
|
+
def bump_build_version_patch
|
15
|
+
value = build_version.to_s
|
16
|
+
value[-1] = (value[-1].to_i + 1).to_s
|
17
|
+
set_build_version(Version.new(value))
|
18
|
+
end
|
19
|
+
|
20
|
+
def set_version(version)
|
21
|
+
@schemes.each do |s|
|
22
|
+
set_scheme_value_for_key(s, version.to_s, version_key)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def set_build_version(version)
|
27
|
+
@schemes.each do |s|
|
28
|
+
set_scheme_value_for_key(s, version.to_s, build_version_key)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def version
|
33
|
+
value = scheme_value_for_key(@schemes.first, version_key)
|
34
|
+
Version.new(value)
|
35
|
+
end
|
36
|
+
|
37
|
+
def build_version
|
38
|
+
value = scheme_value_for_key(@schemes.first, build_version_key)
|
39
|
+
Version.new(value)
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def set_scheme_value_for_key(scheme, value, key, configuration = nil)
|
45
|
+
target = project_target(scheme)
|
46
|
+
target.build_configurations.each do |config|
|
47
|
+
if configuration.nil? || config.name == configuration
|
48
|
+
config.build_settings[key] = value
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
@project.save()
|
53
|
+
end
|
54
|
+
|
55
|
+
def scheme_value_for_key(scheme, key, configuration = nil)
|
56
|
+
target = project_target(scheme)
|
57
|
+
target.build_configurations.each do |config|
|
58
|
+
if configuration.nil? || config.name == configuration
|
59
|
+
value = config.build_settings[key]
|
60
|
+
return value if value
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
return nil
|
65
|
+
end
|
66
|
+
|
67
|
+
def project_target(scheme)
|
68
|
+
target = @project.targets.find { |t| t.name == scheme }
|
69
|
+
raise "Target not found for scheme: #{scheme}" unless target
|
70
|
+
return target
|
71
|
+
end
|
72
|
+
|
73
|
+
def version_key
|
74
|
+
'MARKETING_VERSION'
|
75
|
+
end
|
76
|
+
|
77
|
+
def build_version_key
|
78
|
+
'CURRENT_PROJECT_VERSION'
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-craft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sroik
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-12-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk-s3
|
@@ -39,6 +39,20 @@ dependencies:
|
|
39
39
|
- - ">"
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: xcodeproj
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: bundler
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,7 +146,7 @@ files:
|
|
132
146
|
- lib/fastlane-craft.rb
|
133
147
|
- lib/fastlane-craft/app_release.rb
|
134
148
|
- lib/fastlane-craft/app_release_manager.rb
|
135
|
-
- lib/fastlane-craft/
|
149
|
+
- lib/fastlane-craft/project_controller.rb
|
136
150
|
- lib/fastlane-craft/telegram.rb
|
137
151
|
- lib/fastlane-craft/telegram_notifier.rb
|
138
152
|
- lib/fastlane-craft/upload_dsym.rb
|
@@ -157,8 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
171
|
- !ruby/object:Gem::Version
|
158
172
|
version: '0'
|
159
173
|
requirements: []
|
160
|
-
|
161
|
-
rubygems_version: 2.7.7
|
174
|
+
rubygems_version: 3.0.6
|
162
175
|
signing_key:
|
163
176
|
specification_version: 4
|
164
177
|
summary: fastlane craft summary
|
@@ -1,67 +0,0 @@
|
|
1
|
-
require 'plist'
|
2
|
-
|
3
|
-
module FastlaneCraft
|
4
|
-
class InfoPlistController
|
5
|
-
include Gem
|
6
|
-
|
7
|
-
def initialize(info_plist, extra_info_plists = [])
|
8
|
-
raise 'Invalid Info Plist Path' unless File.file?(info_plist)
|
9
|
-
raise 'Invalid Extra Info Plists Paths' unless extra_info_plists.all? { |p| File.file?(p) }
|
10
|
-
|
11
|
-
@info_plist = info_plist
|
12
|
-
@extra_info_plists = extra_info_plists
|
13
|
-
end
|
14
|
-
|
15
|
-
def bump_build_version_patch
|
16
|
-
value = build_version.to_s
|
17
|
-
value[-1] = (value[-1].to_i + 1).to_s
|
18
|
-
set_build_version(Version.new(value))
|
19
|
-
end
|
20
|
-
|
21
|
-
def set_version(version)
|
22
|
-
info_plists.each do |path|
|
23
|
-
set_plist_value_for(path, version.to_s, version_key)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def set_build_version(version)
|
28
|
-
info_plists.each do |path|
|
29
|
-
set_plist_value_for(path, version.to_s, build_version_key)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def version
|
34
|
-
value = plist_value_for(@info_plist, version_key)
|
35
|
-
Version.new(value)
|
36
|
-
end
|
37
|
-
|
38
|
-
def build_version
|
39
|
-
value = plist_value_for(@info_plist, build_version_key)
|
40
|
-
Version.new(value)
|
41
|
-
end
|
42
|
-
|
43
|
-
private
|
44
|
-
|
45
|
-
def set_plist_value_for(plist_path, value, key)
|
46
|
-
plist = Plist.parse_xml(plist_path)
|
47
|
-
plist[key] = value
|
48
|
-
File.write(plist_path, Plist::Emit.dump(plist))
|
49
|
-
end
|
50
|
-
|
51
|
-
def plist_value_for(plist_path, key)
|
52
|
-
Plist.parse_xml(plist_path)[key]
|
53
|
-
end
|
54
|
-
|
55
|
-
def info_plists
|
56
|
-
[@info_plist] + @extra_info_plists
|
57
|
-
end
|
58
|
-
|
59
|
-
def version_key
|
60
|
-
'CFBundleShortVersionString'
|
61
|
-
end
|
62
|
-
|
63
|
-
def build_version_key
|
64
|
-
'CFBundleVersion'
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|