forked from brave/Sparkle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_sparkle_framework.py
66 lines (54 loc) · 1.99 KB
/
build_sparkle_framework.py
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import os.path
import shutil
import subprocess
import sys
def Main(args):
out_dir = os.getcwd()
sparkle_dir = os.path.dirname(os.path.realpath(__file__))
os.chdir(sparkle_dir)
FNULL = open(os.devnull, 'w')
# Run `git submodule update --init` to update Vendor libs (i.e. ed25519)
command = ['git', 'submodule', 'update', '--init']
try:
subprocess.check_call(command)
except subprocess.CalledProcessError as e:
print(e.output)
raise e
out_dir_config = 'CONFIGURATION_BUILD_DIR=' + out_dir
command = ['xcodebuild', '-target', 'Sparkle', '-configuration', 'Release', out_dir_config, 'build']
try:
subprocess.check_call(command, stdout=FNULL)
except subprocess.CalledProcessError as e:
print(e.output)
raise e
command = ['xcodebuild', '-target', 'BinaryDelta', '-configuration', 'Release', out_dir_config, 'build']
try:
subprocess.check_call(command, stdout=FNULL)
except subprocess.CalledProcessError as e:
print(e.output)
raise e
command = ['xcodebuild', '-target', 'generate_keys', '-configuration', 'Release', out_dir_config, 'build']
try:
subprocess.check_call(command, stdout=FNULL)
except subprocess.CalledProcessError as e:
print(e.output)
raise e
command = ['xcodebuild', '-target', 'sign_update', '-configuration', 'Release', out_dir_config, 'build']
try:
subprocess.check_call(command, stdout=FNULL)
except subprocess.CalledProcessError as e:
print(e.output)
raise e
command = ['xcodebuild', '-target', 'generate_appcast', '-configuration', 'Release', out_dir_config, 'build']
try:
subprocess.check_call(command, stdout=FNULL)
except subprocess.CalledProcessError as e:
print(e.output)
raise e
return 0
if __name__ == '__main__':
sys.exit(Main(sys.argv))