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 +4 -4
- data/exe/pod_builder +18 -19
- data/lib/pod_builder/analyze.rb +2 -0
- data/lib/pod_builder/command/update.rb +12 -3
- data/lib/pod_builder/core.rb +3 -1
- data/lib/pod_builder/podfile.rb +5 -5
- data/lib/pod_builder/podfile_item.rb +1 -0
- data/lib/pod_builder/podspec.rb +2 -2
- data/lib/pod_builder/templates/build_podfile.template +5 -0
- data/lib/pod_builder/version.rb +1 -1
- data/pod-builder.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cded05bfcf9315ed900e6ed9192277be561abdfc65676f7f7f3e18e8d94faeb
|
4
|
+
data.tar.gz: 58cd8fed676594d96f9bee43565dcb02348611420c8cd6dcb4606d4716613c80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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['
|
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
|
-
|
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
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
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
|
data/lib/pod_builder/analyze.rb
CHANGED
@@ -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
|
-
|
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)
|
data/lib/pod_builder/core.rb
CHANGED
@@ -85,7 +85,9 @@ module PodBuilder
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def self.system_swift_version
|
88
|
-
|
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
|
data/lib/pod_builder/podfile.rb
CHANGED
@@ -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.
|
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
|
data/lib/pod_builder/podspec.rb
CHANGED
@@ -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
|
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) {}
|
data/lib/pod_builder/version.rb
CHANGED
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.
|
33
|
-
spec.add_runtime_dependency 'cocoapods-core', '~> 1.
|
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.
|
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-
|
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.
|
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.
|
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.
|
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.
|
138
|
+
version: '1.6'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: cocoapods-rome
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|