1#!/bin/bash -e
2
3# Copyright (C) 2024 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#      http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17cd $(dirname $BASH_SOURCE)
18source $(pwd)/../../shell_utils.sh
19require_top
20
21# Ensure cogsetup (out/ will be symlink outside the repo)
22setup_cog_env_if_needed
23
24case $(uname -s) in
25    Linux)
26      export PREBUILTS_CLANG_TOOLS_ROOT="${TOP}/prebuilts/clang-tools/linux-x86/"
27      PREBUILTS_GO_ROOT="${TOP}/prebuilts/go/linux-x86/"
28      ;;
29    *)
30      echo "Only supported for linux hosts" >&2
31      exit 1
32      ;;
33esac
34
35export BUILD_ENV_SEQUENCE_NUMBER=13
36export ANDROID_BUILD_TOP=$TOP
37export OUT_DIR=${OUT_DIR}
38exec "${PREBUILTS_GO_ROOT}/bin/go" "run" "ide_query" "$@"
39