cocoapods-generate 1.5.0 → 1.6.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: 52f85405e2e27e0c197fac736a0f1c3d61f47e601238737f6082aa6913512c7c
4
- data.tar.gz: 2fe15ee1fd79bd155bf94140fbe0a7bfbd2f318d355c43bac59b743e42da738e
3
+ metadata.gz: 444c04f0d19618e1220c68828b385d2a5360b63f359f6d5c97840c92ec4c82f5
4
+ data.tar.gz: 953c104741ea87c0629466cd2db8e6b27f2a9d3b395b7a18b76b714fec8d926c
5
5
  SHA512:
6
- metadata.gz: db80754352a3a07467f11099713f58788fd1a342e54c7fd75e975b3bd73f3230980c07f271de56102a696d3e6663b29a1a21ed4efc38f8ca2bc7a5a62c06f600
7
- data.tar.gz: 64c521033f329de4ad9d232ce147b33d25b885c70a020175e27e65c3ce639144d2cd27c6f864a08381b0b0d05b25488693b345b62ac641ad1a88483e70eb2fe3
6
+ metadata.gz: fdf382c8e04699dfb9c206fdc97fb892d39fd7b3d5403fa2118127c2caf92330bd7445b49bc38542ce67aae075002c412633ba09600a3682e20a797ae6d2bae5
7
+ data.tar.gz: 237a7ab95303b502f3f0e8b525a3c6f4f640031d55b5ceab88a963806b762f51b15c7197a23c779cae4fd39e54aecb5c47e9daa0a2e0f93b03f84fbaa26c05c7
data/README.md CHANGED
@@ -79,6 +79,9 @@ Options:
79
79
  --local-sources=SOURCE1,SOURCE2 Paths from which to find local podspecs for
80
80
  transitive dependencies. Multiple
81
81
  local-sources must be comma-delimited.
82
+ --platforms=ios,macos Limit to specific platforms. Default is all
83
+ platforms supported by the podspec.
84
+ Multiple platforms must be comma-delimited.
82
85
  --repo-update Force running `pod repo update` before
83
86
  install
84
87
  --use-default-plugins Whether installation should activate
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.0
1
+ 1.6.0
@@ -188,6 +188,15 @@ module Pod
188
188
  'SOURCE1,SOURCE2',
189
189
  ->(_) { nil },
190
190
  ->(local_sources) { Array(local_sources).flat_map { |s| s.split(',') } }
191
+ option :platforms, ArrayOf.new(String),
192
+ nil,
193
+ 'Limit to specific platforms. Default is all platforms supported by the podspec. Multiple platforms must be comma-delimited.',
194
+ 'ios,macos',
195
+ lambda { |platforms|
196
+ valid_platforms = Platform.all.map { |p| p.string_name.downcase }
197
+ valid_platforms unless (platforms - valid_platforms).empty?
198
+ }, # validates platforms is a subset of Platform.all
199
+ ->(platforms) { Array(platforms).flat_map { |s| s.split(',') } }
191
200
  option :repo_update, BOOLEAN, 'false', 'Force running `pod repo update` before install', nil, nil, coerce_to_bool
192
201
  option :use_default_plugins, BOOLEAN, 'false', 'Whether installation should activate default plugins', nil, nil, coerce_to_bool
193
202
  option :deterministic_uuids, BOOLEAN, 'false', 'Whether installation should use deterministic UUIDs for pods projects', nil, nil, coerce_to_bool
@@ -94,28 +94,34 @@ module Pod
94
94
  def create_app_project
95
95
  app_project = open_app_project(recreate: true)
96
96
 
97
- spec.available_platforms.map do |platform|
98
- consumer = spec.consumer(platform)
99
- target_name = "App-#{Platform.string_name(consumer.platform_name)}"
100
- native_app_target = Pod::Generator::AppTargetHelper.add_app_target(app_project, consumer.platform_name, deployment_target(consumer), target_name)
101
- # Temporarily set Swift version to pass validator checks for pods which do not specify Swift version.
102
- # It will then be re-set again within #perform_post_install_steps.
103
- Pod::Generator::AppTargetHelper.add_swift_version(native_app_target, Pod::Validator::DEFAULT_SWIFT_VERSION)
104
- native_app_target
97
+ spec_platforms = spec.available_platforms.flatten.reject do |platform|
98
+ !configuration.platforms.nil? && !configuration.platforms.include?(platform.string_name.downcase)
105
99
  end
106
- .tap do
107
- app_project.recreate_user_schemes do |scheme, target|
108
- installation_result = installation_result_from_target(target)
109
- next unless installation_result
110
- installation_result.test_native_targets.each do |test_native_target|
111
- scheme.add_test_target(test_native_target)
112
- end
100
+
101
+ Pod::Command::Gen.help! Pod::StandardError.new "No available platforms in #{spec.name}.podspec match requested platforms: #{configuration.platforms}" if spec_platforms.empty?
102
+
103
+ spec_platforms
104
+ .map do |platform|
105
+ consumer = spec.consumer(platform)
106
+ target_name = "App-#{Platform.string_name(consumer.platform_name)}"
107
+ native_app_target = Pod::Generator::AppTargetHelper.add_app_target(app_project, consumer.platform_name, deployment_target(consumer), target_name)
108
+ # Temporarily set Swift version to pass validator checks for pods which do not specify Swift version.
109
+ # It will then be re-set again within #perform_post_install_steps.
110
+ Pod::Generator::AppTargetHelper.add_swift_version(native_app_target, Pod::Validator::DEFAULT_SWIFT_VERSION)
111
+ native_app_target
112
+ end
113
+ .tap do
114
+ app_project.recreate_user_schemes do |scheme, target|
115
+ installation_result = installation_result_from_target(target)
116
+ next unless installation_result
117
+ installation_result.test_native_targets.each do |test_native_target|
118
+ scheme.add_test_target(test_native_target)
113
119
  end
114
120
  end
115
- .each do |target|
116
- Xcodeproj::XCScheme.share_scheme(app_project.path, target.name)
117
- end
118
-
121
+ end
122
+ .each do |target|
123
+ Xcodeproj::XCScheme.share_scheme(app_project.path, target.name) if target
124
+ end
119
125
  app_project.save
120
126
  end
121
127
 
@@ -91,7 +91,11 @@ module Pod
91
91
 
92
92
  # Add platform-specific concrete targets that inherit the
93
93
  # `pod` declaration for the local pod.
94
- spec.available_platforms.map(&:string_name).sort.each do |platform_name|
94
+ spec_platform_names = spec.available_platforms.map(&:string_name).flatten.each.reject do |platform_name|
95
+ !generator.configuration.platforms.nil? && !generator.configuration.platforms.include?(platform_name.downcase)
96
+ end
97
+
98
+ spec_platform_names.sort.each do |platform_name|
95
99
  target "App-#{platform_name}" do
96
100
  current_target_definition.swift_version = generator.swift_version if generator.swift_version
97
101
  end
@@ -349,6 +353,7 @@ module Pod
349
353
  #
350
354
  def modular_headers?(pod_name)
351
355
  return true if configuration.use_modular_headers?
356
+ return false unless configuration.use_podfile?
352
357
  target_definitions_for_pod(pod_name).all? do |target_definition|
353
358
  target_definition.build_pod_as_module?(pod_name)
354
359
  end
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.5.0
4
+ version: 1.6.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: 2019-05-15 00:00:00.000000000 Z
11
+ date: 2019-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods-disable-podfile-validations
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  requirements: []
104
- rubygems_version: 3.0.1
104
+ rubygems_version: 3.0.4
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Generates Xcode workspaces from a podspec.