forked from paulocoutinhox/pdfium-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.py
executable file
·187 lines (142 loc) · 3.77 KB
/
make.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Make tool
Usage:
make.py run <task-name>
make.py [options]
make.py -h | --help
Options:
-h --help Show this screen.
-d --debug Enable debug mode.
--version Show version.
Examples:
python make.py -h
Tasks:
- format
- build-depot-tools
- build-pdfium-ios
- patch-ios
- build-ios
- install-ios
- test-ios
- archive-ios
- build-pdfium-macos
- patch-macos
- build-macos
- install-macos
- test-macos
- archive-macos
- build-pdfium-android
- patch-android
- build-android
- install-android
- test-android
- archive-android
"""
from docopt import docopt
import modules.common as common
import modules.functions as f
import modules.config as c
import modules.ios as ios
import modules.macos as macos
import modules.android as android
def main(options):
# show all params for debug
if ("--debug" in options and options["--debug"]) or (
"-d" in options and options["-d"]
):
c.make_debug = True
if c.make_debug:
f.debug("You have executed with options:")
f.message(str(options))
f.message("")
# bind options
if "<task-name>" in options:
make_task = options["<task-name>"]
# validate data
f.debug("Validating data...")
# validate task
if not make_task:
f.error("Task is invalid")
# build depot tools
if make_task == "format":
common.run_task_format()
# build depot tools
elif make_task == "build-depot-tools":
common.run_task_build_depot_tools()
#######################
# iOS
#######################
# build pdfium - ios
elif make_task == "build-pdfium-ios":
ios.run_task_build_pdfium()
# patch - ios
elif make_task == "patch-ios":
ios.run_task_patch()
# build - ios
elif make_task == "build-ios":
ios.run_task_build()
# install - ios
elif make_task == "install-ios":
ios.run_task_install()
# test - ios
elif make_task == "test-ios":
ios.run_task_test()
# archive - ios
elif make_task == "archive-ios":
ios.run_task_archive()
#######################
# macOS
#######################
# build pdfium - macos
elif make_task == "build-pdfium-macos":
macos.run_task_build_pdfium()
# patch - macos
elif make_task == "patch-macos":
macos.run_task_patch()
# build - macos
elif make_task == "build-macos":
macos.run_task_build()
# install - macos
elif make_task == "install-macos":
macos.run_task_install()
# test - macos
elif make_task == "test-macos":
macos.run_task_test()
# archive - macos
elif make_task == "archive-macos":
macos.run_task_archive()
#######################
# Android
#######################
# build pdfium - android
elif make_task == "build-pdfium-android":
android.run_task_build_pdfium()
# patch - android
elif make_task == "patch-android":
android.run_task_patch()
# build - android
elif make_task == "build-android":
android.run_task_build()
# install - android
elif make_task == "install-android":
android.run_task_install()
# test - android
elif make_task == "test-android":
android.run_task_test()
# archive - android
elif make_task == "archive-android":
android.run_task_archive()
#######################
# Invalid
#######################
# invalid
else:
f.error("Task is invalid")
f.message("")
f.debug("FINISHED!")
if __name__ == "__main__":
# main CLI entrypoint
args = docopt(__doc__, version="1.0.0")
main(args)