pod-builder 2.3.0 → 3.3.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/README.md +33 -10
- data/exe/pod_builder +0 -3
- data/lib/pod_builder/analyze.rb +12 -13
- data/lib/pod_builder/command/build.rb +87 -24
- data/lib/pod_builder/command/deintegrate.rb +11 -9
- data/lib/pod_builder/command/generate_lldbinit.rb +1 -1
- data/lib/pod_builder/command/init.rb +7 -6
- data/lib/pod_builder/command/install_sources.rb +9 -11
- data/lib/pod_builder/command/switch.rb +37 -16
- data/lib/pod_builder/command/sync_podfile.rb +11 -11
- data/lib/pod_builder/command/update.rb +0 -1
- data/lib/pod_builder/configuration.rb +43 -24
- data/lib/pod_builder/core.rb +4 -3
- data/lib/pod_builder/info.rb +1 -1
- data/lib/pod_builder/install.rb +74 -37
- data/lib/pod_builder/licenses.rb +4 -4
- data/lib/pod_builder/podfile.rb +22 -20
- data/lib/pod_builder/podfile/pre_actions_swizzles.rb +1 -1
- data/lib/pod_builder/podfile_item.rb +61 -33
- data/lib/pod_builder/podspec.rb +6 -2
- data/lib/pod_builder/post_actions.rb +46 -0
- data/lib/pod_builder/rome/post_install.rb +19 -17
- data/lib/pod_builder/version.rb +1 -1
- metadata +4 -3
data/lib/pod_builder/licenses.rb
CHANGED
@@ -12,19 +12,19 @@
|
|
12
12
|
|
13
13
|
if current_licenses.count > 0
|
14
14
|
licenses_header = current_licenses.shift
|
15
|
-
raise "\n\nUnexpected license found in header".red if licenses_header.has_key?("License")
|
15
|
+
raise "\n\nUnexpected license found in header\n".red if licenses_header.has_key?("License")
|
16
16
|
end
|
17
17
|
if current_licenses.count > 0
|
18
18
|
license_footer = current_licenses.pop
|
19
|
-
raise "\n\nUnexpected license found in footer".red if license_footer.has_key?("License")
|
19
|
+
raise "\n\nUnexpected license found in footer\n".red if license_footer.has_key?("License")
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
if licenses.count > 0
|
24
24
|
licenses_header = licenses.shift
|
25
|
-
raise "\n\nUnexpected license found in header".red if licenses_header.has_key?("License")
|
25
|
+
raise "\n\nUnexpected license found in header\n".red if licenses_header.has_key?("License")
|
26
26
|
license_footer = licenses.pop
|
27
|
-
raise "\n\nUnexpected license found in footer".red if license_footer.has_key?("License")
|
27
|
+
raise "\n\nUnexpected license found in footer\n".red if license_footer.has_key?("License")
|
28
28
|
|
29
29
|
lincenses_titles = licenses.map { |x| x["Title"] }
|
30
30
|
current_licenses.select! { |x| !lincenses_titles.include?(x["Title"]) }
|
data/lib/pod_builder/podfile.rb
CHANGED
@@ -6,7 +6,7 @@ module PodBuilder
|
|
6
6
|
PRE_INSTALL_ACTIONS = ["Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_duplicate_framework_and_library_names) {}", "require 'pod_builder/podfile/pre_actions_swizzles'"].freeze
|
7
7
|
|
8
8
|
def self.from_podfile_items(items, analyzer, build_configuration, install_using_frameworks, build_catalyst, build_xcframeworks)
|
9
|
-
raise "\n\nno items".red unless items.count > 0
|
9
|
+
raise "\n\nno items\n".red unless items.count > 0
|
10
10
|
|
11
11
|
sources = analyzer.sources
|
12
12
|
|
@@ -34,7 +34,7 @@ module PodBuilder
|
|
34
34
|
items.each do |item|
|
35
35
|
build_settings = Configuration.build_settings.dup
|
36
36
|
|
37
|
-
item_build_settings = Configuration.build_settings_overrides[item.name] || {}
|
37
|
+
item_build_settings = Configuration.build_settings_overrides[item.name].dup || {}
|
38
38
|
|
39
39
|
# These settings need to be set as is to properly build frameworks
|
40
40
|
build_settings["SWIFT_COMPILATION_MODE"] = "wholemodule"
|
@@ -46,10 +46,6 @@ module PodBuilder
|
|
46
46
|
|
47
47
|
build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = platform.deployment_target.version # Fix compilation warnings on Xcode 12
|
48
48
|
|
49
|
-
# Don't store .pcm info in binary, see https://forums.swift.org/t/swift-behavior-of-gmodules-and-dsyms/23211/3
|
50
|
-
build_settings["CLANG_ENABLE_MODULE_DEBUGGING"] = "NO"
|
51
|
-
build_settings["OTHER_SWIFT_FLAGS"] = "$(inherited) -Xfrontend -no-clang-module-breadcrumbs"
|
52
|
-
|
53
49
|
# Ignore deprecation warnings
|
54
50
|
build_settings["GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS"] = "NO"
|
55
51
|
|
@@ -60,11 +56,7 @@ module PodBuilder
|
|
60
56
|
|
61
57
|
if Configuration.build_system == "Legacy"
|
62
58
|
build_settings["BUILD_LIBRARY_FOR_DISTRIBUTION"] = "NO"
|
63
|
-
|
64
|
-
elsif Configuration.library_evolution_support
|
65
|
-
build_settings["BUILD_LIBRARY_FOR_DISTRIBUTION"] = "YES"
|
66
|
-
end
|
67
|
-
if Configuration.build_xcframeworks
|
59
|
+
elsif Configuration.library_evolution_support || item.build_xcframework
|
68
60
|
build_settings["BUILD_LIBRARY_FOR_DISTRIBUTION"] = "YES"
|
69
61
|
end
|
70
62
|
|
@@ -74,10 +66,20 @@ module PodBuilder
|
|
74
66
|
build_settings["BITCODE_GENERATION_MODE"] = "bitcode"
|
75
67
|
end
|
76
68
|
|
69
|
+
# Don't store .pcm info in binary, see https://forums.swift.org/t/swift-behavior-of-gmodules-and-dsyms/23211/3
|
70
|
+
build_settings["CLANG_ENABLE_MODULE_DEBUGGING"] = "NO"
|
71
|
+
other_swift_flags_override = " $(inherited) -Xfrontend -no-clang-module-breadcrumbs"
|
72
|
+
|
77
73
|
item_build_settings.each do |k, v|
|
78
|
-
|
74
|
+
# Do not allow to override above settings which are mandatory for a correct compilation
|
75
|
+
if build_settings[k].nil?
|
76
|
+
build_settings[k] = v
|
77
|
+
end
|
79
78
|
end
|
80
79
|
|
80
|
+
# All the below settings should be merged with global (Configuration.build_settings) or per pod build_settings (Configuration.build_settings_overrides)
|
81
|
+
build_settings["OTHER_SWIFT_FLAGS"] = build_settings.fetch("OTHER_SWIFT_FLAGS", "") + other_swift_flags_override
|
82
|
+
|
81
83
|
podfile_build_settings += "set_build_settings(\"#{item.root_name}\", #{build_settings.to_s}, installer)\n "
|
82
84
|
|
83
85
|
dependency_names = item.dependency_names.map { |x|
|
@@ -358,7 +360,7 @@ module PodBuilder
|
|
358
360
|
|
359
361
|
if stripped_line.match(/(pod')(.*?)(')/) != nil
|
360
362
|
starting_def_found = stripped_line.start_with?("def") && (line.match("\s*def\s") != nil)
|
361
|
-
raise "\n\nUnsupported single line def/pod. `def` and `pod` shouldn't be on the same line, please modify the following line:\n#{line}".red if starting_def_found
|
363
|
+
raise "\n\nUnsupported single line def/pod. `def` and `pod` shouldn't be on the same line, please modify the following line:\n#{line}\n".red if starting_def_found
|
362
364
|
end
|
363
365
|
end
|
364
366
|
end
|
@@ -400,9 +402,9 @@ module PodBuilder
|
|
400
402
|
if target_settings.count == 1
|
401
403
|
return target_settings.first
|
402
404
|
elsif target_settings.count > 1
|
403
|
-
raise "\n\n'use_frameworks!' should be declared only once at Podfile root level (not nested in targets)".red
|
405
|
+
raise "\n\n'use_frameworks!' should be declared only once at Podfile root level (not nested in targets)\n".red
|
404
406
|
else
|
405
|
-
raise "\n\nFailed detecting use_frameworks
|
407
|
+
raise "\n\nFailed detecting use_frameworks!\n".red
|
406
408
|
end
|
407
409
|
|
408
410
|
return true
|
@@ -447,13 +449,13 @@ module PodBuilder
|
|
447
449
|
def self.project_swift_version(analyzer)
|
448
450
|
swift_versions = analyzer.instance_variable_get("@result").targets.map { |x| x.target_definition.swift_version }.compact.uniq
|
449
451
|
|
450
|
-
raise "\n\nFound different Swift versions in targets. Expecting one, got `#{swift_versions}
|
452
|
+
raise "\n\nFound different Swift versions in targets. Expecting one, got `#{swift_versions}`\n".red if swift_versions.count > 1
|
451
453
|
|
452
454
|
return swift_versions.first || PodBuilder::system_swift_version
|
453
455
|
end
|
454
456
|
|
455
457
|
def self.podfile_items_at(podfile_path, include_prebuilt = false)
|
456
|
-
raise "\n\nExpecting basepath folder
|
458
|
+
raise "\n\nExpecting basepath folder!\n".red if !File.exist?(PodBuilder::basepath("Podfile"))
|
457
459
|
|
458
460
|
if File.basename(podfile_path) != "Podfile"
|
459
461
|
File.rename(PodBuilder::basepath("Podfile"), PodBuilder::basepath("Podfile.tmp"))
|
@@ -611,12 +613,12 @@ module PodBuilder
|
|
611
613
|
base = File.expand_path(File.join(PodBuilder::project_path, ".."))
|
612
614
|
bin_js = Dir.glob("#{base}/node_modules/@react-native-community/cli/build/bin.js")
|
613
615
|
|
614
|
-
raise "\n\nReact native cli bin_js not found! Did you run yarn install
|
616
|
+
raise "\n\nReact native cli bin_js not found! Did you run yarn install?\n".red unless bin_js.count == 1
|
615
617
|
bin_js = bin_js.first
|
616
618
|
|
617
619
|
config_dest_path = PodBuilder::basepath("rn_config.json")
|
618
620
|
|
619
|
-
raise "\n\nFailed generating react native configuration file".red unless system("node '#{bin_js}' config > #{config_dest_path}")
|
621
|
+
raise "\n\nFailed generating react native configuration file\n".red unless system("node '#{bin_js}' config > #{config_dest_path}")
|
620
622
|
|
621
623
|
content = File.read(config_dest_path)
|
622
624
|
|
@@ -628,7 +630,7 @@ module PodBuilder
|
|
628
630
|
json["project"]["ios"]["sourceDir"] = "./"
|
629
631
|
json["project"]["ios"]["podfile"] = "./"
|
630
632
|
rescue => exception
|
631
|
-
raise "\n\nFailed updating react native configuration json".red
|
633
|
+
raise "\n\nFailed updating react native configuration json\n".red
|
632
634
|
end
|
633
635
|
|
634
636
|
File.write(config_dest_path, JSON.pretty_generate(json))
|
@@ -24,7 +24,7 @@ class Pod::Generator::EmbedFrameworksScript
|
|
24
24
|
alias_method :swz_initialize, :initialize
|
25
25
|
|
26
26
|
def initialize(*args)
|
27
|
-
raise "
|
27
|
+
raise "\n\nUnsupported CocoaPods version\n".red if (args.count == 0 || args.count > 2)
|
28
28
|
|
29
29
|
frameworks_by_config = args[0]
|
30
30
|
frameworks_by_config.keys.each do |key|
|
@@ -103,27 +103,27 @@ module PodBuilder
|
|
103
103
|
#
|
104
104
|
attr_accessor :libraries
|
105
105
|
|
106
|
-
# @return [String]
|
106
|
+
# @return [String] Source_files
|
107
107
|
#
|
108
108
|
attr_accessor :source_files
|
109
109
|
|
110
|
-
# @return [String]
|
110
|
+
# @return [String] License
|
111
111
|
#
|
112
112
|
attr_accessor :license
|
113
113
|
|
114
|
-
# @return [String]
|
114
|
+
# @return [String] Summary
|
115
115
|
#
|
116
116
|
attr_accessor :summary
|
117
117
|
|
118
|
-
# @return [Hash]
|
118
|
+
# @return [Hash] Source
|
119
119
|
#
|
120
120
|
attr_accessor :source
|
121
121
|
|
122
|
-
# @return [Hash]
|
122
|
+
# @return [Hash] Authors
|
123
123
|
#
|
124
124
|
attr_accessor :authors
|
125
125
|
|
126
|
-
# @return [String]
|
126
|
+
# @return [String] Homepage
|
127
127
|
#
|
128
128
|
attr_accessor :homepage
|
129
129
|
|
@@ -134,6 +134,14 @@ module PodBuilder
|
|
134
134
|
# @return [Bool] Defines module
|
135
135
|
#
|
136
136
|
attr_accessor :defines_module
|
137
|
+
|
138
|
+
# @return [Bool] Should build as xcframework
|
139
|
+
#
|
140
|
+
attr_accessor :build_xcframework
|
141
|
+
|
142
|
+
# @return [Bool] True if it's a pod that doesn't provide source code (is already shipped as a prebuilt pod)
|
143
|
+
#
|
144
|
+
attr_accessor :is_prebuilt
|
137
145
|
|
138
146
|
# Initialize a new instance
|
139
147
|
#
|
@@ -235,6 +243,15 @@ module PodBuilder
|
|
235
243
|
@source = spec.root.attributes_hash.fetch("source", { "git"=>"https://github.com/Subito-it/PodBuilder.git" })
|
236
244
|
@authors = spec.root.attributes_hash.fetch("authors", {"PodBuilder"=>"pod@podbuilder.com"})
|
237
245
|
@homepage = spec.root.attributes_hash.fetch("homepage", "https://github.com/Subito-it/PodBuilder")
|
246
|
+
|
247
|
+
if Configuration.build_xcframeworks_all
|
248
|
+
build_as_xcframework = !Configuration.build_xcframeworks_exclude.include?(@root_name)
|
249
|
+
else
|
250
|
+
build_as_xcframework = Configuration.build_xcframeworks_include.include?(@root_name)
|
251
|
+
end
|
252
|
+
@build_xcframework = build_as_xcframework
|
253
|
+
|
254
|
+
@is_prebuilt = extract_is_prebuilt(spec, all_specs, checkout_options, supported_platforms)
|
238
255
|
end
|
239
256
|
|
240
257
|
def pod_specification(all_poditems, parent_spec = nil)
|
@@ -324,33 +341,6 @@ module PodBuilder
|
|
324
341
|
return deps
|
325
342
|
end
|
326
343
|
|
327
|
-
# @return [Bool] True if it's a pod that doesn't provide source code (is already shipped as a prebuilt pod)
|
328
|
-
#
|
329
|
-
def is_prebuilt
|
330
|
-
if Configuration.force_prebuild_pods.include?(@root_name) || Configuration.force_prebuild_pods.include?(@name)
|
331
|
-
return false
|
332
|
-
end
|
333
|
-
|
334
|
-
# We treat pods to skip like prebuilt ones
|
335
|
-
if Configuration.skip_pods.include?(@root_name) || Configuration.skip_pods.include?(@name)
|
336
|
-
return true
|
337
|
-
end
|
338
|
-
|
339
|
-
# Podspecs aren't always properly written (source_file key is often used instead of header_files)
|
340
|
-
# Therefore it can become tricky to understand which pods are already precompiled by boxing a .framework or .a
|
341
|
-
embedded_as_vendored = vendored_frameworks.map { |x| File.basename(x) }.include?("#{module_name}.framework")
|
342
|
-
embedded_as_static_lib = vendored_libraries.map { |x| File.basename(x) }.include?("lib#{module_name}.a")
|
343
|
-
|
344
|
-
only_headers = (source_files.count > 0 && @source_files.all? { |x| x.end_with?(".h") })
|
345
|
-
no_sources = (@source_files.count == 0 || only_headers) && (@vendored_frameworks + @vendored_libraries).count > 0
|
346
|
-
|
347
|
-
if !no_sources && !only_headers
|
348
|
-
return false
|
349
|
-
else
|
350
|
-
return (no_sources || only_headers || embedded_as_static_lib || embedded_as_vendored)
|
351
|
-
end
|
352
|
-
end
|
353
|
-
|
354
344
|
# @return [Bool] True if it's a subspec
|
355
345
|
#
|
356
346
|
def is_subspec
|
@@ -461,6 +451,44 @@ module PodBuilder
|
|
461
451
|
|
462
452
|
private
|
463
453
|
|
454
|
+
# @return [Bool] True if it's a pod that doesn't provide source code (is already shipped as a prebuilt pod)
|
455
|
+
#
|
456
|
+
def extract_is_prebuilt(spec, all_specs, checkout_options, supported_platforms)
|
457
|
+
if Configuration.force_prebuild_pods.include?(@root_name) || Configuration.force_prebuild_pods.include?(@name)
|
458
|
+
return false
|
459
|
+
end
|
460
|
+
|
461
|
+
# We treat pods to skip like prebuilt ones
|
462
|
+
if Configuration.skip_pods.include?(@root_name) || Configuration.skip_pods.include?(@name)
|
463
|
+
return true
|
464
|
+
end
|
465
|
+
|
466
|
+
if default_subspecs != nil && default_subspecs.count > 0
|
467
|
+
default_subspecs.each do |default_subspec_name|
|
468
|
+
if (default_spec = all_specs.detect { |t| t.name == "#{root_name}/#{default_subspec_name}" })
|
469
|
+
default_item = PodfileItem.new(default_spec, all_specs, checkout_options, supported_platforms)
|
470
|
+
if default_item.is_prebuilt
|
471
|
+
return true
|
472
|
+
end
|
473
|
+
end
|
474
|
+
end
|
475
|
+
end
|
476
|
+
|
477
|
+
# Podspecs aren't always properly written (source_file key is often used instead of header_files)
|
478
|
+
# Therefore it can become tricky to understand which pods are already precompiled by boxing a .framework or .a
|
479
|
+
embedded_as_vendored = vendored_frameworks.map { |x| File.basename(x) }.include?("#{module_name}.framework")
|
480
|
+
embedded_as_static_lib = vendored_libraries.map { |x| File.basename(x) }.include?("lib#{module_name}.a")
|
481
|
+
|
482
|
+
only_headers = (source_files.count > 0 && @source_files.all? { |x| x.end_with?(".h") })
|
483
|
+
no_sources = (@source_files.count == 0 || only_headers) && (@vendored_frameworks + @vendored_libraries).count > 0
|
484
|
+
|
485
|
+
if !no_sources && !only_headers
|
486
|
+
return false
|
487
|
+
else
|
488
|
+
return (no_sources || only_headers || embedded_as_static_lib || embedded_as_vendored)
|
489
|
+
end
|
490
|
+
end
|
491
|
+
|
464
492
|
def extract_vendored_frameworks(spec, all_specs)
|
465
493
|
items = []
|
466
494
|
|
data/lib/pod_builder/podspec.rb
CHANGED
@@ -53,7 +53,11 @@ module PodBuilder
|
|
53
53
|
resources = []
|
54
54
|
exclude_files = []
|
55
55
|
vendored_frameworks.each do |vendored_framework|
|
56
|
-
|
56
|
+
if vendored_framework.end_with?(".xcframework")
|
57
|
+
binary_path = Dir.glob(PodBuilder::prebuiltpath("#{item.root_name}/#{vendored_framework}/**/#{File.basename(vendored_framework, ".*")}")).reject { |t| t.include?("simulator") }.first
|
58
|
+
else
|
59
|
+
binary_path = Dir.glob(PodBuilder::prebuiltpath("#{item.root_name}/#{vendored_framework}/**/#{File.basename(vendored_framework, ".*")}")).first
|
60
|
+
end
|
57
61
|
|
58
62
|
next if binary_path.nil?
|
59
63
|
|
@@ -138,7 +142,7 @@ module PodBuilder
|
|
138
142
|
end
|
139
143
|
if !install_using_frameworks && spec_var == "p1" && vendored_libraries.map { |t| File.basename(t) }.include?("lib#{item.root_name}.a" )
|
140
144
|
module_path_files = Dir.glob(PodBuilder.prebuiltpath("#{item.root_name}/**/#{item.root_name}.modulemap"))
|
141
|
-
raise "\n\nToo many module maps found for #{item.root_name}".red if module_path_files.count > 1
|
145
|
+
raise "\n\nToo many module maps found for #{item.root_name}\n".red if module_path_files.count > 1
|
142
146
|
|
143
147
|
rel_path = Pathname.new(PodBuilder::prebuiltpath).relative_path_from(Pathname.new(PodBuilder::project_path("Pods"))).to_s
|
144
148
|
prebuilt_root_var = "#{item.root_name.upcase.gsub("-", "_")}_PREBUILT_ROOT"
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'pod_builder/core'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
module PodBuilder
|
5
|
+
module PostActions
|
6
|
+
def self.load(hash)
|
7
|
+
actions = {}
|
8
|
+
if json = hash["switch"]
|
9
|
+
actions[:switch] = Item.new("switch", json)
|
10
|
+
end
|
11
|
+
if json = hash["build"]
|
12
|
+
actions[:build] = Item.new("build", json)
|
13
|
+
end
|
14
|
+
|
15
|
+
return actions
|
16
|
+
end
|
17
|
+
|
18
|
+
class Item
|
19
|
+
attr_reader :path
|
20
|
+
attr_reader :quiet
|
21
|
+
attr_reader :name
|
22
|
+
|
23
|
+
def initialize(name, hash)
|
24
|
+
@name = name
|
25
|
+
@path = hash.fetch("path", "")
|
26
|
+
@quiet = hash.fetch("quiet", false)
|
27
|
+
|
28
|
+
raise "\n\nEmpty or missing post #{name} action path\n".red if @path.empty?()
|
29
|
+
end
|
30
|
+
|
31
|
+
def execute()
|
32
|
+
cmd = PodBuilder::basepath(path)
|
33
|
+
unless File.exist?(cmd)
|
34
|
+
raise "\n\nPost #{name} action path '#{cmd}' does not exists!\n".red
|
35
|
+
end
|
36
|
+
|
37
|
+
if @quiet
|
38
|
+
cmd += " > /dev/null 2>&1"
|
39
|
+
end
|
40
|
+
|
41
|
+
puts "Executing post #{name} action".yellow
|
42
|
+
`#{cmd}`
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -6,9 +6,11 @@ module PodBuilder
|
|
6
6
|
class XcodeBuildSettings
|
7
7
|
attr_reader :platform_name
|
8
8
|
attr_reader :build_destination
|
9
|
+
attr_reader :configuration
|
9
10
|
|
10
|
-
def initialize(platform_name)
|
11
|
+
def initialize(platform_name, configuration)
|
11
12
|
@platform_name = platform_name
|
13
|
+
@configuration = configuration
|
12
14
|
|
13
15
|
case platform_name
|
14
16
|
when "iphoneos" then @build_destination = "generic/platform=iOS"
|
@@ -19,7 +21,7 @@ module PodBuilder
|
|
19
21
|
when "tvossimulator" then @build_destination = "generic/platform=tvOS Simulator"
|
20
22
|
when "watchos" then @build_destination = "generic/platform=watchOS"
|
21
23
|
when "watchossimulator" then @build_destination = "generic/platform=watchOS Simulator"
|
22
|
-
else raise "\n\nUnknown platform '#{platform_name}'".red end
|
24
|
+
else raise "\n\nUnknown platform '#{platform_name}'\n".red end
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|
@@ -63,7 +65,7 @@ module PodBuilder
|
|
63
65
|
`xcrun lipo -remove arm64 #{simulator_lib} -o #{simulator_lib}`
|
64
66
|
end
|
65
67
|
|
66
|
-
raise "
|
68
|
+
raise "\n\nLipo failed on #{device_lib}\n".red unless system("xcrun lipo -create -output #{device_lib} #{device_lib} #{simulator_lib}")
|
67
69
|
|
68
70
|
merge_header_into(device_swift_header_path, simulator_swift_header_path)
|
69
71
|
|
@@ -114,7 +116,7 @@ module PodBuilder
|
|
114
116
|
`xcrun lipo -remove arm64 #{simulator_lib} -o #{simulator_lib}`
|
115
117
|
end
|
116
118
|
|
117
|
-
raise "
|
119
|
+
raise "\n\nLipo failed on #{device_lib}\n".red unless system("xcrun lipo -create -output #{device_lib} #{device_lib} #{simulator_lib}")
|
118
120
|
|
119
121
|
device_headers = Dir.glob("#{device_base}/**/*.h")
|
120
122
|
simulator_headers = Dir.glob("#{simulator_base}/**/*.h")
|
@@ -245,7 +247,7 @@ module PodBuilder
|
|
245
247
|
output = stdout + stderr
|
246
248
|
unless status.success?
|
247
249
|
if raise_on_failure
|
248
|
-
raise "#{full_command}\n\n#{output}"
|
250
|
+
raise "\n\n#{full_command}\n\n#{output}\n".red
|
249
251
|
else
|
250
252
|
UI.message("[!] Failed: #{full_command}".red)
|
251
253
|
end
|
@@ -305,7 +307,7 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
305
307
|
build_dir.rmtree if build_dir.directory?
|
306
308
|
|
307
309
|
targets = installer_context.umbrella_targets.select { |t| t.specs.any? }
|
308
|
-
raise "\n\nUnsupported target count".red unless targets.count == 1
|
310
|
+
raise "\n\nUnsupported target count\n".red unless targets.count == 1
|
309
311
|
target = targets.first
|
310
312
|
|
311
313
|
if build_xcframeworks
|
@@ -313,18 +315,18 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
313
315
|
|
314
316
|
case target.platform_name
|
315
317
|
when :ios then
|
316
|
-
xcodebuild_settings = [PodBuilder::XcodeBuildSettings.new("iphoneos"), PodBuilder::XcodeBuildSettings.new("iphonesimulator")]
|
318
|
+
xcodebuild_settings = [PodBuilder::XcodeBuildSettings.new("iphoneos", configuration), PodBuilder::XcodeBuildSettings.new("iphonesimulator", configuration)]
|
317
319
|
if build_catalyst
|
318
|
-
xcodebuild_settings += [PodBuilder::XcodeBuildSettings.new("catalyst")]
|
320
|
+
xcodebuild_settings += [PodBuilder::XcodeBuildSettings.new("catalyst", configuration)]
|
319
321
|
end
|
320
|
-
when :osx then xcodebuild_settings = [PodBuilder::XcodeBuildSettings.new("macos")]
|
321
|
-
when :tvos then xcodebuild_settings = [PodBuilder::XcodeBuildSettings.new("tvos"), PodBuilder::XcodeBuildSettings.new("tvossimulator")]
|
322
|
-
when :watchos then xcodebuild_settings = [PodBuilder::XcodeBuildSettings.new("watchos"), PodBuilder::XcodeBuildSettings.new("watchossimulator")]
|
323
|
-
else raise "\n\nUnknown platform '#{target.platform_name}'".red end
|
322
|
+
when :osx then xcodebuild_settings = [PodBuilder::XcodeBuildSettings.new("macos", configuration)]
|
323
|
+
when :tvos then xcodebuild_settings = [PodBuilder::XcodeBuildSettings.new("tvos", configuration), PodBuilder::XcodeBuildSettings.new("tvossimulator", configuration)]
|
324
|
+
when :watchos then xcodebuild_settings = [PodBuilder::XcodeBuildSettings.new("watchos", configuration), PodBuilder::XcodeBuildSettings.new("watchossimulator", configuration)]
|
325
|
+
else raise "\n\nUnknown platform '#{target.platform_name}'\n".red end
|
324
326
|
|
325
327
|
xcodebuild_settings.each do |xcodebuild_setting|
|
326
328
|
puts "Building xcframeworks for #{xcodebuild_setting.platform_name}".yellow
|
327
|
-
raise "\n\n#{build_destination} xcframework archive failed
|
329
|
+
raise "\n\n#{xcodebuild_setting.build_destination} xcframework archive failed!\n".red if !system("xcodebuild archive -project #{project_path.to_s} -scheme Pods-DummyTarget -configuration #{xcodebuild_setting.configuration} -destination '#{xcodebuild_setting.build_destination}' -archivePath '#{build_dir}/#{xcodebuild_setting.platform_name}' SKIP_INSTALL=NO > /dev/null 2>&1")
|
328
330
|
end
|
329
331
|
|
330
332
|
built_items = Dir.glob("#{build_dir}/#{xcodebuild_settings[0].platform_name}.xcarchive/Products/Library/Frameworks/*").reject { |t| File.basename(t, ".*") == "Pods_DummyTarget" }
|
@@ -346,7 +348,7 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
346
348
|
framework_name = File.basename(built_item_paths.first, ".*")
|
347
349
|
xcframework_path = "#{base_destination}/#{framework_name}/#{framework_name}.xcframework"
|
348
350
|
framework_params = built_item_paths.map { |t| "-framework '#{t}'"}.join(" ")
|
349
|
-
raise "\n\nFailed packing xcframework
|
351
|
+
raise "\n\nFailed packing xcframework!\n".red if !system("xcodebuild -create-xcframework #{framework_params} -output '#{xcframework_path}' > /dev/null 2>&1")
|
350
352
|
|
351
353
|
if enable_dsym
|
352
354
|
xcodebuild_settings.each do |xcodebuild_setting|
|
@@ -359,7 +361,7 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
359
361
|
end
|
360
362
|
end
|
361
363
|
else
|
362
|
-
raise "
|
364
|
+
raise "\n\nNot implemented\n".red
|
363
365
|
end
|
364
366
|
end
|
365
367
|
|
@@ -375,7 +377,7 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
375
377
|
when [:osx, false] then PodBuilder::xcodebuild(sandbox, target.cocoapods_target_label, configuration, PodBuilder::Configuration.deterministic_build, prebuilt_root_paths)
|
376
378
|
when [:tvos, false] then PodBuilder::build_for_iosish_platform_lib(sandbox, build_dir, target, 'appletvos', 'appletvsimulator', configuration, PodBuilder::Configuration.deterministic_build, prebuilt_root_paths)
|
377
379
|
when [:watchos, false] then PodBuilder::build_for_iosish_platform_lib(sandbox, build_dir, target, 'watchos', 'watchsimulator', configuration, PodBuilder::Configuration.deterministic_build, prebuilt_root_paths)
|
378
|
-
else raise "\n\nUnknown platform '#{target.platform_name}'".red end
|
380
|
+
else raise "\n\nUnknown platform '#{target.platform_name}'\n".red end
|
379
381
|
|
380
382
|
raise Pod::Informative, 'The build directory was not found in the expected location.' unless build_dir.directory?
|
381
383
|
|
@@ -434,7 +436,7 @@ Pod::HooksManager.register('podbuilder-rome', :post_install) do |installer_conte
|
|
434
436
|
FileUtils.mv(dsym_source, sandbox_root.parent)
|
435
437
|
end
|
436
438
|
else
|
437
|
-
raise "
|
439
|
+
raise "\n\nNot implemented\n".red
|
438
440
|
end
|
439
441
|
end
|
440
442
|
|