cocoapods-ppbuild 0.0.1
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 +7 -0
- data/lib/cocoapods-ppbuild/Integration.rb +306 -0
- data/lib/cocoapods-ppbuild/Main.rb +177 -0
- data/lib/cocoapods-ppbuild/Prebuild.rb +236 -0
- data/lib/cocoapods-ppbuild/command/ppbuild.rb +216 -0
- data/lib/cocoapods-ppbuild/command.rb +1 -0
- data/lib/cocoapods-ppbuild/gem_version.rb +3 -0
- data/lib/cocoapods-ppbuild/helper/feature_switches.rb +97 -0
- data/lib/cocoapods-ppbuild/helper/names.rb +78 -0
- data/lib/cocoapods-ppbuild/helper/passer.rb +41 -0
- data/lib/cocoapods-ppbuild/helper/podfile_options.rb +128 -0
- data/lib/cocoapods-ppbuild/helper/prebuild_sandbox.rb +109 -0
- data/lib/cocoapods-ppbuild/helper/target_checker.rb +49 -0
- data/lib/cocoapods-ppbuild/rome/build_framework.rb +199 -0
- data/lib/cocoapods-ppbuild/tool/tool.rb +12 -0
- data/lib/cocoapods-ppbuild.rb +1 -0
- data/lib/cocoapods_plugin.rb +4 -0
- metadata +87 -0
@@ -0,0 +1,128 @@
|
|
1
|
+
module Pod
|
2
|
+
|
3
|
+
class Prebuild
|
4
|
+
def self.keyword
|
5
|
+
:ppbuild
|
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
|
+
options = requirements.last
|
16
|
+
if options.is_a?(Hash) && options[Pod::Prebuild.keyword] != nil
|
17
|
+
should_prebuild = options.delete(Pod::Prebuild.keyword)
|
18
|
+
requirements.pop if options.empty?
|
19
|
+
end
|
20
|
+
|
21
|
+
pod_name = Specification.root_name(name)
|
22
|
+
set_prebuild_for_pod(pod_name, should_prebuild)
|
23
|
+
end
|
24
|
+
|
25
|
+
def set_prebuild_for_pod(pod_name, should_prebuild)
|
26
|
+
|
27
|
+
if should_prebuild == true
|
28
|
+
@prebuild_framework_pod_names ||= []
|
29
|
+
@prebuild_framework_pod_names.push pod_name
|
30
|
+
else
|
31
|
+
@should_not_prebuild_framework_pod_names ||= []
|
32
|
+
@should_not_prebuild_framework_pod_names.push pod_name
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def prebuild_framework_pod_names
|
37
|
+
names = @prebuild_framework_pod_names || []
|
38
|
+
if parent != nil and parent.kind_of? TargetDefinition
|
39
|
+
names += parent.prebuild_framework_pod_names
|
40
|
+
end
|
41
|
+
names
|
42
|
+
end
|
43
|
+
def should_not_prebuild_framework_pod_names
|
44
|
+
names = @should_not_prebuild_framework_pod_names || []
|
45
|
+
if parent != nil and parent.kind_of? TargetDefinition
|
46
|
+
names += parent.should_not_prebuild_framework_pod_names
|
47
|
+
end
|
48
|
+
names
|
49
|
+
end
|
50
|
+
|
51
|
+
# ---- patch method ----
|
52
|
+
# We want modify `store_pod` method, but it's hard to insert a line in the
|
53
|
+
# implementation. So we patch a method called in `store_pod`.
|
54
|
+
old_method = instance_method(:parse_inhibit_warnings)
|
55
|
+
|
56
|
+
define_method(:parse_inhibit_warnings) do |name, requirements|
|
57
|
+
parse_prebuild_framework(name, requirements)
|
58
|
+
old_method.bind(self).(name, requirements)
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
|
66
|
+
module Pod
|
67
|
+
class Installer
|
68
|
+
|
69
|
+
def prebuild_pod_targets
|
70
|
+
@prebuild_pod_targets ||= (
|
71
|
+
all = []
|
72
|
+
|
73
|
+
aggregate_targets = self.aggregate_targets
|
74
|
+
aggregate_targets.each do |aggregate_target|
|
75
|
+
target_definition = aggregate_target.target_definition
|
76
|
+
targets = aggregate_target.pod_targets || []
|
77
|
+
|
78
|
+
# filter prebuild
|
79
|
+
prebuild_names = target_definition.prebuild_framework_pod_names
|
80
|
+
if not Podfile::DSL.prebuild_all
|
81
|
+
targets = targets.select { |pod_target| prebuild_names.include?(pod_target.pod_name) }
|
82
|
+
end
|
83
|
+
dependency_targets = targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || []
|
84
|
+
targets = (targets + dependency_targets).uniq
|
85
|
+
|
86
|
+
# filter should not prebuild
|
87
|
+
explict_should_not_names = target_definition.should_not_prebuild_framework_pod_names
|
88
|
+
targets = targets.reject { |pod_target| explict_should_not_names.include?(pod_target.pod_name) }
|
89
|
+
|
90
|
+
all += targets
|
91
|
+
end
|
92
|
+
|
93
|
+
all = all.reject {|pod_target| sandbox.local?(pod_target.pod_name) }
|
94
|
+
all.uniq
|
95
|
+
)
|
96
|
+
end
|
97
|
+
|
98
|
+
# the root names who needs prebuild, including dependency pods.
|
99
|
+
def prebuild_pod_names
|
100
|
+
@prebuild_pod_names ||= self.prebuild_pod_targets.map(&:pod_name)
|
101
|
+
end
|
102
|
+
|
103
|
+
|
104
|
+
def validate_every_pod_only_have_one_form
|
105
|
+
|
106
|
+
multi_targets_pods = self.pod_targets.group_by do |t|
|
107
|
+
t.pod_name
|
108
|
+
end.select do |k, v|
|
109
|
+
v.map{|t| t.platform.name }.count > 1
|
110
|
+
end
|
111
|
+
|
112
|
+
multi_targets_pods = multi_targets_pods.reject do |name, targets|
|
113
|
+
contained = targets.map{|t| self.prebuild_pod_targets.include? t }
|
114
|
+
contained.uniq.count == 1 # all equal
|
115
|
+
end
|
116
|
+
|
117
|
+
return if multi_targets_pods.empty?
|
118
|
+
|
119
|
+
warnings = "One pod can only be prebuilt or not prebuilt. These pod have different forms in multiple targets:\n"
|
120
|
+
warnings += multi_targets_pods.map{|name, targets| " #{name}: #{targets.map{|t|t.platform.name}}"}.join("\n")
|
121
|
+
raise Informative, warnings
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
|
128
|
+
|
@@ -0,0 +1,109 @@
|
|
1
|
+
require_relative "names"
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
class PrebuildSandbox < Sandbox
|
5
|
+
|
6
|
+
def self.replace_tagert_copy_source_sh(installer_context)
|
7
|
+
standard_sandbox = installer_context.sandbox
|
8
|
+
prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(standard_sandbox)
|
9
|
+
list = prebuild_sandbox.exsited_framework_target_names
|
10
|
+
installer_context.umbrella_targets.each do |um|
|
11
|
+
um.user_targets.each do |target|
|
12
|
+
tn = "Pods-#{target.name}"
|
13
|
+
dir = Pathname.new(File.join(installer_context.sandbox.root,"Target Support Files", tn))
|
14
|
+
sh_path = File.join(dir, "#{tn}-resources.sh")
|
15
|
+
if File.exists?(sh_path)
|
16
|
+
list.each do |tarname|
|
17
|
+
replace_content_file sh_path, tarname
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.replace_content_file(path, name)
|
25
|
+
ostr = "install_resource \"${BUILT_PRODUCTS_DIR}/#{name}"
|
26
|
+
nstr = "install_resource \"${PODS_ROOT}/#{name}"
|
27
|
+
File.open(path,"r:utf-8") do |lines| #r:utf-8表示以utf-8编码读取文件,要与当前代码文件的编码相同
|
28
|
+
buffer = lines.read.gsub(ostr,nstr) #将文件中所有的ostr替换为nstr,并将替换后文件内容赋值给buffer
|
29
|
+
File.open(path,"w"){|l| #以写的方式打开文件,将buffer覆盖写入文件
|
30
|
+
l.write(buffer)
|
31
|
+
}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# [String] standard_sandbox_path
|
36
|
+
def self.from_standard_sanbox_path(path)
|
37
|
+
prebuild_sandbox_path = Pathname.new(path).realpath + "_Prebuild"
|
38
|
+
self.new(prebuild_sandbox_path)
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.from_standard_sandbox(sandbox)
|
42
|
+
self.from_standard_sanbox_path(sandbox.root)
|
43
|
+
end
|
44
|
+
|
45
|
+
def standard_sanbox_path
|
46
|
+
self.root.parent
|
47
|
+
end
|
48
|
+
|
49
|
+
def generate_framework_path
|
50
|
+
self.root + "GeneratedFrameworks"
|
51
|
+
end
|
52
|
+
|
53
|
+
# @param name [String] pass the target.name (may containing platform suffix)
|
54
|
+
# @return [Pathname] the folder containing the framework file.
|
55
|
+
def framework_folder_path_for_target_name(name)
|
56
|
+
self.generate_framework_path + name
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
def exsited_framework_target_names
|
61
|
+
exsited_framework_name_pairs.map {|pair| pair[0]}.uniq
|
62
|
+
end
|
63
|
+
def exsited_framework_pod_names
|
64
|
+
exsited_framework_name_pairs.map {|pair| pair[1]}.uniq
|
65
|
+
end
|
66
|
+
def existed_target_names_for_pod_name(pod_name)
|
67
|
+
exsited_framework_name_pairs.select {|pair| pair[1] == pod_name }.map { |pair| pair[0]}
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
def save_pod_name_for_target(target)
|
73
|
+
folder = framework_folder_path_for_target_name(target.name)
|
74
|
+
return unless folder.exist?
|
75
|
+
flag_file_path = folder + "#{target.pod_name}.pod_name"
|
76
|
+
File.write(flag_file_path.to_s, "")
|
77
|
+
end
|
78
|
+
|
79
|
+
def real_bundle_path_for_pod(path)
|
80
|
+
tindex = path.index('/')
|
81
|
+
count = path.length - tindex
|
82
|
+
temp = path[tindex,count]
|
83
|
+
rp = "#{self.root}#{temp}"
|
84
|
+
rp
|
85
|
+
end
|
86
|
+
|
87
|
+
private
|
88
|
+
|
89
|
+
def pod_name_for_target_folder(target_folder_path)
|
90
|
+
name = Pathname.new(target_folder_path).children.find do |child|
|
91
|
+
child.to_s.end_with? ".pod_name"
|
92
|
+
end
|
93
|
+
name = name.basename(".pod_name").to_s unless name.nil?
|
94
|
+
name ||= Pathname.new(target_folder_path).basename.to_s # for compatibility with older version
|
95
|
+
end
|
96
|
+
|
97
|
+
# Array<[target_name, pod_name]>
|
98
|
+
def exsited_framework_name_pairs
|
99
|
+
return [] unless generate_framework_path.exist?
|
100
|
+
generate_framework_path.children().map do |framework_path|
|
101
|
+
if framework_path.directory? && (not framework_path.children.empty?)
|
102
|
+
[framework_path.basename.to_s, pod_name_for_target_folder(framework_path)]
|
103
|
+
else
|
104
|
+
nil
|
105
|
+
end
|
106
|
+
end.reject(&:nil?).uniq
|
107
|
+
end
|
108
|
+
end
|
109
|
+
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-ppbuild.
|
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', :ppbuild => 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,199 @@
|
|
1
|
+
require 'fourflusher'
|
2
|
+
|
3
|
+
CONFIGURATION = "Release"
|
4
|
+
PLATFORMS = { 'iphonesimulator' => 'iOS',
|
5
|
+
'appletvsimulator' => 'tvOS',
|
6
|
+
'watchsimulator' => 'watchOS' }
|
7
|
+
|
8
|
+
# Build specific target to framework file
|
9
|
+
# @param [PodTarget] target
|
10
|
+
# a specific pod target
|
11
|
+
#
|
12
|
+
def build_for_iosish_platform(sandbox,
|
13
|
+
build_dir,
|
14
|
+
output_path,
|
15
|
+
target,
|
16
|
+
device,
|
17
|
+
simulator,
|
18
|
+
bitcode_enabled,
|
19
|
+
custom_build_options = [], # Array<String>
|
20
|
+
custom_build_options_simulator = [] # Array<String>
|
21
|
+
)
|
22
|
+
|
23
|
+
deployment_target = target.platform.deployment_target.to_s
|
24
|
+
|
25
|
+
target_label = target.label # name with platform if it's used in multiple platforms
|
26
|
+
Pod::UI.puts "Prebuilding #{target_label}..."
|
27
|
+
|
28
|
+
other_options = []
|
29
|
+
# bitcode enabled
|
30
|
+
other_options += ['BITCODE_GENERATION_MODE=bitcode'] if bitcode_enabled
|
31
|
+
# make less arch to iphone simulator for faster build
|
32
|
+
custom_build_options_simulator += ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'] if simulator == 'iphonesimulator'
|
33
|
+
|
34
|
+
is_succeed, _ = xcodebuild(sandbox, target_label, device, deployment_target, other_options + custom_build_options)
|
35
|
+
exit 1 unless is_succeed
|
36
|
+
is_succeed, _ = xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + custom_build_options_simulator)
|
37
|
+
exit 1 unless is_succeed
|
38
|
+
|
39
|
+
# paths
|
40
|
+
target_name = target.name # equals target.label, like "AFNeworking-iOS" when AFNetworking is used in multiple platforms.
|
41
|
+
module_name = target.product_module_name
|
42
|
+
device_framework_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}/#{module_name}.framework"
|
43
|
+
simulator_framework_path = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}/#{module_name}.framework"
|
44
|
+
|
45
|
+
device_binary = device_framework_path + "/#{module_name}"
|
46
|
+
simulator_binary = simulator_framework_path + "/#{module_name}"
|
47
|
+
return unless File.file?(device_binary) && File.file?(simulator_binary)
|
48
|
+
|
49
|
+
# the device_lib path is the final output file path
|
50
|
+
# combine the binaries
|
51
|
+
tmp_lipoed_binary_path = "#{build_dir}/#{target_name}"
|
52
|
+
lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_binary} #{simulator_binary}`
|
53
|
+
puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
|
54
|
+
FileUtils.mv tmp_lipoed_binary_path, device_binary, :force => true
|
55
|
+
|
56
|
+
# collect the swiftmodule file for various archs.
|
57
|
+
device_swiftmodule_path = device_framework_path + "/Modules/#{module_name}.swiftmodule"
|
58
|
+
simulator_swiftmodule_path = simulator_framework_path + "/Modules/#{module_name}.swiftmodule"
|
59
|
+
if File.exist?(device_swiftmodule_path)
|
60
|
+
FileUtils.cp_r simulator_swiftmodule_path + "/.", device_swiftmodule_path
|
61
|
+
end
|
62
|
+
|
63
|
+
# combine the generated swift headers
|
64
|
+
# (In xcode 10.2, the generated swift headers vary for each archs)
|
65
|
+
simulator_generated_swift_header_path = simulator_framework_path + "/Headers/#{module_name}-Swift.h"
|
66
|
+
device_generated_swift_header_path = device_framework_path + "/Headers/#{module_name}-Swift.h"
|
67
|
+
if File.exist? simulator_generated_swift_header_path
|
68
|
+
device_header = File.read(device_generated_swift_header_path)
|
69
|
+
simulator_header = File.read(simulator_generated_swift_header_path)
|
70
|
+
# https://github.com/Carthage/Carthage/issues/2718#issuecomment-473870461
|
71
|
+
combined_header_content = %Q{
|
72
|
+
#if TARGET_OS_SIMULATOR // merged by cocoapods-ppbuild
|
73
|
+
|
74
|
+
#{simulator_header}
|
75
|
+
|
76
|
+
#else // merged by cocoapods-ppbuild
|
77
|
+
|
78
|
+
#{device_header}
|
79
|
+
|
80
|
+
#endif // merged by cocoapods-ppbuild
|
81
|
+
}
|
82
|
+
File.write(device_generated_swift_header_path, combined_header_content.strip)
|
83
|
+
end
|
84
|
+
|
85
|
+
# handle the dSYM files
|
86
|
+
device_dsym = "#{device_framework_path}.dSYM"
|
87
|
+
if File.exist? device_dsym
|
88
|
+
# lipo the simulator dsym
|
89
|
+
simulator_dsym = "#{simulator_framework_path}.dSYM"
|
90
|
+
if File.exist? simulator_dsym
|
91
|
+
tmp_lipoed_binary_path = "#{output_path}/#{module_name}.draft"
|
92
|
+
lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_dsym}/Contents/Resources/DWARF/#{module_name} #{simulator_dsym}/Contents/Resources/DWARF/#{module_name}`
|
93
|
+
puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
|
94
|
+
FileUtils.mv tmp_lipoed_binary_path, "#{device_framework_path}.dSYM/Contents/Resources/DWARF/#{module_name}", :force => true
|
95
|
+
end
|
96
|
+
# move
|
97
|
+
FileUtils.mv device_dsym, output_path, :force => true
|
98
|
+
end
|
99
|
+
|
100
|
+
# output
|
101
|
+
output_path.mkpath unless output_path.exist?
|
102
|
+
FileUtils.mv device_framework_path, output_path, :force => true
|
103
|
+
# 如果是静态库则需要手动处理资源文件
|
104
|
+
if Pod::Podfile::DSL.static_binary
|
105
|
+
device_bundle_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}"
|
106
|
+
build_bundle_dir = Dir["#{device_bundle_path}/*"]
|
107
|
+
build_bundle_dir.each do |filename|
|
108
|
+
if File.directory?(filename)
|
109
|
+
FileUtils.cp_r(filename, output_path, :remove_destination => true)
|
110
|
+
else
|
111
|
+
FileUtils.cp(filename, output_path)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil, other_options=[])
|
118
|
+
args = %W(-project #{sandbox.project_path.realdirpath} -scheme #{target} -configuration #{CONFIGURATION} -sdk #{sdk} )
|
119
|
+
platform = PLATFORMS[sdk]
|
120
|
+
args += Fourflusher::SimControl.new.destination(:oldest, platform, deployment_target) unless platform.nil?
|
121
|
+
args += other_options
|
122
|
+
log = `xcodebuild #{args.join(" ")} 2>&1`
|
123
|
+
exit_code = $?.exitstatus # Process::Status
|
124
|
+
is_succeed = (exit_code == 0)
|
125
|
+
|
126
|
+
if !is_succeed
|
127
|
+
puts log.red
|
128
|
+
Pod::UI.puts "#{target} 编译失败!!!! "
|
129
|
+
end
|
130
|
+
[is_succeed, log]
|
131
|
+
end
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
module Pod
|
136
|
+
class Prebuild
|
137
|
+
|
138
|
+
# Build the frameworks with sandbox and targets
|
139
|
+
#
|
140
|
+
# @param [String] sandbox_root_path
|
141
|
+
# The sandbox root path where the targets project place
|
142
|
+
#
|
143
|
+
# [PodTarget] target
|
144
|
+
# The pod targets to build
|
145
|
+
#
|
146
|
+
# [Pathname] output_path
|
147
|
+
# output path for generated frameworks
|
148
|
+
#
|
149
|
+
def self.build(sandbox_root_path, target, output_path, bitcode_enabled = false, custom_build_options=[], custom_build_options_simulator=[])
|
150
|
+
|
151
|
+
return if target.nil?
|
152
|
+
|
153
|
+
sandbox_root = Pathname(sandbox_root_path)
|
154
|
+
sandbox = Pod::Sandbox.new(sandbox_root)
|
155
|
+
build_dir = self.build_dir(sandbox_root)
|
156
|
+
|
157
|
+
# -- build the framework
|
158
|
+
case target.platform.name
|
159
|
+
when :ios then build_for_iosish_platform(sandbox, build_dir, output_path, target, 'iphoneos', 'iphonesimulator', bitcode_enabled, custom_build_options, custom_build_options_simulator)
|
160
|
+
when :osx then xcodebuild(sandbox, target.label, 'macosx', nil, custom_build_options)
|
161
|
+
# when :tvos then build_for_iosish_platform(sandbox, build_dir, target, 'appletvos', 'appletvsimulator')
|
162
|
+
when :watchos then build_for_iosish_platform(sandbox, build_dir, output_path, target, 'watchos', 'watchsimulator', true, custom_build_options, custom_build_options_simulator)
|
163
|
+
else raise "Unsupported platform for '#{target.name}': '#{target.platform.name}'" end
|
164
|
+
|
165
|
+
raise Pod::Informative, 'The build directory was not found in the expected location.' unless build_dir.directory?
|
166
|
+
|
167
|
+
# # --- copy the vendored libraries and framework
|
168
|
+
# frameworks = build_dir.children.select{ |path| File.extname(path) == ".framework" }
|
169
|
+
# Pod::UI.puts "Built #{frameworks.count} #{'frameworks'.pluralize(frameworks.count)}"
|
170
|
+
|
171
|
+
# pod_target = target
|
172
|
+
# consumer = pod_target.root_spec.consumer(pod_target.platform.name)
|
173
|
+
# file_accessor = Pod::Sandbox::FileAccessor.new(sandbox.pod_dir(pod_target.pod_name), consumer)
|
174
|
+
# frameworks += file_accessor.vendored_libraries
|
175
|
+
# frameworks += file_accessor.vendored_frameworks
|
176
|
+
|
177
|
+
# frameworks.uniq!
|
178
|
+
|
179
|
+
# frameworks.each do |framework|
|
180
|
+
# FileUtils.mkdir_p destination
|
181
|
+
# FileUtils.cp_r framework, destination, :remove_destination => true
|
182
|
+
# end
|
183
|
+
# build_dir.rmtree if build_dir.directory?
|
184
|
+
end
|
185
|
+
|
186
|
+
def self.remove_build_dir(sandbox_root)
|
187
|
+
path = build_dir(sandbox_root)
|
188
|
+
path.rmtree if path.exist?
|
189
|
+
end
|
190
|
+
|
191
|
+
private
|
192
|
+
|
193
|
+
def self.build_dir(sandbox_root)
|
194
|
+
# don't know why xcode chose this folder
|
195
|
+
sandbox_root.parent + 'build'
|
196
|
+
end
|
197
|
+
|
198
|
+
end
|
199
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-ppbuild/gem_version'
|
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-ppbuild
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- 彭懂
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-09-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: A short description of cocoapods-ppbuild.
|
42
|
+
email:
|
43
|
+
- pengdong2014@xiaochuankeji.cn
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- lib/cocoapods-ppbuild.rb
|
49
|
+
- lib/cocoapods-ppbuild/Integration.rb
|
50
|
+
- lib/cocoapods-ppbuild/Main.rb
|
51
|
+
- lib/cocoapods-ppbuild/Prebuild.rb
|
52
|
+
- lib/cocoapods-ppbuild/command.rb
|
53
|
+
- lib/cocoapods-ppbuild/command/ppbuild.rb
|
54
|
+
- lib/cocoapods-ppbuild/gem_version.rb
|
55
|
+
- lib/cocoapods-ppbuild/helper/feature_switches.rb
|
56
|
+
- lib/cocoapods-ppbuild/helper/names.rb
|
57
|
+
- lib/cocoapods-ppbuild/helper/passer.rb
|
58
|
+
- lib/cocoapods-ppbuild/helper/podfile_options.rb
|
59
|
+
- lib/cocoapods-ppbuild/helper/prebuild_sandbox.rb
|
60
|
+
- lib/cocoapods-ppbuild/helper/target_checker.rb
|
61
|
+
- lib/cocoapods-ppbuild/rome/build_framework.rb
|
62
|
+
- lib/cocoapods-ppbuild/tool/tool.rb
|
63
|
+
- lib/cocoapods_plugin.rb
|
64
|
+
homepage: https://github.com/EXAMPLE/cocoapods-ppbuild
|
65
|
+
licenses:
|
66
|
+
- MIT
|
67
|
+
metadata: {}
|
68
|
+
post_install_message:
|
69
|
+
rdoc_options: []
|
70
|
+
require_paths:
|
71
|
+
- lib
|
72
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
requirements: []
|
83
|
+
rubygems_version: 3.0.9
|
84
|
+
signing_key:
|
85
|
+
specification_version: 4
|
86
|
+
summary: A longer description of cocoapods-ppbuild.
|
87
|
+
test_files: []
|