cocoapods-generate 1.2.0 → 1.3.0

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: 35db1cd62af064c53a195412974b4a053569388c8682557093088d2a22af56cb
4
- data.tar.gz: 159f3e9e8258682bcd42592194bed3ca7ee95db66cabfe0dcc2a4ebf6945dcb6
3
+ metadata.gz: d8dd5896fe293bf4d05fd83c9caba0324b05f7b857abebb93369b816762a968f
4
+ data.tar.gz: f826e9c99158d30fa2ff14d6821ebd4f4c3d8dca538f9c7d36bc9d40c759eac0
5
5
  SHA512:
6
- metadata.gz: e4036f2d71ecd321cc62449a2ec3f00c77e3bb29dbb89d16bafa20c1f8a74a1ac1810bbd99ffd43dceafbde806d7c80fe2a1477b38dcb021b9a1dbd9772dbce0
7
- data.tar.gz: 4d1ee2f06a1a65e93469c926c675a42385b9f5bb887f31103e07d570ef2032850cbf25dc660a3bda4cb10a519f4ebb5b679ef5e52a9b9f42b5545bf162536de4
6
+ metadata.gz: 30e56968b0b6de1b50c61711d8493f9db0f2ada2f7fb95a71f4507b1ea2386c9c4d4fbc21cdbe9aa4bd464e5a8802318d91ff81ae766c9be87bee199727864ba
7
+ data.tar.gz: f3d0bccb1e79f54099116a1321ae25d8f3c497a906ec95821948905b2ac6286dfddeec35447ef601f82c8cb6abb0b0b60c11bec73b766f25ca68e6b037170b4c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.3.0
@@ -117,7 +117,11 @@ module Pod
117
117
  end
118
118
  .tap do
119
119
  app_project.recreate_user_schemes do |scheme, target|
120
- scheme.set_launch_target(target)
120
+ installation_result = installation_result_from_target(target)
121
+ next unless installation_result
122
+ installation_result.test_native_targets.each do |test_native_target|
123
+ scheme.add_test_target(test_native_target)
124
+ end
121
125
  end
122
126
  end
123
127
  .each do |target|
@@ -196,6 +200,14 @@ module Pod
196
200
  app_project.save
197
201
  end
198
202
 
203
+ def installation_result_from_target(target)
204
+ return unless target.respond_to?(:symbol_type)
205
+ library_product_types = %i[framework dynamic_library static_library]
206
+ return unless library_product_types.include? target.symbol_type
207
+
208
+ results_by_native_target[target]
209
+ end
210
+
199
211
  def remove_script_phase_from_target(native_target, script_phase_name)
200
212
  script_phase = native_target.shell_script_build_phases.find { |bp| bp.name && bp.name.end_with?(script_phase_name) }
201
213
  return unless script_phase.present?
@@ -56,6 +56,11 @@ module Pod
56
56
  self.defined_in_file = dir.join('Podfile.yaml')
57
57
 
58
58
  test_specs = spec.recursive_subspecs.select(&:test_specification?)
59
+ app_specs = if spec.respond_to?(:app_specification?)
60
+ spec.recursive_subspecs.select(&:app_specification?)
61
+ else
62
+ []
63
+ end
59
64
 
60
65
  # Stick all of the transitive dependencies in an abstract target.
61
66
  # This allows us to force CocoaPods to use the versions / sources / external sources
@@ -65,6 +70,8 @@ module Pod
65
70
  pods_for_transitive_dependencies = [spec.name]
66
71
  .concat(test_specs.map(&:name))
67
72
  .concat(test_specs.flat_map { |ts| ts.dependencies.flat_map(&:name) })
73
+ .concat(app_specs.map(&:name))
74
+ .concat(app_specs.flat_map { |as| as.dependencies.flat_map(&:name) })
68
75
 
69
76
  dependencies = generator
70
77
  .transitive_dependencies_by_pod
@@ -82,7 +89,7 @@ module Pod
82
89
  end
83
90
 
84
91
  # Add platform-specific concrete targets that inherit the
85
- # `pod` declaration for the local pod
92
+ # `pod` declaration for the local pod.
86
93
  spec.available_platforms.map(&:string_name).sort.each do |platform_name|
87
94
  target "App-#{platform_name}" do
88
95
  current_target_definition.swift_version = generator.swift_version if generator.swift_version
@@ -106,10 +113,13 @@ module Pod
106
113
 
107
114
  # This is the pod declaration for the local pod,
108
115
  # it will be inherited by the concrete target definitions below
109
- pod spec.name,
110
- path: spec.defined_in_file.relative_path_from(dir).to_s,
111
- testspecs: test_specs.map { |s| s.name.sub(%r{^#{Regexp.escape spec.root.name}/}, '') }.sort,
112
- **generator.dependency_compilation_kwargs(spec.name)
116
+ pod_options = generator.dependency_compilation_kwargs(spec.name)
117
+ pod_options[:path] = spec.defined_in_file.relative_path_from(dir).to_s
118
+ { testspecs: test_specs, appspecs: app_specs }.each do |key, specs|
119
+ pod_options[key] = specs.map { |s| s.name.sub(%r{^#{Regexp.escape spec.root.name}/}, '') }.sort unless specs.empty?
120
+ end
121
+
122
+ pod spec.name, **pod_options
113
123
  end
114
124
  end
115
125
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-generate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Giddins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-31 00:00:00.000000000 Z
11
+ date: 2018-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler