pod-builder 0.3.8 ā†’ 0.5.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: e6adf6261775573ce5d92fed4033a6f2cf2621136fece929f952cebefd4f02b4
4
- data.tar.gz: 802eb3e919ebd5a2009364e2fcfa43e5d62eb1c5ff02ceeca8081f688a92a2ee
3
+ metadata.gz: 9cded05bfcf9315ed900e6ed9192277be561abdfc65676f7f7f3e18e8d94faeb
4
+ data.tar.gz: 58cd8fed676594d96f9bee43565dcb02348611420c8cd6dcb4606d4716613c80
5
5
  SHA512:
6
- metadata.gz: 169ad5c3f81b3590764dbfb96eb62ecb23ae418e414723b0ccf1435487139c2f4fbb0160a1a99c79b56740f8954e5e305476128c09a8d9801b7a6559f90d5832
7
- data.tar.gz: 36d9fd43f54a6ea00370b10a54a4d5cc41d24acc03a8a7573c5299bf886e1d2d9a7e29c9d18ec12e224b33fc1975d533815dab95a73f0cf9da429b4fbe5e7a98
6
+ metadata.gz: bf11ab141dc7134f3286bdf3334a0660aaa49e58e42326a2dfa4b361d7b4fa065445974370e2c061a4565a8d989d10de512463c678d70637e02d16d5771a52c7
7
+ data.tar.gz: a79759fc5a4147ebbc80831a40c9f4665aaae3292e850585fe2adc073e53507d9adc508fc908d1197e68c38780d123af0f8b5d6141633b94c43d35d9027ac5b8
data/exe/pod_builder CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- if ENV['RUBYLIB']
3
+ if ENV['DEBUGGING']
4
4
  puts "Running in debug, injecting $LOAD_PATH"
5
5
  libdir = File.expand_path("#{File.dirname(__FILE__)}/../lib")
6
6
  $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
@@ -285,28 +285,27 @@ Usage:
285
285
  }
286
286
  }
287
287
 
288
- subcommand = subcommands[ARGV.shift]
288
+ argv = ARGV.dup
289
+ if subcommand = subcommands[argv.first]
290
+ ARGV.shift
291
+ else
292
+ subcommand = subcommands["none"]
293
+ end
289
294
 
290
295
  ret = -1
291
- if subcommand
292
- if ARGV.include?("--help") || ARGV.include?("-h")
293
- puts subcommand[:opts].help
294
- else
295
- PodBuilder::Configuration.load
296
-
297
- subcommand[:opts].order!
298
- subcommand[:call].each do |k|
299
- if (ret = k.call(OPTIONS)) && ret == -1
300
- puts subcommand[:opts].help
301
- end
296
+ show_help = argv.include?("--help") || argv.include?("-h") || argv.count == 0
297
+ if show_help
298
+ puts subcommand[:opts].help
299
+ else
300
+ PodBuilder::Configuration.load
301
+
302
+ subcommand[:opts].order!
303
+ subcommand[:call].each do |k|
304
+ if (ret = k.call(OPTIONS)) && ret == -1
305
+ puts subcommand[:opts].help
302
306
  end
303
- end
304
- else
305
- subcommands["none"][:opts].order!
306
- if subcommands["none"][:call].first&.call(OPTIONS) != 0
307
- puts subcommands["none"][:opts].help
308
307
  end
309
- end
308
+ end
310
309
 
311
310
  return ret
312
311
  end
@@ -15,6 +15,8 @@ module PodBuilder
15
15
  installer.repo_update = repo_update
16
16
  installer.update = false
17
17
 
18
+ installer.prepare
19
+
18
20
  analyzer = installer.resolve_dependencies
19
21
 
20
22
  Dir.chdir(current_dir)
@@ -10,18 +10,27 @@ module PodBuilder
10
10
 
11
11
  podfile_path = PodBuilder::basepath("Podfile.restore")
12
12
  podfile_content = File.read(podfile_path)
13
-
13
+
14
+ podspec_path = PodBuilder::basepath("PodBuilder.podspec")
15
+ podspec_content = File.read(podspec_path).split("\n")
16
+
14
17
  pod_entries = []
15
18
  podfile_content.each_line do |line|
16
19
  if pod_entry = pod_entry_in(line)
17
- if line.match(/(pb<)(.*?)(>)/) # is not prebuilt
18
- pod_entries.push(pod_entry)
20
+ if (matches = line.match(/(pb<)(.*?)(>)/)) && matches.size == 4 # is not prebuilt
21
+ # we make sure that the podname is contained in PodBuilder's podspec
22
+ # which guarantees that the pod was precompiled with PodBuilder
23
+ podspec_line = " s.subspec '#{matches[2]}' do |p|"
24
+ if podspec_content.include?(podspec_line)
25
+ pod_entries.push(pod_entry)
26
+ end
19
27
  end
20
28
  end
21
29
  end
22
30
 
23
31
  pod_entries.uniq!
24
32
 
33
+ # inspect existing .framework files removing valid pod_entries from the array (those with matching pod version and swift compiler)
25
34
  Dir.glob(PodBuilder::basepath("Rome/**/*.framework")) do |framework_path|
26
35
  framework_name = File.basename(framework_path)
27
36
  plist_filename = File.join(framework_path, Configuration.framework_plist_filename)
@@ -85,7 +85,9 @@ module PodBuilder
85
85
  end
86
86
 
87
87
  def self.system_swift_version
88
- return `swiftc --version | grep -o 'swiftlang-.*\s'`.strip()
88
+ swift_version = `swiftc --version | grep -o 'swiftlang-.*\s'`.strip()
89
+ raise "Unsupported swift compiler version, expecting `swiftlang` keyword in `swiftc --version`" if swift_version.length == 0
90
+ return swift_version
89
91
  end
90
92
 
91
93
  private
@@ -14,7 +14,7 @@ module PodBuilder
14
14
  cwd = File.dirname(File.expand_path(__FILE__))
15
15
  podfile = File.read("#{cwd}/templates/build_podfile.template")
16
16
 
17
- platform = analyzer.result.targets.first.platform
17
+ platform = analyzer.instance_variable_get("@result").targets.first.platform
18
18
  podfile.sub!("%%%platform_name%%%", platform.name.to_s)
19
19
  podfile.sub!("%%%deployment_version%%%", platform.deployment_target.version)
20
20
 
@@ -103,17 +103,17 @@ module PodBuilder
103
103
  }
104
104
  end
105
105
 
106
- result_targets = analyzer.result.targets.map(&:name)
106
+ result_targets = analyzer.instance_variable_get("@result").targets.map(&:name)
107
107
  podfile_content = ["# Autogenerated by PodBuilder (https://github.com/Subito-it/PodBuilder)", "# Please don't modify this file", "\n"]
108
108
  podfile_content += analyzer.podfile.sources.map { |x| "source '#{x}'" }
109
109
  podfile_content += ["", "use_frameworks!", ""]
110
110
 
111
111
  # multiple platforms not (yet) supported
112
112
  # https://github.com/CocoaPods/Rome/issues/37
113
- platform = analyzer.result.targets.first.platform
113
+ platform = analyzer.instance_variable_get("@result").targets.first.platform
114
114
  podfile_content += ["platform :#{platform.name}, '#{platform.deployment_target.version}'", ""]
115
115
 
116
- analyzer.result.specs_by_target.each do |target, specifications|
116
+ analyzer.instance_variable_get("@result").specs_by_target.each do |target, specifications|
117
117
  target_name = target.name.to_s
118
118
 
119
119
  unless result_targets.select { |x| x.end_with?(target_name) }.count > 0
@@ -303,7 +303,7 @@ module PodBuilder
303
303
  end
304
304
 
305
305
  def self.project_swift_version(analyzer)
306
- swift_versions = analyzer.result.target_inspections.values.map { |x| x.target_definition.swift_version }.compact.uniq
306
+ swift_versions = analyzer.instance_variable_get("@result").targets.map { |x| x.target_definition.swift_version }.compact.uniq
307
307
 
308
308
  raise "Found different Swift versions in targets. Expecting one, got `#{swift_versions}`" if swift_versions.count != 1
309
309
 
@@ -219,6 +219,7 @@ module PodBuilder
219
219
  embedded_as_static_lib = vendored_items_paths.any? { |x| x.match(/#{module_name}.*\\.a/) != nil }
220
220
 
221
221
  only_headers = @source_files.include?("*.h")
222
+ only_headers |= (source_files.count > 0 && @source_files.all? { |x| x.end_with?(".h") })
222
223
  no_sources = (@source_files.count == 0 || only_headers) && @vendored_items.count > 0
223
224
 
224
225
  return embedded_as_static_lib || embedded_as_vendored || only_headers || no_sources
@@ -36,7 +36,7 @@ module PodBuilder
36
36
 
37
37
  podspec_items = podspec_items_from(buildable_items)
38
38
 
39
- platform = analyzer.result.targets.first.platform
39
+ platform = analyzer.instance_variable_get("@result").targets.first.platform
40
40
  generate_podspec_from(podspec_items, platform)
41
41
  end
42
42
 
@@ -107,7 +107,7 @@ module PodBuilder
107
107
  subspec_exists = File.exist?(PodBuilder::basepath(vendored_subspec_framework_path(pod)))
108
108
 
109
109
  unless spec_exists || subspec_exists
110
- puts "Skipping #{pod.name}, not prebuilt".blue
110
+ puts "Skipping `#{pod.name}`, not prebuilt".blue
111
111
  next
112
112
  end
113
113
 
@@ -59,6 +59,11 @@ end
59
59
  pre_install do |installer|
60
60
  raise "\n\nšŸšØ Do not launch 'pod install' manually, use `pod_builder` instead!\n" if !File.exist?('pod_builder.lock')
61
61
 
62
+ installer.pod_targets.each do |target|
63
+ # set a random version to please CocoaPods, the proper version will be overridden by set_build_settings()
64
+ target.root_spec.swift_version = "1.0"
65
+ end
66
+
62
67
  # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
63
68
  Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
64
69
  Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_duplicate_framework_and_library_names) {}
@@ -1,4 +1,4 @@
1
1
  module PodBuilder
2
- VERSION = "0.3.8"
2
+ VERSION = "0.5.0"
3
3
  end
4
4
 
data/pod-builder.gemspec CHANGED
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
29
29
  spec.add_runtime_dependency 'xcodeproj'
30
30
  spec.add_runtime_dependency 'colored'
31
31
  spec.add_runtime_dependency 'highline'
32
- spec.add_runtime_dependency 'cocoapods', '~> 1.0'
33
- spec.add_runtime_dependency 'cocoapods-core', '~> 1.0'
32
+ spec.add_runtime_dependency 'cocoapods', '~> 1.6'
33
+ spec.add_runtime_dependency 'cocoapods-core', '~> 1.6'
34
34
  spec.add_runtime_dependency 'cocoapods-rome', '~> 1.0'
35
35
  spec.add_runtime_dependency 'CFPropertyList'
36
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pod-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Camin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-29 00:00:00.000000000 Z
11
+ date: 2019-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -114,28 +114,28 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '1.0'
117
+ version: '1.6'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '1.0'
124
+ version: '1.6'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: cocoapods-core
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '1.0'
131
+ version: '1.6'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '1.0'
138
+ version: '1.6'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: cocoapods-rome
141
141
  requirement: !ruby/object:Gem::Requirement