1#!/usr/bin/env bash 2# Copyright (c) 2024 Huawei Device Co., Ltd. 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15set -e 16 17ark-find-buildroot() { 18 unset ARK_BUILDROOT 19 if [[ ! "$PWD" =~ "out/x64" ]]; then 20 echo "Current directory is not a child of build root, go to ARK_REPO/out/x64.{release,debug}" 21 unset ARK_BUILDROOT 22 return 1 23 fi 24 ARK_BUILDROOT=$(echo $PWD | sed "s/\(out\/[[:alnum:]\.]*\).*/\1/") 25} 26 27alias ark-built-disasm='ark-find-buildroot && $ARK_BUILDROOT/arkcompiler/runtime_core/ark_disasm' 28alias ark-built-es2abc='ark-find-buildroot && $ARK_BUILDROOT/arkcompiler/ets_frontend/es2abc' 29 30alias ark-ld-library-prefix='ark-find-buildroot && LD_LIBRARY_PATH=$ARK_BUILDROOT/arkcompiler/runtime_core:$ARK_BUILDROOT/arkcompiler/ets_runtime:$ARK_BUILDROOT/thirdparty/icu:$ARK_BUILDROOT/thirdparty/zlib' 31 32alias abckit-run-gtests='ark-ld-library-prefix $ARK_BUILDROOT/tests/unittest/arkcompiler/runtime_core/libabckit/abckit_gtests' 33