blob: 456c1912442392521e49961a8cc217a9d37650ca [file] [log] [blame]
# _fx_oldset__board completes a board name
_fx_oldset__board() {
compadd ${(u)$(echo ${fuchsia_dir}/boards/*.gni(N:t:r) ${fuchsia_dir}/vendor/*/boards/*.gni(N:t:r))}
# _fx_oldset__product completes a product name
_fx_oldset__product() {
compadd ${(u)$(echo ${fuchsia_dir}/products/*.gni(N:t:r) ${fuchsia_dir}/vendor/*/products/*.gni(N:t:r))}
# _fx_oldset__package completes a package name
_fx_oldset__package() {
compadd $(cd ${fuchsia_dir} >/dev/null 2>&1 && echo */packages/**/^*.*(.N) vendor/*/packages/**/^*.*(.N))
# _packages completes a comma separated list of packages
_packages() {
# packages are files without extensions in */packages/ and vendor/*/packages/
_values -s , $(cd ${fuchsia_dir} >/dev/null 2>&1 && echo */packages/**/^*.*(.N) vendor/*/packages/**/^*.*(.N))
# _products completes a comma separated list of products
_products() {
# products are .gni files in */products/ and vendor/*/products/
_values -s , $(cd ${fuchsia_dir} >/dev/null 2>&1 && echo */products/**/*.gni(.N) vendor/*/products/**/*.gni(.N))
_gn_args_caching_policy() {
test ${ninja_file} -nt $1
_gn_args() {
if [ -z ${fuchsia_build_dir} ]; then
# apply a default caching policy if one isn't configured
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
zstyle ":completion:${curcontext}:" cache-policy \
# if this file is newer than the cache file then the cache is stale
local ninja_file=${fuchsia_dir}/${fuchsia_build_dir}/
local -a gn_args
if ! _retrieve_cache gn_args ; then
gn_args=( $(${fuchsia_dir}/buildtools/gn args ${fuchsia_dir}/${fuchsia_build_dir} --list --short|sed -e 's/ .*//') )
_store_cache gn_args gn_args
# complete the list of gn args with an = suffix
compadd -S = ${gn_args}
# list of supported fuchsia architectures
local -a archs
'x64:64 bit Intel'
'arm64:64 bit ARM'
# TODO: --help-args --zircon-arg
# arguments to fx oldset
_arguments '1:arch:{_describe "arch" archs}' \
'2::build_dir:{__fx_build_dir}' \
'(:)--board[Use the listed board configuration]:board:_fx_oldset__board' \
'(:)--product[Include the listed product in the build]:product:_fx_oldset__product' \
'(:)*--available[Package to be available for pushing]:package:_fx_oldset__package' \
'(:)*--preinstall[Package to be included in the system image]:package:_fx_oldset__package' \
'(:)*--monolith[Package to be included in the monolithic system image]:package:_fx_oldset__package' \
'(:)*--variant[Pass a select_variant GN arg]: ' \
'(:)*--fuzz-with[A sanitizer name to fuzz with]: ' \
'(:)--args[Arguments for GN gen]:args:{_gn_args}' \
'(:)--goma[Use GOMA]' \
"(:)--no-goma[Don't use GOMA]" \
"(:)--no-ensure-goma[Don't make sure GOMA is running]" \
'(:)--goma-dir[GOMA directory to use]:directory:_files -/' \
"(:)--ccache[Use ccache]" \
"(:)--no-ccache[Don't use ccache]" \
'(:)--ide[Generate files for an IDE]:ide:(eclipse vs vs2013 vs2015 vs2017 xcode qcreator json)' \
'(:)--release[Release build]'