cocoapods-binaryhqp 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/ISSUE_TEMPLATE +10 -0
- data/.gitignore +33 -0
- data/.travis.yml +23 -0
- data/.vscode/launch.json +15 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +131 -0
- data/LICENSE.txt +22 -0
- data/README.md +80 -0
- data/Rakefile +13 -0
- data/cocoapods-binaryhqp-0.4.6.gem +0 -0
- data/cocoapods-binaryhqp-0.4.7.gem +0 -0
- data/cocoapods-binaryhqp.gemspec +29 -0
- data/lib/cocoapods-binaryhqp/Integration.rb +292 -0
- data/lib/cocoapods-binaryhqp/Main.rb +165 -0
- data/lib/cocoapods-binaryhqp/Prebuild.rb +291 -0
- data/lib/cocoapods-binaryhqp/gem_version.rb +3 -0
- data/lib/cocoapods-binaryhqp/helper/feature_switches.rb +97 -0
- data/lib/cocoapods-binaryhqp/helper/names.rb +78 -0
- data/lib/cocoapods-binaryhqp/helper/passer.rb +41 -0
- data/lib/cocoapods-binaryhqp/helper/podfile_options.rb +135 -0
- data/lib/cocoapods-binaryhqp/helper/prebuild_sandbox.rb +82 -0
- data/lib/cocoapods-binaryhqp/helper/target_checker.rb +49 -0
- data/lib/cocoapods-binaryhqp/rome/build_framework.rb +202 -0
- data/lib/cocoapods-binaryhqp/tool/tool.rb +12 -0
- data/lib/cocoapods-binaryhqp.rb +1 -0
- data/lib/cocoapods_plugin.rb +2 -0
- data/spec/spec_helper.rb +50 -0
- metadata +157 -0
@@ -0,0 +1,135 @@
|
|
1
|
+
module Pod
|
2
|
+
|
3
|
+
class Prebuild
|
4
|
+
def self.keyword
|
5
|
+
:binary
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class Podfile
|
10
|
+
class TargetDefinition
|
11
|
+
|
12
|
+
## --- option for setting using prebuild framework ---
|
13
|
+
def parse_prebuild_framework(name, requirements)
|
14
|
+
should_prebuild = Pod::Podfile::DSL.prebuild_all
|
15
|
+
|
16
|
+
options = requirements.last
|
17
|
+
if options.is_a?(Hash) && options[Pod::Prebuild.keyword] != nil
|
18
|
+
should_prebuild = options.delete(Pod::Prebuild.keyword)
|
19
|
+
requirements.pop if options.empty?
|
20
|
+
end
|
21
|
+
|
22
|
+
pod_name = Specification.root_name(name)
|
23
|
+
set_prebuild_for_pod(pod_name, should_prebuild)
|
24
|
+
end
|
25
|
+
|
26
|
+
def set_prebuild_for_pod(pod_name, should_prebuild)
|
27
|
+
|
28
|
+
if should_prebuild == true
|
29
|
+
@prebuild_framework_pod_names ||= []
|
30
|
+
@prebuild_framework_pod_names.push pod_name
|
31
|
+
elsif should_prebuild == false
|
32
|
+
@should_not_prebuild_framework_pod_names ||= []
|
33
|
+
@should_not_prebuild_framework_pod_names.push pod_name
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def prebuild_framework_pod_names
|
38
|
+
names = @prebuild_framework_pod_names || []
|
39
|
+
if parent != nil and parent.kind_of? TargetDefinition
|
40
|
+
names += parent.prebuild_framework_pod_names
|
41
|
+
end
|
42
|
+
names
|
43
|
+
end
|
44
|
+
def should_not_prebuild_framework_pod_names
|
45
|
+
names = @should_not_prebuild_framework_pod_names || []
|
46
|
+
if parent != nil and parent.kind_of? TargetDefinition
|
47
|
+
names += parent.should_not_prebuild_framework_pod_names
|
48
|
+
end
|
49
|
+
names
|
50
|
+
end
|
51
|
+
|
52
|
+
# ---- patch method ----
|
53
|
+
# We want modify `store_pod` method, but it's hard to insert a line in the
|
54
|
+
# implementation. So we patch a method called in `store_pod`.
|
55
|
+
old_method = instance_method(:parse_inhibit_warnings)
|
56
|
+
|
57
|
+
define_method(:parse_inhibit_warnings) do |name, requirements|
|
58
|
+
variables = requirements
|
59
|
+
parse_prebuild_framework(name, requirements)
|
60
|
+
old_method.bind(self).(name, variables)
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
module Pod
|
69
|
+
class Installer
|
70
|
+
|
71
|
+
def prebuild_pod_targets
|
72
|
+
@prebuild_pod_targets ||= (
|
73
|
+
all = []
|
74
|
+
|
75
|
+
aggregate_targets = self.aggregate_targets
|
76
|
+
aggregate_targets.each do |aggregate_target|
|
77
|
+
target_definition = aggregate_target.target_definition
|
78
|
+
targets = aggregate_target.pod_targets || []
|
79
|
+
# filter prebuild
|
80
|
+
prebuild_names = target_definition.prebuild_framework_pod_names
|
81
|
+
if not Podfile::DSL.prebuild_all
|
82
|
+
targets = targets.select { |pod_target| prebuild_names.include?(pod_target.pod_name) }
|
83
|
+
end
|
84
|
+
|
85
|
+
dependency_targets = targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || []
|
86
|
+
|
87
|
+
targets = (targets + dependency_targets).uniq
|
88
|
+
# filter should not prebuild
|
89
|
+
explict_should_not_names = target_definition.should_not_prebuild_framework_pod_names
|
90
|
+
Pod::UI.puts(">>>>>>> 不需要二进制的framework: #{explict_should_not_names} ") if config.verbose
|
91
|
+
targets = targets.reject { |pod_target| explict_should_not_names.include?(pod_target.pod_name) }
|
92
|
+
|
93
|
+
all += targets
|
94
|
+
|
95
|
+
end
|
96
|
+
all = all.reject {|pod_target| sandbox.local?(pod_target.pod_name) }
|
97
|
+
Pod::UI.puts(">>>>>>> 需要二进制的framework: #{all}") if config.verbose
|
98
|
+
all.uniq
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
)
|
103
|
+
end
|
104
|
+
|
105
|
+
# the root names who needs prebuild, including dependency pods.
|
106
|
+
def prebuild_pod_names
|
107
|
+
@prebuild_pod_names ||= self.prebuild_pod_targets.map(&:pod_name)
|
108
|
+
end
|
109
|
+
|
110
|
+
|
111
|
+
def validate_every_pod_only_have_one_form
|
112
|
+
|
113
|
+
multi_targets_pods = self.pod_targets.group_by do |t|
|
114
|
+
t.pod_name
|
115
|
+
end.select do |k, v|
|
116
|
+
v.map{|t| t.platform.name }.count > 1
|
117
|
+
end
|
118
|
+
|
119
|
+
multi_targets_pods = multi_targets_pods.reject do |name, targets|
|
120
|
+
contained = targets.map{|t| self.prebuild_pod_targets.include? t }
|
121
|
+
contained.uniq.count == 1 # all equal
|
122
|
+
end
|
123
|
+
|
124
|
+
return if multi_targets_pods.empty?
|
125
|
+
|
126
|
+
warnings = "One pod can only be prebuilt or not prebuilt. These pod have different forms in multiple targets:\n"
|
127
|
+
warnings += multi_targets_pods.map{|name, targets| " #{name}: #{targets.map{|t|t.platform.name}}"}.join("\n")
|
128
|
+
raise Informative, warnings
|
129
|
+
end
|
130
|
+
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
|
135
|
+
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require_relative "names"
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
class PrebuildSandbox < Sandbox
|
5
|
+
|
6
|
+
# [String] standard_sandbox_path
|
7
|
+
def self.from_standard_sanbox_path(path)
|
8
|
+
prebuild_sandbox_path = Pathname.new(path).realpath + "_Prebuild"
|
9
|
+
self.new(prebuild_sandbox_path)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.from_standard_sandbox(sandbox)
|
13
|
+
self.from_standard_sanbox_path(sandbox.root)
|
14
|
+
end
|
15
|
+
|
16
|
+
def standard_sanbox_path
|
17
|
+
self.root.parent
|
18
|
+
end
|
19
|
+
|
20
|
+
def generate_framework_path
|
21
|
+
self.root + "GeneratedFrameworks"
|
22
|
+
end
|
23
|
+
|
24
|
+
# @param name [String] pass the target.name (may containing platform suffix)
|
25
|
+
# @return [Pathname] the folder containing the framework file.
|
26
|
+
def framework_folder_path_for_target_name(name)
|
27
|
+
self.generate_framework_path + name
|
28
|
+
end
|
29
|
+
|
30
|
+
def plist_path_for_target_name(name)
|
31
|
+
framework_path = framework_folder_path_for_target_name(name)
|
32
|
+
"#{framework_path}/#{name}.framework/Info.plist"
|
33
|
+
end
|
34
|
+
|
35
|
+
def source_framework_path(name)
|
36
|
+
self.root + name
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
def exsited_framework_target_names
|
41
|
+
exsited_framework_name_pairs.map {|pair| pair[0]}.uniq
|
42
|
+
end
|
43
|
+
def exsited_framework_pod_names
|
44
|
+
exsited_framework_name_pairs.map {|pair| pair[1]}.uniq
|
45
|
+
end
|
46
|
+
def existed_target_names_for_pod_name(pod_name)
|
47
|
+
exsited_framework_name_pairs.select {|pair| pair[1] == pod_name }.map { |pair| pair[0]}
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
def save_pod_name_for_target(target)
|
53
|
+
folder = framework_folder_path_for_target_name(target.name)
|
54
|
+
return unless folder.exist?
|
55
|
+
flag_file_path = folder + "#{target.pod_name}.pod_name"
|
56
|
+
File.write(flag_file_path.to_s, "")
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
def pod_name_for_target_folder(target_folder_path)
|
63
|
+
name = Pathname.new(target_folder_path).children.find do |child|
|
64
|
+
child.to_s.end_with? ".pod_name"
|
65
|
+
end
|
66
|
+
name = name.basename(".pod_name").to_s unless name.nil?
|
67
|
+
name ||= Pathname.new(target_folder_path).basename.to_s # for compatibility with older version
|
68
|
+
end
|
69
|
+
|
70
|
+
# Array<[target_name, pod_name]>
|
71
|
+
def exsited_framework_name_pairs
|
72
|
+
return [] unless generate_framework_path.exist?
|
73
|
+
generate_framework_path.children().map do |framework_path|
|
74
|
+
if framework_path.directory? && (not framework_path.children.empty?)
|
75
|
+
[framework_path.basename.to_s, pod_name_for_target_folder(framework_path)]
|
76
|
+
else
|
77
|
+
nil
|
78
|
+
end
|
79
|
+
end.reject(&:nil?).uniq
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
module Pod
|
3
|
+
class Prebuild
|
4
|
+
|
5
|
+
# Check the targets, for the current limitation of the plugin
|
6
|
+
#
|
7
|
+
# @param [Array<PodTarget>] prebuilt_targets
|
8
|
+
def self.check_one_pod_should_have_only_one_target(prebuilt_targets)
|
9
|
+
|
10
|
+
targets_have_different_platforms = prebuilt_targets.select {|t| t.pod_name != t.name }
|
11
|
+
|
12
|
+
if targets_have_different_platforms.count > 0
|
13
|
+
names = targets_have_different_platforms.map(&:pod_name)
|
14
|
+
raw_names = targets_have_different_platforms.map(&:name)
|
15
|
+
message = "Oops, you came across a limitation of cocoapods-binaryhqp.
|
16
|
+
|
17
|
+
The plugin requires that one pod should have ONLY ONE target in the 'Pod.xcodeproj'. There are mainly 2 situations \
|
18
|
+
causing this problem:
|
19
|
+
|
20
|
+
1. One pod integrates in 2 or more different platforms' targets. e.g.
|
21
|
+
```
|
22
|
+
target 'iphoneApp' do
|
23
|
+
pod 'A', :binary => true
|
24
|
+
end
|
25
|
+
target 'watchApp' do
|
26
|
+
pod 'A'
|
27
|
+
end
|
28
|
+
```
|
29
|
+
|
30
|
+
2. Use different subspecs in multiple targets. e.g.
|
31
|
+
```
|
32
|
+
target 'iphoneApp' do
|
33
|
+
pod 'A/core'
|
34
|
+
pod 'A/network'
|
35
|
+
end
|
36
|
+
target 'iphoneAppTest' do
|
37
|
+
pod 'A/core'
|
38
|
+
end
|
39
|
+
```
|
40
|
+
|
41
|
+
Related pods: #{names}, target names: #{raw_names}
|
42
|
+
"
|
43
|
+
raise Informative, message
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,202 @@
|
|
1
|
+
require 'fourflusher'
|
2
|
+
require 'xcpretty'
|
3
|
+
|
4
|
+
CONFIGURATION = "Debug"
|
5
|
+
PLATFORMS = { 'iphonesimulator' => 'iOS',
|
6
|
+
'appletvsimulator' => 'tvOS',
|
7
|
+
'watchsimulator' => 'watchOS' }
|
8
|
+
|
9
|
+
# Build specific target to framework file
|
10
|
+
# @param [PodTarget] target
|
11
|
+
# a specific pod target
|
12
|
+
#
|
13
|
+
def build_for_iosish_platform(sandbox,
|
14
|
+
build_dir,
|
15
|
+
output_path,
|
16
|
+
target,
|
17
|
+
device,
|
18
|
+
simulator,
|
19
|
+
bitcode_enabled,
|
20
|
+
custom_build_options = [], # Array<String>
|
21
|
+
custom_build_options_simulator = [] # Array<String>
|
22
|
+
)
|
23
|
+
|
24
|
+
deployment_target = target.platform.deployment_target.to_s
|
25
|
+
|
26
|
+
target_label = target.label # name with platform if it's used in multiple platforms
|
27
|
+
Pod::UI.puts "Prebuilding #{target_label}..."
|
28
|
+
|
29
|
+
other_options = []
|
30
|
+
# bitcode enabled
|
31
|
+
other_options += ['BITCODE_GENERATION_MODE=bitcode'] if bitcode_enabled
|
32
|
+
# make less arch to iphone simulator for faster build
|
33
|
+
custom_build_options_simulator += ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'] if simulator == 'iphonesimulator'
|
34
|
+
|
35
|
+
is_succeed, _ = xcodebuild(sandbox, target_label, device, deployment_target, other_options + custom_build_options)
|
36
|
+
exit 1 unless is_succeed
|
37
|
+
is_succeed, _ = xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + custom_build_options_simulator)
|
38
|
+
exit 1 unless is_succeed
|
39
|
+
|
40
|
+
# paths
|
41
|
+
target_name = target.name # equals target.label, like "AFNeworking-iOS" when AFNetworking is used in multiple platforms.
|
42
|
+
module_name = target.product_module_name
|
43
|
+
device_framework_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}/#{module_name}.framework"
|
44
|
+
simulator_framework_path = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}/#{module_name}.framework"
|
45
|
+
|
46
|
+
device_binary = device_framework_path + "/#{module_name}"
|
47
|
+
simulator_binary = simulator_framework_path + "/#{module_name}"
|
48
|
+
return unless File.file?(device_binary) && File.file?(simulator_binary)
|
49
|
+
|
50
|
+
# the device_lib path is the final output file path
|
51
|
+
# combine the binaries
|
52
|
+
tmp_lipoed_binary_path = "#{build_dir}/#{target_name}"
|
53
|
+
lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_binary} #{simulator_binary}`
|
54
|
+
puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
|
55
|
+
FileUtils.mv tmp_lipoed_binary_path, device_binary, :force => true
|
56
|
+
|
57
|
+
# collect the swiftmodule file for various archs.
|
58
|
+
device_swiftmodule_path = device_framework_path + "/Modules/#{module_name}.swiftmodule"
|
59
|
+
simulator_swiftmodule_path = simulator_framework_path + "/Modules/#{module_name}.swiftmodule"
|
60
|
+
if File.exist?(device_swiftmodule_path)
|
61
|
+
FileUtils.cp_r simulator_swiftmodule_path + "/.", device_swiftmodule_path
|
62
|
+
end
|
63
|
+
|
64
|
+
# combine the generated swift headers
|
65
|
+
# (In xcode 10.2, the generated swift headers vary for each archs)
|
66
|
+
# https://github.com/leavez/cocoapods-binary/issues/58
|
67
|
+
simulator_generated_swift_header_path = simulator_framework_path + "/Headers/#{module_name}-Swift.h"
|
68
|
+
device_generated_swift_header_path = device_framework_path + "/Headers/#{module_name}-Swift.h"
|
69
|
+
if File.exist? simulator_generated_swift_header_path
|
70
|
+
device_header = File.read(device_generated_swift_header_path)
|
71
|
+
simulator_header = File.read(simulator_generated_swift_header_path)
|
72
|
+
# https://github.com/Carthage/Carthage/issues/2718#issuecomment-473870461
|
73
|
+
combined_header_content = %Q{
|
74
|
+
#if TARGET_OS_SIMULATOR // merged by cocoapods-binaryhqp
|
75
|
+
|
76
|
+
#{simulator_header}
|
77
|
+
|
78
|
+
#else // merged by cocoapods-binaryhqp
|
79
|
+
|
80
|
+
#{device_header}
|
81
|
+
|
82
|
+
#endif // merged by cocoapods-binaryhqp
|
83
|
+
}
|
84
|
+
File.write(device_generated_swift_header_path, combined_header_content.strip)
|
85
|
+
end
|
86
|
+
|
87
|
+
# # handle the dSYM files
|
88
|
+
# device_dsym = "#{device_framework_path}.dSYM"
|
89
|
+
# if File.exist? device_dsym
|
90
|
+
# # lipo the simulator dsym
|
91
|
+
# simulator_dsym = "#{simulator_framework_path}.dSYM"
|
92
|
+
# if File.exist? simulator_dsym
|
93
|
+
# tmp_lipoed_binary_path = "#{output_path}/#{module_name}.draft"
|
94
|
+
# lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_dsym}/Contents/Resources/DWARF/#{module_name} #{simulator_dsym}/Contents/Resources/DWARF/#{module_name}`
|
95
|
+
# puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
|
96
|
+
# FileUtils.mv tmp_lipoed_binary_path, "#{device_framework_path}.dSYM/Contents/Resources/DWARF/#{module_name}", :force => true
|
97
|
+
# end
|
98
|
+
# # move
|
99
|
+
# FileUtils.mv device_dsym, output_path, :force => true
|
100
|
+
# end
|
101
|
+
|
102
|
+
# # output
|
103
|
+
output_path.mkpath unless output_path.exist?
|
104
|
+
FileUtils.mv device_framework_path, output_path, :force => true
|
105
|
+
|
106
|
+
end
|
107
|
+
|
108
|
+
def xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil, other_options=[])
|
109
|
+
args = %W(-project #{sandbox.project_path.realdirpath} -scheme #{target} -configuration #{CONFIGURATION} -sdk #{sdk} )
|
110
|
+
platform = PLATFORMS[sdk]
|
111
|
+
args += Fourflusher::SimControl.new.destination(:oldest, platform, deployment_target) unless platform.nil?
|
112
|
+
args += other_options
|
113
|
+
log = `xcodebuild #{args.join(" ")} 2>&1`
|
114
|
+
exit_code = $?.exitstatus # Process::Status
|
115
|
+
is_succeed = (exit_code == 0)
|
116
|
+
|
117
|
+
if !is_succeed
|
118
|
+
begin
|
119
|
+
if log.include?('** BUILD FAILED **')
|
120
|
+
# use xcpretty to print build log
|
121
|
+
# 64 represent command invalid. http://www.manpagez.com/man/3/sysexits/
|
122
|
+
printer = XCPretty::Printer.new({:formatter => XCPretty::Simple, :colorize => 'auto'})
|
123
|
+
log.each_line do |line|
|
124
|
+
printer.pretty_print(line)
|
125
|
+
end
|
126
|
+
else
|
127
|
+
raise "shouldn't be handle by xcpretty"
|
128
|
+
end
|
129
|
+
rescue
|
130
|
+
puts log.red
|
131
|
+
end
|
132
|
+
end
|
133
|
+
[is_succeed, log]
|
134
|
+
end
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
module Pod
|
139
|
+
class Prebuild
|
140
|
+
|
141
|
+
# Build the frameworks with sandbox and targets
|
142
|
+
#
|
143
|
+
# @param [String] sandbox_root_path
|
144
|
+
# The sandbox root path where the targets project place
|
145
|
+
#
|
146
|
+
# [PodTarget] target
|
147
|
+
# The pod targets to build
|
148
|
+
#
|
149
|
+
# [Pathname] output_path
|
150
|
+
# output path for generated frameworks
|
151
|
+
#
|
152
|
+
def self.build(sandbox_root_path, target, output_path, bitcode_enabled = false, custom_build_options=[], custom_build_options_simulator=[])
|
153
|
+
|
154
|
+
return if target.nil?
|
155
|
+
|
156
|
+
sandbox_root = Pathname(sandbox_root_path)
|
157
|
+
sandbox = Pod::Sandbox.new(sandbox_root)
|
158
|
+
build_dir = self.build_dir(sandbox_root)
|
159
|
+
|
160
|
+
# -- build the framework
|
161
|
+
case target.platform.name
|
162
|
+
when :ios then build_for_iosish_platform(sandbox, build_dir, output_path, target, 'iphoneos', 'iphonesimulator', bitcode_enabled, custom_build_options, custom_build_options_simulator)
|
163
|
+
when :osx then xcodebuild(sandbox, target.label, 'macosx', nil, custom_build_options)
|
164
|
+
# when :tvos then build_for_iosish_platform(sandbox, build_dir, target, 'appletvos', 'appletvsimulator')
|
165
|
+
when :watchos then build_for_iosish_platform(sandbox, build_dir, output_path, target, 'watchos', 'watchsimulator', true, custom_build_options, custom_build_options_simulator)
|
166
|
+
else raise "Unsupported platform for '#{target.name}': '#{target.platform.name}'" end
|
167
|
+
|
168
|
+
raise Pod::Informative, 'The build directory was not found in the expected location.' unless build_dir.directory?
|
169
|
+
|
170
|
+
# # --- copy the vendored libraries and framework
|
171
|
+
# frameworks = build_dir.children.select{ |path| File.extname(path) == ".framework" }
|
172
|
+
# Pod::UI.puts "Built #{frameworks.count} #{'frameworks'.pluralize(frameworks.count)}"
|
173
|
+
|
174
|
+
# pod_target = target
|
175
|
+
# consumer = pod_target.root_spec.consumer(pod_target.platform.name)
|
176
|
+
# file_accessor = Pod::Sandbox::FileAccessor.new(sandbox.pod_dir(pod_target.pod_name), consumer)
|
177
|
+
# frameworks += file_accessor.vendored_libraries
|
178
|
+
# frameworks += file_accessor.vendored_frameworks
|
179
|
+
|
180
|
+
# frameworks.uniq!
|
181
|
+
|
182
|
+
# frameworks.each do |framework|
|
183
|
+
# FileUtils.mkdir_p destination
|
184
|
+
# FileUtils.cp_r framework, destination, :remove_destination => true
|
185
|
+
# end
|
186
|
+
# build_dir.rmtree if build_dir.directory?
|
187
|
+
end
|
188
|
+
|
189
|
+
def self.remove_build_dir(sandbox_root)
|
190
|
+
path = build_dir(sandbox_root)
|
191
|
+
path.rmtree if path.exist?
|
192
|
+
end
|
193
|
+
|
194
|
+
private
|
195
|
+
|
196
|
+
def self.build_dir(sandbox_root)
|
197
|
+
# don't know why xcode chose this folder
|
198
|
+
sandbox_root.parent + 'build'
|
199
|
+
end
|
200
|
+
|
201
|
+
end
|
202
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-binaryhqp/gem_version'
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
|
3
|
+
$:.unshift((ROOT + 'lib').to_s)
|
4
|
+
$:.unshift((ROOT + 'spec').to_s)
|
5
|
+
|
6
|
+
require 'bundler/setup'
|
7
|
+
require 'bacon'
|
8
|
+
require 'mocha-on-bacon'
|
9
|
+
require 'pretty_bacon'
|
10
|
+
require 'pathname'
|
11
|
+
require 'cocoapods'
|
12
|
+
|
13
|
+
Mocha::Configuration.prevent(:stubbing_non_existent_method)
|
14
|
+
|
15
|
+
require 'cocoapods_plugin'
|
16
|
+
|
17
|
+
#-----------------------------------------------------------------------------#
|
18
|
+
|
19
|
+
module Pod
|
20
|
+
|
21
|
+
# Disable the wrapping so the output is deterministic in the tests.
|
22
|
+
#
|
23
|
+
UI.disable_wrap = true
|
24
|
+
|
25
|
+
# Redirects the messages to an internal store.
|
26
|
+
#
|
27
|
+
module UI
|
28
|
+
@output = ''
|
29
|
+
@warnings = ''
|
30
|
+
|
31
|
+
class << self
|
32
|
+
attr_accessor :output
|
33
|
+
attr_accessor :warnings
|
34
|
+
|
35
|
+
def puts(message = '')
|
36
|
+
@output << "#{message}\n"
|
37
|
+
end
|
38
|
+
|
39
|
+
def warn(message = '', actions = [])
|
40
|
+
@warnings << "#{message}\n"
|
41
|
+
end
|
42
|
+
|
43
|
+
def print(message)
|
44
|
+
@output << message
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
#-----------------------------------------------------------------------------#
|
metadata
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-binaryhqp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.8
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- leavez
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-11-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cocoapods
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: fourflusher
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: xcpretty
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: CFPropertyList
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: integrate pods in form of prebuilt frameworks conveniently, reducing
|
98
|
+
compile time
|
99
|
+
email:
|
100
|
+
- gaojiji@gmail.com
|
101
|
+
executables: []
|
102
|
+
extensions: []
|
103
|
+
extra_rdoc_files: []
|
104
|
+
files:
|
105
|
+
- ".github/ISSUE_TEMPLATE"
|
106
|
+
- ".gitignore"
|
107
|
+
- ".travis.yml"
|
108
|
+
- ".vscode/launch.json"
|
109
|
+
- Gemfile
|
110
|
+
- Gemfile.lock
|
111
|
+
- LICENSE.txt
|
112
|
+
- README.md
|
113
|
+
- Rakefile
|
114
|
+
- cocoapods-binaryhqp-0.4.6.gem
|
115
|
+
- cocoapods-binaryhqp-0.4.7.gem
|
116
|
+
- cocoapods-binaryhqp.gemspec
|
117
|
+
- lib/cocoapods-binaryhqp.rb
|
118
|
+
- lib/cocoapods-binaryhqp/Integration.rb
|
119
|
+
- lib/cocoapods-binaryhqp/Main.rb
|
120
|
+
- lib/cocoapods-binaryhqp/Prebuild.rb
|
121
|
+
- lib/cocoapods-binaryhqp/gem_version.rb
|
122
|
+
- lib/cocoapods-binaryhqp/helper/feature_switches.rb
|
123
|
+
- lib/cocoapods-binaryhqp/helper/names.rb
|
124
|
+
- lib/cocoapods-binaryhqp/helper/passer.rb
|
125
|
+
- lib/cocoapods-binaryhqp/helper/podfile_options.rb
|
126
|
+
- lib/cocoapods-binaryhqp/helper/prebuild_sandbox.rb
|
127
|
+
- lib/cocoapods-binaryhqp/helper/target_checker.rb
|
128
|
+
- lib/cocoapods-binaryhqp/rome/build_framework.rb
|
129
|
+
- lib/cocoapods-binaryhqp/tool/tool.rb
|
130
|
+
- lib/cocoapods_plugin.rb
|
131
|
+
- spec/spec_helper.rb
|
132
|
+
homepage: https://www.baidu.com
|
133
|
+
licenses:
|
134
|
+
- MIT
|
135
|
+
metadata: {}
|
136
|
+
post_install_message:
|
137
|
+
rdoc_options: []
|
138
|
+
require_paths:
|
139
|
+
- lib
|
140
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
requirements: []
|
151
|
+
rubygems_version: 3.1.4
|
152
|
+
signing_key:
|
153
|
+
specification_version: 4
|
154
|
+
summary: A CocoaPods plugin to integrate pods in form of prebuilt frameworks, not
|
155
|
+
source code, by adding just one flag in podfile. Speed up compiling dramatically.
|
156
|
+
test_files:
|
157
|
+
- spec/spec_helper.rb
|