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