cocoapods-binary-cache 0.1.8 → 0.1.9
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/lib/cocoapods-binary-cache/helper/podspec.rb +0 -1
- data/lib/cocoapods-binary-cache/hooks/post_install.rb +0 -11
- data/lib/cocoapods-binary-cache/main.rb +0 -1
- data/lib/cocoapods-binary-cache/pod-binary/helper/build.rb +5 -6
- data/lib/cocoapods-binary-cache/pod-binary/integration/patch/source_installation.rb +23 -9
- data/lib/cocoapods-binary-cache/pod-binary/integration/source_installer.rb +20 -16
- data/lib/cocoapods-binary-cache/pod-binary/prebuild.rb +17 -18
- data/lib/cocoapods-binary-cache/pod-rome/xcodebuild_command.rb +50 -53
- data/lib/cocoapods-binary-cache/pod-rome/xcodebuild_raw.rb +15 -16
- data/lib/command/config.rb +6 -0
- data/lib/command/executor/base.rb +2 -1
- data/lib/command/executor/prebuilder.rb +2 -0
- data/lib/command/prebuild.rb +2 -0
- metadata +2 -4
- data/lib/cocoapods-binary-cache/helper/prebuild_order.rb +0 -12
- data/lib/cocoapods-binary-cache/scheme_editor.rb +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffcf342c1552381e28baebabf84a328ee30b744beb832740d04b3125be23f2fe
|
4
|
+
data.tar.gz: 77d55d695ad65749fe94d2238361ac76b290e7f6873ceec2286b9020f236f804
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00c13ec5a3bbc3df1ea0071cb1a90a91a85eb9a75f8a33853a5b60c4fcaf85dd6c5e3ac8aaaf0a6db6ceeb8e27d19bc6c5ede34b3d68e93cdeb4db2e808233b4
|
7
|
+
data.tar.gz: a39d29b292d9878fd808fb3aa61c7ae6c1b323b132dfa30810c71d32e3d6089cf80109f23fc1c4f57399df1d187c102ef78f23847ff97635b513a7f42a735702
|
@@ -5,7 +5,6 @@ module PodPrebuild
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def run
|
8
|
-
edit_scheme_for_code_coverage if PodPrebuild::Env.prebuild_stage?
|
9
8
|
diagnose if PodPrebuild::Env.integration_stage?
|
10
9
|
end
|
11
10
|
|
@@ -20,15 +19,5 @@ module PodPrebuild
|
|
20
19
|
).run
|
21
20
|
end
|
22
21
|
end
|
23
|
-
|
24
|
-
def edit_scheme_for_code_coverage
|
25
|
-
return unless PodPrebuild.config.dev_pods_enabled?
|
26
|
-
return unless @installer_context.sandbox.instance_of?(Pod::PrebuildSandbox)
|
27
|
-
|
28
|
-
# Modify pods scheme to support code coverage
|
29
|
-
# If we don't prebuild dev pod -> no need to care about this in Pod project
|
30
|
-
# because we setup in the main project (ex. DriverCI scheme)
|
31
|
-
SchemeEditor.edit_to_support_code_coverage(@installer_context.sandbox)
|
32
|
-
end
|
33
22
|
end
|
34
23
|
end
|
@@ -4,26 +4,25 @@ require_relative "../../pod-rome/xcodebuild_command"
|
|
4
4
|
module Pod
|
5
5
|
class Prebuild
|
6
6
|
def self.build(options)
|
7
|
-
|
8
|
-
return if
|
7
|
+
targets = options[:targets] || []
|
8
|
+
return if targets.empty?
|
9
9
|
|
10
|
-
Pod::UI.puts "Building target: #{target}...".magenta
|
11
10
|
options[:sandbox] = Pod::Sandbox.new(Pathname(options[:sandbox])) unless options[:sandbox].is_a?(Pod::Sandbox)
|
12
11
|
options[:build_dir] = build_dir(options[:sandbox].root)
|
13
12
|
|
14
|
-
case
|
13
|
+
case targets[0].platform.name
|
15
14
|
when :ios, :tvos, :watchos
|
16
15
|
XcodebuildCommand.new(options).run
|
17
16
|
when :osx
|
18
17
|
xcodebuild(
|
19
18
|
sandbox: options[:sandbox],
|
20
|
-
|
19
|
+
targets: targets,
|
21
20
|
configuration: options[:configuration],
|
22
21
|
sdk: "macosx",
|
23
22
|
args: options[:args]
|
24
23
|
)
|
25
24
|
else
|
26
|
-
raise "Unsupported platform for '#{
|
25
|
+
raise "Unsupported platform for '#{targets[0].name}': '#{targets[0].platform.name}'"
|
27
26
|
end
|
28
27
|
raise "The build directory was not found in the expected location" unless options[:build_dir].directory?
|
29
28
|
end
|
@@ -3,17 +3,31 @@ require_relative "../source_installer"
|
|
3
3
|
module Pod
|
4
4
|
class Installer
|
5
5
|
# Override the download step to skip download and prepare file in target folder
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
if should_integrate_prebuilt_pod?(pod_name)
|
11
|
-
pod_installer.install_for_prebuild!(sandbox)
|
6
|
+
alias original_create_pod_installer create_pod_installer
|
7
|
+
def create_pod_installer(name)
|
8
|
+
if should_integrate_prebuilt_pod?(name)
|
9
|
+
create_prebuilt_source_installer(name)
|
12
10
|
else
|
13
|
-
|
11
|
+
create_normal_source_installer(name)
|
14
12
|
end
|
15
|
-
|
16
|
-
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def create_normal_source_installer(name)
|
18
|
+
original_create_pod_installer(name)
|
19
|
+
end
|
20
|
+
|
21
|
+
def create_prebuilt_source_installer(name)
|
22
|
+
source_installer = PodSourceInstaller.new(sandbox, podfile, specs_for_pod(name))
|
23
|
+
pod_installer = PrebuiltSourceInstaller.new(
|
24
|
+
sandbox,
|
25
|
+
podfile,
|
26
|
+
specs_for_pod(name),
|
27
|
+
source_installer: source_installer
|
28
|
+
)
|
29
|
+
pod_installers << pod_installer
|
30
|
+
pod_installer
|
17
31
|
end
|
18
32
|
|
19
33
|
def should_integrate_prebuilt_pod?(name)
|
@@ -1,21 +1,27 @@
|
|
1
|
-
# NOTE:
|
2
|
-
# This file will only be loaded on normal pod install step
|
3
|
-
# so there's no need to check is_prebuild_stage
|
4
|
-
|
5
|
-
# Provide a special "download" process for prebuilded pods.
|
6
|
-
#
|
7
|
-
# As the frameworks is already exsited in local folder. We
|
8
|
-
# just create a symlink to the original target folder.
|
9
|
-
#
|
10
1
|
module Pod
|
11
2
|
class Installer
|
12
|
-
class PodSourceInstaller
|
13
|
-
def
|
14
|
-
|
3
|
+
class PrebuiltSourceInstaller < PodSourceInstaller
|
4
|
+
def initialize(*args, **kwargs)
|
5
|
+
@source_installer = kwargs.delete(:source_installer)
|
6
|
+
super(*args, **kwargs)
|
7
|
+
end
|
8
|
+
|
9
|
+
def prebuild_sandbox
|
10
|
+
@prebuild_sandbox ||= Pod::PrebuildSandbox.from_standard_sandbox(sandbox)
|
11
|
+
end
|
12
|
+
|
13
|
+
def install!
|
14
|
+
@source_installer.install! if PodPrebuild.config.still_download_sources?(name)
|
15
|
+
install_prebuilt_framework!
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def install_prebuilt_framework!
|
21
|
+
return if !PodPrebuild.config.dev_pods_enabled? && sandbox.local?(name)
|
15
22
|
|
16
23
|
# make a symlink to target folder
|
17
24
|
# TODO (bang): Unify to 1 sandbox to optimize and avoid inconsistency
|
18
|
-
prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(standard_sanbox)
|
19
25
|
# if spec used in multiple platforms, it may return multiple paths
|
20
26
|
target_names = prebuild_sandbox.existed_target_names_for_pod_name(name)
|
21
27
|
target_names.each do |name|
|
@@ -24,7 +30,7 @@ module Pod
|
|
24
30
|
# If have only one platform, just place int the root folder of this pod.
|
25
31
|
# If have multiple paths, we use a sperated folder to store different
|
26
32
|
# platform frameworks. e.g. AFNetworking/AFNetworking-iOS/AFNetworking.framework
|
27
|
-
target_folder =
|
33
|
+
target_folder = sandbox.pod_dir(self.name)
|
28
34
|
target_folder += real_file_folder.basename if target_names.count > 1
|
29
35
|
target_folder += PodPrebuild.config.prebuilt_path
|
30
36
|
target_folder.rmtree if target_folder.exist?
|
@@ -73,8 +79,6 @@ module Pod
|
|
73
79
|
end
|
74
80
|
end
|
75
81
|
|
76
|
-
private
|
77
|
-
|
78
82
|
def walk(path, &action)
|
79
83
|
return unless path.exist?
|
80
84
|
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require "fileutils"
|
2
2
|
require_relative "../prebuild_output/output"
|
3
3
|
require_relative "../helper/lockfile"
|
4
|
-
require_relative "../helper/prebuild_order"
|
5
4
|
require_relative "helper/target_checker"
|
6
5
|
require_relative "helper/build"
|
7
6
|
|
@@ -38,27 +37,27 @@ module Pod
|
|
38
37
|
def prebuild_frameworks!
|
39
38
|
existed_framework_folder = sandbox.generate_framework_path
|
40
39
|
sandbox_path = sandbox.root
|
40
|
+
targets = targets_to_prebuild
|
41
|
+
Pod::UI.puts "Prebuild frameworks (total #{targets.count}): #{targets.map(&:name)}".magenta
|
41
42
|
|
42
|
-
targets = PodPrebuild::BuildOrder.order_targets(targets_to_prebuild)
|
43
|
-
Pod::UI.puts "Prebuild frameworks (total #{targets.count}): #{targets.map(&:name)}"
|
44
|
-
Pod::Prebuild.remove_build_dir(sandbox_path)
|
45
43
|
run_code_gen!(targets)
|
44
|
+
|
45
|
+
Pod::Prebuild.remove_build_dir(sandbox_path)
|
46
|
+
Pod::Prebuild.build(
|
47
|
+
sandbox: sandbox_path,
|
48
|
+
targets: targets,
|
49
|
+
configuration: PodPrebuild.config.prebuild_config,
|
50
|
+
output_path: sandbox.generate_framework_path,
|
51
|
+
bitcode_enabled: PodPrebuild.config.bitcode_enabled?,
|
52
|
+
device_build_enabled: PodPrebuild.config.device_build_enabled?,
|
53
|
+
disable_dsym: PodPrebuild.config.disable_dsym?,
|
54
|
+
args: PodPrebuild.config.build_args
|
55
|
+
)
|
56
|
+
Pod::Prebuild.remove_build_dir(sandbox_path)
|
57
|
+
|
46
58
|
targets.each do |target|
|
47
|
-
|
48
|
-
output_path.mkpath unless output_path.exist?
|
49
|
-
Pod::Prebuild.build(
|
50
|
-
sandbox: sandbox_path,
|
51
|
-
target: target,
|
52
|
-
configuration: PodPrebuild.config.prebuild_config,
|
53
|
-
output_path: output_path,
|
54
|
-
bitcode_enabled: PodPrebuild.config.bitcode_enabled?,
|
55
|
-
device_build_enabled: PodPrebuild.config.device_build_enabled?,
|
56
|
-
disable_dsym: PodPrebuild.config.disable_dsym?,
|
57
|
-
args: PodPrebuild.config.build_args
|
58
|
-
)
|
59
|
-
collect_metadata(target, output_path)
|
59
|
+
collect_metadata(target, sandbox.framework_folder_path_for_target_name(target.name))
|
60
60
|
end
|
61
|
-
Pod::Prebuild.remove_build_dir(sandbox_path)
|
62
61
|
|
63
62
|
# copy vendored libraries and frameworks
|
64
63
|
targets.each do |target|
|
@@ -3,7 +3,7 @@ require_relative "xcodebuild_raw"
|
|
3
3
|
class XcodebuildCommand # rubocop:disable Metrics/ClassLength
|
4
4
|
def initialize(options)
|
5
5
|
@options = options
|
6
|
-
case options[:
|
6
|
+
case options[:targets][0].platform.name
|
7
7
|
when :ios
|
8
8
|
@options[:device] = "iphoneos"
|
9
9
|
@options[:simulator] = "iphonesimulator"
|
@@ -21,16 +21,18 @@ class XcodebuildCommand # rubocop:disable Metrics/ClassLength
|
|
21
21
|
build_for_sdk(simulator) if build_types.include?(:simulator)
|
22
22
|
build_for_sdk(device) if build_types.include?(:device)
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
24
|
+
targets.each do |target|
|
25
|
+
case build_types
|
26
|
+
when [:simulator]
|
27
|
+
collect_output(target, Dir[target_products_dir_of(target, simulator) + "/*"])
|
28
|
+
when [:device]
|
29
|
+
collect_output(target, Dir[target_products_dir_of(target, device) + "/*"])
|
30
|
+
else
|
31
|
+
# When merging contents of `simulator` & `device`, prefer contents of `device` over `simulator`
|
32
|
+
# https://github.com/grab/cocoapods-binary-cache/issues/25
|
33
|
+
collect_output(target, Dir[target_products_dir_of(target, device) + "/*"])
|
34
|
+
create_universal_framework(target)
|
35
|
+
end
|
34
36
|
end
|
35
37
|
end
|
36
38
|
|
@@ -59,40 +61,34 @@ class XcodebuildCommand # rubocop:disable Metrics/ClassLength
|
|
59
61
|
end
|
60
62
|
|
61
63
|
def build_for_sdk(sdk)
|
62
|
-
|
63
|
-
if Dir.exist?(framework_path)
|
64
|
-
Pod::UI.puts_indented "--> Framework already exists at: #{framework_path}"
|
65
|
-
return
|
66
|
-
end
|
67
|
-
|
68
|
-
succeeded, = xcodebuild(
|
64
|
+
xcodebuild(
|
69
65
|
sandbox: sandbox,
|
70
|
-
|
66
|
+
scheme: scheme,
|
67
|
+
targets: targets.map(&:label),
|
71
68
|
configuration: configuration,
|
72
69
|
sdk: sdk,
|
73
|
-
deployment_target:
|
70
|
+
deployment_target: targets.map { |t| t.platform.deployment_target }.max.to_s,
|
74
71
|
args: sdk == simulator ? @build_args[:simulator] : @build_args[:device]
|
75
72
|
)
|
76
|
-
raise "Build framework failed: #{target.label}" unless succeeded
|
77
73
|
end
|
78
74
|
|
79
|
-
def create_universal_framework
|
80
|
-
merge_framework_binary
|
81
|
-
merge_framework_dsym
|
82
|
-
merge_swift_headers
|
83
|
-
merge_swift_modules
|
75
|
+
def create_universal_framework(target)
|
76
|
+
merge_framework_binary(target)
|
77
|
+
merge_framework_dsym(target)
|
78
|
+
merge_swift_headers(target)
|
79
|
+
merge_swift_modules(target)
|
84
80
|
end
|
85
81
|
|
86
|
-
def merge_framework_binary
|
87
|
-
merge_contents("/#{
|
82
|
+
def merge_framework_binary(target)
|
83
|
+
merge_contents(target, "/#{target.product_module_name}", &method(:create_fat_binary))
|
88
84
|
end
|
89
85
|
|
90
|
-
def merge_framework_dsym
|
91
|
-
merge_contents(".dSYM/Contents/Resources/DWARF/#{
|
86
|
+
def merge_framework_dsym(target)
|
87
|
+
merge_contents(target, ".dSYM/Contents/Resources/DWARF/#{target.product_module_name}", &method(:create_fat_binary))
|
92
88
|
end
|
93
89
|
|
94
|
-
def merge_swift_headers
|
95
|
-
merge_contents("/Headers/#{
|
90
|
+
def merge_swift_headers(target)
|
91
|
+
merge_contents(target, "/Headers/#{target.product_module_name}-Swift.h") do |options|
|
96
92
|
merged_header = <<~HEREDOC
|
97
93
|
#if TARGET_OS_SIMULATOR // merged by cocoapods-binary
|
98
94
|
#{File.read(options[:simulator])}
|
@@ -104,19 +100,19 @@ class XcodebuildCommand # rubocop:disable Metrics/ClassLength
|
|
104
100
|
end
|
105
101
|
end
|
106
102
|
|
107
|
-
def merge_swift_modules
|
108
|
-
merge_contents("/Modules/#{
|
103
|
+
def merge_swift_modules(target)
|
104
|
+
merge_contents(target, "/Modules/#{target.product_module_name}.swiftmodule") do |options|
|
109
105
|
# Note: swiftmodules of `device` were copied beforehand,
|
110
106
|
# here, we only need to copy swiftmodules of `simulator`
|
111
107
|
FileUtils.cp_r(options[:simulator] + "/.", options[:output])
|
112
108
|
end
|
113
109
|
end
|
114
110
|
|
115
|
-
def merge_contents(path_suffix, &merger)
|
111
|
+
def merge_contents(target, path_suffix, &merger)
|
116
112
|
simulator_, device_, output_ = [
|
117
|
-
framework_path_of(simulator),
|
118
|
-
framework_path_of(device),
|
119
|
-
"#{output_path}/#{
|
113
|
+
framework_path_of(target, simulator),
|
114
|
+
framework_path_of(target, device),
|
115
|
+
"#{output_path(target)}/#{target.product_module_name}.framework"
|
120
116
|
].map { |p| p + path_suffix }
|
121
117
|
return unless File.exist?(simulator_) && File.exist?(device_)
|
122
118
|
|
@@ -127,27 +123,24 @@ class XcodebuildCommand # rubocop:disable Metrics/ClassLength
|
|
127
123
|
cmd = ["lipo", " -create"]
|
128
124
|
cmd << "-output" << options[:output]
|
129
125
|
cmd << options[:simulator] << options[:device]
|
130
|
-
|
126
|
+
`#{cmd.join(" ")}`
|
131
127
|
end
|
132
128
|
|
133
|
-
def collect_output(paths)
|
129
|
+
def collect_output(target, paths)
|
130
|
+
FileUtils.mkdir_p(output_path(target))
|
134
131
|
paths = [paths] unless paths.is_a?(Array)
|
135
132
|
paths.each do |path|
|
136
|
-
FileUtils.rm_rf(File.join(output_path, File.basename(path)))
|
137
|
-
FileUtils.cp_r(path, output_path)
|
133
|
+
FileUtils.rm_rf(File.join(output_path(target), File.basename(path)))
|
134
|
+
FileUtils.cp_r(path, output_path(target))
|
138
135
|
end
|
139
136
|
end
|
140
137
|
|
141
|
-
def target_products_dir_of(sdk)
|
138
|
+
def target_products_dir_of(target, sdk)
|
142
139
|
"#{build_dir}/#{configuration}-#{sdk}/#{target.name}"
|
143
140
|
end
|
144
141
|
|
145
|
-
def framework_path_of(sdk)
|
146
|
-
"#{target_products_dir_of(sdk)}/#{
|
147
|
-
end
|
148
|
-
|
149
|
-
def module_name
|
150
|
-
target.product_module_name
|
142
|
+
def framework_path_of(target, sdk)
|
143
|
+
"#{target_products_dir_of(target, sdk)}/#{target.product_module_name}.framework"
|
151
144
|
end
|
152
145
|
|
153
146
|
def sandbox
|
@@ -158,12 +151,16 @@ class XcodebuildCommand # rubocop:disable Metrics/ClassLength
|
|
158
151
|
@options[:build_dir]
|
159
152
|
end
|
160
153
|
|
161
|
-
def output_path
|
162
|
-
@options[:output_path]
|
154
|
+
def output_path(target)
|
155
|
+
"#{@options[:output_path]}/#{target.label}"
|
156
|
+
end
|
157
|
+
|
158
|
+
def scheme
|
159
|
+
@options[:scheme]
|
163
160
|
end
|
164
161
|
|
165
|
-
def
|
166
|
-
@options[:
|
162
|
+
def targets
|
163
|
+
@options[:targets]
|
167
164
|
end
|
168
165
|
|
169
166
|
def configuration
|
@@ -8,36 +8,35 @@ PLATFORM_OF_SDK = {
|
|
8
8
|
|
9
9
|
def xcodebuild(options)
|
10
10
|
sdk = options[:sdk] || "iphonesimulator"
|
11
|
+
targets = options[:targets] || [options[:target]]
|
11
12
|
platform = PLATFORM_OF_SDK[sdk]
|
12
13
|
|
13
14
|
cmd = ["xcodebuild"]
|
14
15
|
cmd << "-project" << options[:sandbox].project_path.realdirpath
|
15
|
-
cmd << "-
|
16
|
+
targets.each { |target| cmd << "-target" << target }
|
16
17
|
cmd << "-configuration" << options[:configuration]
|
17
18
|
cmd << "-sdk" << sdk
|
18
19
|
cmd << Fourflusher::SimControl.new.destination(:oldest, platform, options[:deployment_target]) unless platform.nil?
|
19
20
|
cmd += options[:args] if options[:args]
|
21
|
+
cmd << "build"
|
20
22
|
cmd << "2>&1"
|
21
23
|
cmd = cmd.join(" ")
|
22
24
|
|
23
25
|
Pod::UI.puts_indented "$ #{cmd}"
|
24
26
|
log = `#{cmd}`
|
27
|
+
return if $?.exitstatus.zero? # rubocop:disable Style/SpecialGlobalVars
|
25
28
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
# 64 represent command invalid. http://www.manpagez.com/man/3/sysexits/
|
34
|
-
printer = XCPretty::Printer.new({:formatter => XCPretty::Simple, :colorize => "auto"})
|
35
|
-
log.each_line do |line|
|
36
|
-
printer.pretty_print(line)
|
37
|
-
end
|
38
|
-
rescue
|
39
|
-
Pod::UI.puts log.red
|
29
|
+
begin
|
30
|
+
require "xcpretty" # TODO (thuyen): Revise this dependency
|
31
|
+
# use xcpretty to print build log
|
32
|
+
# 64 represent command invalid. http://www.manpagez.com/man/3/sysexits/
|
33
|
+
printer = XCPretty::Printer.new({:formatter => XCPretty::Simple, :colorize => "auto"})
|
34
|
+
log.each_line do |line|
|
35
|
+
printer.pretty_print(line)
|
40
36
|
end
|
37
|
+
rescue
|
38
|
+
Pod::UI.puts log.red
|
39
|
+
ensure
|
40
|
+
raise "Fail to build targets: #{targets}"
|
41
41
|
end
|
42
|
-
[succeeded, log]
|
43
42
|
end
|
data/lib/command/config.rb
CHANGED
@@ -103,6 +103,11 @@ module PodPrebuild
|
|
103
103
|
@dsl_config[:disable_dsym]
|
104
104
|
end
|
105
105
|
|
106
|
+
def still_download_sources?(name)
|
107
|
+
option = @dsl_config[:still_download_sources]
|
108
|
+
option.is_a?(Array) ? option.include?(name) : option
|
109
|
+
end
|
110
|
+
|
106
111
|
def dont_remove_source_code?
|
107
112
|
@dsl_config[:dont_remove_source_code]
|
108
113
|
end
|
@@ -162,6 +167,7 @@ module PodPrebuild
|
|
162
167
|
:bitcode_enabled,
|
163
168
|
:device_build_enabled,
|
164
169
|
:disable_dsym,
|
170
|
+
:still_download_sources,
|
165
171
|
:dont_remove_source_code,
|
166
172
|
:build_args,
|
167
173
|
:save_cache_validation_to,
|
@@ -17,7 +17,8 @@ module PodPrebuild
|
|
17
17
|
comps << cmd
|
18
18
|
comps << "&> /dev/null" if options[:ignore_output]
|
19
19
|
comps << "|| true" if options[:can_fail]
|
20
|
-
|
20
|
+
cmd = comps.join(" ")
|
21
|
+
raise "Fail to run command '#{cmd}'" unless system(cmd)
|
21
22
|
end
|
22
23
|
|
23
24
|
def git_clone(cmd, options = {})
|
@@ -8,6 +8,7 @@ module PodPrebuild
|
|
8
8
|
super(options)
|
9
9
|
@cache_branch = options[:cache_branch]
|
10
10
|
@push_cache = options[:push_cache]
|
11
|
+
@repo_update = options[:repo_update]
|
11
12
|
@fetcher = PodPrebuild::CacheFetcher.new(options)
|
12
13
|
@pusher = PodPrebuild::CachePusher.new(options)
|
13
14
|
end
|
@@ -26,6 +27,7 @@ module PodPrebuild
|
|
26
27
|
|
27
28
|
def prebuild
|
28
29
|
Pod::UI.step("Installation") do
|
30
|
+
installer.repo_update = @repo_update
|
29
31
|
installer.install!
|
30
32
|
end
|
31
33
|
end
|
data/lib/command/prebuild.rb
CHANGED
@@ -9,6 +9,7 @@ module Pod
|
|
9
9
|
def self.options
|
10
10
|
[
|
11
11
|
["--config", "Config (Debug, Test...) to prebuild"],
|
12
|
+
["--repo-update", "Update pod repo before installing"],
|
12
13
|
["--push", "Push cache to repo upon completion"],
|
13
14
|
["--all", "Prebuild all binary pods regardless of cache validation"],
|
14
15
|
["--targets", "Targets to prebuild. Use comma (,) to specify a list of targets"]
|
@@ -28,6 +29,7 @@ module Pod
|
|
28
29
|
@prebuilder = PodPrebuild::CachePrebuilder.new(
|
29
30
|
config: prebuild_config,
|
30
31
|
cache_branch: argv.shift_argument || "master",
|
32
|
+
repo_update: argv.flag?("repo-update"),
|
31
33
|
push_cache: argv.flag?("push")
|
32
34
|
)
|
33
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-binary-cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bang Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|
@@ -125,7 +125,6 @@ files:
|
|
125
125
|
- lib/cocoapods-binary-cache/helper/lockfile.rb
|
126
126
|
- lib/cocoapods-binary-cache/helper/path_utils.rb
|
127
127
|
- lib/cocoapods-binary-cache/helper/podspec.rb
|
128
|
-
- lib/cocoapods-binary-cache/helper/prebuild_order.rb
|
129
128
|
- lib/cocoapods-binary-cache/hooks/post_install.rb
|
130
129
|
- lib/cocoapods-binary-cache/hooks/pre_install.rb
|
131
130
|
- lib/cocoapods-binary-cache/main.rb
|
@@ -153,7 +152,6 @@ files:
|
|
153
152
|
- lib/cocoapods-binary-cache/pod-rome/xcodebuild_raw.rb
|
154
153
|
- lib/cocoapods-binary-cache/prebuild_output/metadata.rb
|
155
154
|
- lib/cocoapods-binary-cache/prebuild_output/output.rb
|
156
|
-
- lib/cocoapods-binary-cache/scheme_editor.rb
|
157
155
|
- lib/cocoapods-binary-cache/state_store.rb
|
158
156
|
- lib/cocoapods-binary-cache/ui.rb
|
159
157
|
- lib/cocoapods_plugin.rb
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module PodPrebuild
|
2
|
-
module BuildOrder
|
3
|
-
def self.order_targets(targets)
|
4
|
-
# It's more efficient to build frameworks that have more dependencies first
|
5
|
-
# so that the build parallelism is ultilized
|
6
|
-
# >> --- MyFramework ----------------------------------|
|
7
|
-
# >> --- ADependency ---|
|
8
|
-
# >> --- AnotherADependency ---|
|
9
|
-
targets.sort_by { |t| -t.recursive_dependent_targets.count }
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# Copyright 2019 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved.
|
2
|
-
# Use of this source code is governed by an MIT-style license that can be found in the LICENSE file
|
3
|
-
|
4
|
-
require "rexml/document"
|
5
|
-
|
6
|
-
class SchemeEditor
|
7
|
-
def self.edit_to_support_code_coverage(sandbox)
|
8
|
-
pod_proj_path = sandbox.project_path
|
9
|
-
Pod::UI.message "Modify schemes of pod project to support code coverage of prebuilt local pod: #{pod_proj_path}"
|
10
|
-
scheme_files = Dir["#{pod_proj_path}/**/*.xcscheme"]
|
11
|
-
scheme_files.each do |file_path|
|
12
|
-
scheme_name = File.basename(file_path, ".*")
|
13
|
-
next unless sandbox.local?(scheme_name)
|
14
|
-
|
15
|
-
Pod::UI.message "Modify scheme to enable coverage symbol when prebuild: #{scheme_name}"
|
16
|
-
|
17
|
-
doc = File.open(file_path, "r") { |f| REXML::Document.new(f) }
|
18
|
-
scheme = doc.elements["Scheme"]
|
19
|
-
test_action = scheme.elements["TestAction"]
|
20
|
-
next if test_action.attributes["codeCoverageEnabled"] == "YES"
|
21
|
-
|
22
|
-
test_action.add_attribute("codeCoverageEnabled", "YES")
|
23
|
-
test_action.add_attribute("onlyGenerateCoverageForSpecifiedTargets", "YES")
|
24
|
-
coverage_targets = REXML::Element.new("CodeCoverageTargets")
|
25
|
-
buildable_ref = scheme
|
26
|
-
.elements["BuildAction"]
|
27
|
-
.elements["BuildActionEntries"]
|
28
|
-
.elements["BuildActionEntry"]
|
29
|
-
.elements["BuildableReference"]
|
30
|
-
new_buildable_ref = buildable_ref.clone # Need to clone, otherwise the original one will be move to new place
|
31
|
-
coverage_targets.add_element(new_buildable_ref)
|
32
|
-
test_action.add_element(coverage_targets)
|
33
|
-
File.open(file_path, "w") { |f| doc.write(f) }
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|