forked from biasedbit/curl-ios-build-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_curl
executable file
·43 lines (34 loc) · 1.44 KB
/
build_curl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env ruby
require_relative "lib/curl_builder"
module CurlBuilder
class Orchestrator
include CurlBuilder::Logging
def build
configuration = Parser.new.parse(ARGV)
return if configuration[:setup][:clean_and_exit]
CurlBuilder.logger.level = Logger.const_get(configuration[:setup][:log_level].upcase.to_sym)
# Start building
Preparer.new(configuration: configuration).prepare
compiled_archs = Compiler.new(configuration: configuration).compile
error { "Compilation failed for all requested architectures." } if compiled_archs.empty?
return if compiled_archs.empty?
packed = Packer.new(configuration: configuration).pack(compiled_archs)
if packed.empty?
error { "Unable to pack any of the output binaries" }
error { "To determine the cause, please run again with '#{param("--log-level debug --verbose")}'." }
else
cenas = packed.collect { |k, v| "#{k} (#{v.join(", ")})" }.join(", ")
info { "Build complete with output binaries: #{param(cenas)}" }
info { "Output can be found on the '#{param("curl")}' folder" }
end
rescue Errors::TaskError => e
error { "Build failed, output follows:\n#{black("----")}\n#{gray(e.message)}\n#{black("----")}" }
ensure
Cleaner.new(configuration: configuration).cleanup unless configuration.nil?
end
def log_id
" BUILD "
end
end
end
CurlBuilder::Orchestrator.new.build