-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_duell
217 lines (185 loc) · 7.61 KB
/
_duell
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#compdef duell
#autoload
local -a _1st_arguments
_1st_arguments=(
'create:Used for creating a default project in the current folder.'
'build:Builds the specified platform. Needs to be run in a folder with a duell_project.xml.'
'update:Checks all the dependencies of the current project in the current directory and updates them.'
'setup:Sets up the environment that needs to be run once for a specified platform.'
'self_setup:Basic setup for the duell tool. Run me first!'
'repo_list:Shows the repository list. You can add and remove urls from it.'
'-help:Prints the help banner for the duell tool.'
)
local -a _inherited_options
_inherited_options=(
'(-verbose)-verbose[Every possible logging information will be shown.]' \
'(-mute)-mute[No output will be printed at all.]' \
'(-no-color)-no-color[Color markup will be stripped out of the output.]' \
'(-yestoall)-yestoall[Answers "y" to all questions and default to all questions.]' \
'(-help)-help[Show help banner of specified command.]'
)
local -a _build_options
_build_options=(
'(-fast)-fast[Use this command if you are just iterating haxe code.]' \
'(-publish)-publish[Outputs a releasable package into the configured "Publish" folder.]' \
'(-norun)-norun[The application won'\''t run, just runs the prebuild and build steps.]' \
'(-test)-test[Launches a server listening to a configured port and then runs the application.]' \
'(-clean)-clean[Clean up the Export folder and the native extensions. Nothing else is done except cleaning up.]' \
'(-noprebuild)-noprebuild[Does not parse the configuration, meaning the changes to the .xml files are not processed.]' \
'(-nobuild)-nobuild[Does not build. Haxe code does not get recompiled and platform app packages are not remade.]'
)
local -a _build_android_options
_build_android_options=(
'(-debug)-debug[Use this argument if you want to build in debug.]' \
'(-ndkgdb)-ndkgdb[Use this argument if you want to launch gdb on the running app.]' \
'(-armv6)-armv6[Use this if you want to build for armv6.]' \
'(-armv7)-armv7[Use this if you want to build for armv7.]' \
'(-x86)-x86[Use this argument if you want to build specifically for x86 platforms.]' \
'(-fulllogcat)-fulllogcat[Use this argument if you want to see the complete logcat as opposed to seeing a filtered one.]' \
'(-emulatorname)-emulatorname[Specify the name of the emulator that you want to run when the build starts.]' \
'(-emulator)-emulator[Boot the emulator to run the app (x86 if -x86 is set, armv7 otherwise).]'
)
local -a _build_ios_options
_build_ios_options=(
'(-debug)-debug[Use this argument if you want to build in debug.]' \
'(-simulator)-simulator[Use this if you want to application to be built and run on the simulator.]' \
'(-armv7)-armv7[Use this if you want to build for armv7.]' \
'(-armv7s)-armv7s[Use this if you want to build for armv7s.]' \
'(-arm64)-arm64[Use this if you want to build for arm64.]'
)
local -a _build_flash_options
_build_flash_options=(
'(-debug)-debug[Use this argument if you want to build in debug.]' \
'(-browser)-browser[Use this argument to make the app run on browser. The default is slimerjs.]' \
'(-advanced-telemetry)-advanced-telemetry[Use this argument to enable advanced-telemetry for profiling in scout.]' \
'(-slimerjs)-slimerjs[Use this argument to make the app run on slimerjs which is a standalone tiny firefox.]'
)
local -a _build_html5_options
_build_html5_options=(
'(-debug)-debug[Use this argument if you want to build in debug.]' \
'(-browser)-browser[Use this argument to make the app run on browser. The default is slimerjs.]' \
'(-slimerjs)-slimerjs[Use this argument to make the app run on slimerjs which is a standalone tiny firefox.]'
)
local -a _update_options
_update_options=(
'(-overridebranch)-overridebranch[If existent, sets the versions of each library to the specified branch.]'
)
local -a _setup_options
_setup_options=(
'(-v)-v[Specifies the required setup version.]'
)
local -a _repo_list_options
_repo_list_options=(
'(-add)-add[Adds a new url to the end of the repository list.]' \
'(-removeAll)-removeAll[ARemoves all urls from the repository list. Resets to the default url.]' \
'(-addFront)-addFront[Adds a new url to front of the repository list.]' \
'(-reverse)-reverse[Reverses the order of all urls in the repository list.]' \
'(-remove)-remove[Removes a url from the repository list.]'
)
__first_command_list() {
local expl
declare -a tasks
tasks=(create build update setup self_setup repo_list -help)
}
_build_plugin_list() {
_wanted application expl 'build' compadd $(command grep -hor "\"duellbuild.*\"" ~/.duell/lib_list | sort -u | awk '{ $0 = substr($0, 12); print substr($0, 0, length($0) -1); }')
}
_create_plugin_list() {
_wanted application expl 'create' compadd $(command grep -hor "\"duellcreate.*\"" ~/.duell/lib_list | sort -u | awk '{ $0 = substr($0, 13); print substr($0, 0, length($0) -1); }')
}
_setup_plugin_list() {
_wanted application expl 'setup' compadd $(command grep -hor "\"duellsetup.*\"" ~/.duell/lib_list | sort -u | awk '{ $0 = substr($0, 12); print substr($0, 0, length($0) -1); }')
}
_duell_build() {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "duell build"
return
;;
(options)
case $line[1] in
(android)
_arguments \
$_inherited_options \
$_build_options \
$_build_android_options
;;
(ios)
_arguments \
$_inherited_options \
$_build_options \
$_build_ios_options
;;
(flash)
_arguments \
$_inherited_options \
$_build_options \
$_build_flash_options
;;
(html5)
_arguments \
$_inherited_options \
$_build_options \
$_build_html5_options
;;
*)
_arguments \
$_inherited_options \
$_build_options
;;
esac
return
;;
esac
}
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
$_inherited_options \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "duell" _1st_arguments
return
;;
(options)
case $line[1] in
(create)
_arguments \
$_inherited_options \
':feature:_create_plugin_list'
;;
(build)
_duell_build
_arguments \
':feature:_build_plugin_list'
;;
(update)
_arguments \
$_inherited_options \
$_update_options
;;
(setup)
_arguments \
$_inherited_options \
$_setup_options \
':feature:_setup_plugin_list'
;;
(self_setup)
_arguments \
$_inherited_options
;;
(repo_list)
_arguments \
$_inherited_options \
$_repo_list_options
;;
esac
;;
esac