xcode-archive-cache 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/build/performer.rb +12 -2
- data/lib/build_settings/filter.rb +0 -1
- data/lib/runner/runner.rb +2 -1
- data/lib/xcodebuild/executor.rb +32 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c30a0e4a847e52d32192c31fe3cdf3c7b0ff61cabc81e413e4fe416edbda1a8
|
4
|
+
data.tar.gz: 31925913e15ec55cf8b94dfd9940604cbc34cc98c0f1b76317cf0d05d8c202a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a8fcfa4fd8a2da9cfadf202aaa3be88f4c54ddf3979aa4ac1c500e61b0a9d41f07bf43420fb0ec6332fd491b634a4d4f28ff1aebeaf273c79ded3a950a0d763
|
7
|
+
data.tar.gz: c6f6f0351aa9b02165637e93cd65b4938f2888bdb0cb7c599f8de0592a0ae4d85092508b73fb4a2b117c226287a64ccface769afd6e4c81626cd6b8d8e253297
|
data/lib/build/performer.rb
CHANGED
@@ -6,9 +6,10 @@ module XcodeArchiveCache
|
|
6
6
|
|
7
7
|
# @param [String] derived_data_path
|
8
8
|
#
|
9
|
-
def initialize(xcodebuild_executor, derived_data_path)
|
9
|
+
def initialize(xcodebuild_executor, derived_data_path, workspace_path=nil)
|
10
10
|
@xcodebuild_executor = xcodebuild_executor
|
11
11
|
@derived_data_path = derived_data_path
|
12
|
+
@workspace_path = workspace_path
|
12
13
|
end
|
13
14
|
|
14
15
|
# @param [Xcodeproj::Project::Object::PBXNativeTarget] target
|
@@ -23,7 +24,12 @@ module XcodeArchiveCache
|
|
23
24
|
.join(", ")
|
24
25
|
info("going to rebuild:\n#{rebuild_list}")
|
25
26
|
|
26
|
-
|
27
|
+
if workspace_path
|
28
|
+
build_result = xcodebuild_executor.build_from_workspace(workspace_path, target.name, derived_data_path)
|
29
|
+
else
|
30
|
+
build_result = xcodebuild_executor.build_from_project(target.project.path, target.name, derived_data_path)
|
31
|
+
end
|
32
|
+
|
27
33
|
unless build_result
|
28
34
|
raise StandardError.new, "Failed to perform rebuild"
|
29
35
|
end
|
@@ -47,6 +53,10 @@ module XcodeArchiveCache
|
|
47
53
|
# @return [XcodeArchiveCache::Xcodebuild::Executor]
|
48
54
|
#
|
49
55
|
attr_reader :xcodebuild_executor
|
56
|
+
|
57
|
+
# @return [String]
|
58
|
+
#
|
59
|
+
attr_reader :workspace_path
|
50
60
|
end
|
51
61
|
end
|
52
62
|
end
|
data/lib/runner/runner.rb
CHANGED
@@ -133,7 +133,8 @@ module XcodeArchiveCache
|
|
133
133
|
# @param [XcodeArchiveCache::BuildGraph::Graph] graph
|
134
134
|
#
|
135
135
|
def rebuild_if_needed(xcodebuild_executor, root_target, graph)
|
136
|
-
|
136
|
+
workspace_path = config.is_a?(XcodeArchiveCache::Config::Workspace) ? File.absolute_path(config.file_path) : nil
|
137
|
+
rebuild_performer = XcodeArchiveCache::Build::Performer.new(xcodebuild_executor, config.settings.derived_data_path, workspace_path)
|
137
138
|
return unless rebuild_performer.should_rebuild?(graph)
|
138
139
|
|
139
140
|
@injector.perform_internal_injection(graph)
|
data/lib/xcodebuild/executor.rb
CHANGED
@@ -43,8 +43,30 @@ module XcodeArchiveCache
|
|
43
43
|
# @param [String] scheme
|
44
44
|
# @param [String] derived_data_path
|
45
45
|
#
|
46
|
-
def
|
47
|
-
|
46
|
+
def build_from_project(project_path, scheme, derived_data_path)
|
47
|
+
build(project_flag(project_path), scheme, derived_data_path)
|
48
|
+
end
|
49
|
+
|
50
|
+
# @param [String] workspace_flag
|
51
|
+
# @param [String] scheme
|
52
|
+
# @param [String] derived_data_path
|
53
|
+
#
|
54
|
+
def build_from_workspace(workspace_path, scheme, derived_data_path)
|
55
|
+
build(workspace_flag(workspace_path), scheme, derived_data_path)
|
56
|
+
end
|
57
|
+
|
58
|
+
def set_up_for_simulator?
|
59
|
+
destination_flag.include?("Simulator")
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
# @param [String] path_flag
|
65
|
+
# @param [String] scheme
|
66
|
+
# @param [String] derived_data_path
|
67
|
+
#
|
68
|
+
def build(path_flag, scheme, derived_data_path)
|
69
|
+
flags = [path_flag,
|
48
70
|
configuration_flag,
|
49
71
|
destination_flag,
|
50
72
|
scheme_flag(scheme),
|
@@ -55,12 +77,6 @@ module XcodeArchiveCache
|
|
55
77
|
shell_executor.execute(command, true)
|
56
78
|
end
|
57
79
|
|
58
|
-
def set_up_for_simulator?
|
59
|
-
destination_flag.include?("Simulator")
|
60
|
-
end
|
61
|
-
|
62
|
-
private
|
63
|
-
|
64
80
|
# @return [String]
|
65
81
|
#
|
66
82
|
attr_reader :configuration
|
@@ -93,6 +109,14 @@ module XcodeArchiveCache
|
|
93
109
|
"xcodebuild #{flags.join(" ")}"
|
94
110
|
end
|
95
111
|
|
112
|
+
# @param [String] workspace_path
|
113
|
+
#
|
114
|
+
# @return [String]
|
115
|
+
#
|
116
|
+
def workspace_flag(workspace_path)
|
117
|
+
"-workspace '#{workspace_path}'"
|
118
|
+
end
|
119
|
+
|
96
120
|
# @param [String] project_path
|
97
121
|
#
|
98
122
|
# @return [String]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcode-archive-cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Dyakonov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcodeproj
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
|
-
rubygems_version: 3.
|
147
|
+
rubygems_version: 3.3.22
|
148
148
|
signing_key:
|
149
149
|
specification_version: 4
|
150
150
|
summary: Native targets cache for Xcode archive builds.
|