xcode-archive-cache 0.0.12 → 0.0.13

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
2
  SHA256:
3
- metadata.gz: b2121ee4ca94b2acfa38e1071a6f30209381464a7da5239e919d4b70cafd1d84
4
- data.tar.gz: 9874700c995c65ee3ecaa4772a1aa6deba6868591b96da6d271b9ee1f32588df
3
+ metadata.gz: 1c30a0e4a847e52d32192c31fe3cdf3c7b0ff61cabc81e413e4fe416edbda1a8
4
+ data.tar.gz: 31925913e15ec55cf8b94dfd9940604cbc34cc98c0f1b76317cf0d05d8c202a7
5
5
  SHA512:
6
- metadata.gz: 528092da4900b8232d71a9583ec0752c92ff2ee851bc13db3609c91c1a9aec3db4278abb777a3c574728d35b409b59ede6fc1481c0dafed49b93a396b994b114
7
- data.tar.gz: c16c9ff1c2623437b5e29c0fea3cd1bc10cfe631c4df1772197595392b5a05286a8223294c20f9dc306b5ed47089f7c7c85c7eeb4138a940d2a37861c6266bdc
6
+ metadata.gz: 5a8fcfa4fd8a2da9cfadf202aaa3be88f4c54ddf3979aa4ac1c500e61b0a9d41f07bf43420fb0ec6332fd491b634a4d4f28ff1aebeaf273c79ded3a950a0d763
7
+ data.tar.gz: c6f6f0351aa9b02165637e93cd65b4938f2888bdb0cb7c599f8de0592a0ae4d85092508b73fb4a2b117c226287a64ccface769afd6e4c81626cd6b8d8e253297
@@ -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
- build_result = xcodebuild_executor.build(target.project.path, target.name, derived_data_path)
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
@@ -93,7 +93,6 @@ module XcodeArchiveCache
93
93
  CLONE_HEADERS
94
94
  COMBINE_HIDPI_IMAGES
95
95
  COMPRESS_PNG_FILES
96
- CONFIGURATION
97
96
  COPYING_PRESERVES_HFS_DATA
98
97
  COPY_HEADERS_RUN_UNIFDEF
99
98
  COPY_PHASE_STRIP
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
- rebuild_performer = XcodeArchiveCache::Build::Performer.new(xcodebuild_executor, config.settings.derived_data_path)
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)
@@ -43,8 +43,30 @@ module XcodeArchiveCache
43
43
  # @param [String] scheme
44
44
  # @param [String] derived_data_path
45
45
  #
46
- def build(project_path, scheme, derived_data_path)
47
- flags = [project_flag(project_path),
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.12
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: 2021-10-28 00:00:00.000000000 Z
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.1.6
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.