1/* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use rollupObject 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 */ 15 16import path from "path"; 17 18// project oh_modules path 19export const OH_MODULES_OHPM_HYPIUM: string = 'oh_modules/.ohpm/@ohos+hypium@1.0.6/oh_modules/@ohos/hypium'; 20export const OH_MODULES_OHOS_HYPIUM: string = 'oh_modules/@ohos/hypium'; 21 22// project root path, default project name 23export const PROJECT_ROOT = path.resolve(__dirname, '../../../../test/ark_compiler_ut/testdata'); 24export const DEFAULT_PROJECT: string = 'testcase_def'; 25export const DEFAULT_ENTRY: string = 'entry'; 26 27// project module id 28export const MODULE_ID_ROLLUP_PLACEHOLDER = "\x00rollup_plugin_ignore_empty_module_placeholder"; 29 30// project build node_modules 31export const NODE_MODULES_PATH = "default/intermediates/loader_out/default/node_modules"; 32export const AN_BUILD_OUTPUT_PATH = 'default/intermediates/loader_out/default/an/arm64-v8a'; 33 34export const ES2ABC_PATH: string = '/build/bin/es2abc'; 35export const TS2ABC_PATH: string = '/build/src/index.js'; 36export const MERGERABC_PATH: string = '/build/bin/merge_abc'; 37export const JS2ABC_PATH: string = '/build/bin/js2abc'; 38export const AOTCOMPILER_PATH: string = '/build/bin/ark_aot_compiler'; 39export const BC_OBFUSCATOR_PATH: string = '/build/bin/panda_guard'; 40export const WIN_ES2ABC_PATH: string = '/build-win/bin/es2abc.exe'; 41export const WIN_TS2ABC_PATH: string = '/build-win/src/index.js'; 42export const WIN_MERGERABC_PATH: string = '/build-win/bin/merge_abc.exe'; 43export const WIN_JS2ABC_PATH: string = '/build-win/bin/js2abc.exe'; 44export const WIN_AOTCOMPILER_PATH: string = '/build-win/bin/ark_aot_compiler.exe'; 45export const WIN_BC_OBFUSCATOR_PATH: string = '/build-win/bin/panda_guard.exe'; 46export const MAC_ES2ABC_PATH: string = '/build-mac/bin/es2abc'; 47export const MAC_TS2ABC_PATH: string = '/build-mac/src/index.js'; 48export const MAC_MERGERABC_PATH: string = '/build-mac/bin/merge_abc'; 49export const MAC_JS2ABC_PATH: string = '/build-mac/bin/js2abc'; 50export const MAC_AOTCOMPILER_PATH: string = '/build-mac/bin/ark_aot_compiler'; 51export const MAC_BC_OBFUSCATOR_PATH: string = '/build-mac/bin/panda_guard'; 52export const ARKROOT_PATH: string = path.resolve(__dirname, '../../../../bin/ark') 53export const MODULE_TEST_PATH: string = `${PROJECT_ROOT}/testTsModuleRequest/src/main/ets/`; 54export const TEST_TS: string = 'src/main/ets/pages/test.ts'; 55export const TEST_ETS: string = 'src/main/ets/pages/test.ets'; 56export const TEST_JS: string = 'src/main/ets/pages/test.js'; 57export const TEST_JSON: string = 'src/main/ets/pages/test.json'; 58export const SYMBOLMAP_MAP: string = 'entry/build/loader_out/ets/symbolMap.map'; 59export const DEFAULT_ETS: string = 'entry/build/loader_out/ets'; 60export const BUILD_INFO: string ='entry/build/filesInfo.txt'; 61export const BUILD_NPM: string ='entry/build/npmEntries.txt'; 62export const MODULES_ABC: string ='entry/build/modules.abc'; 63export const PREVIEW_DEBUG_INFO: string ='entry/preview/filesInfo.txt'; 64export const PREVIEW_DEBUG_NPM: string ='entry/preview/npmEntries.txt'; 65export const PREVIEW_MODULES_ABC: string ='entry/preview/modules.abc'; 66export const BUILD_CACHE: string ='entry/build/modules.cache'; 67export const BUILD_RELEASE_CACHE: string ='entry/build/modules.cache'; 68export const PREVIEW_DEBUG_CACHE: string ='entry/preview/modules.cache'; 69export const DEBUG_INFO: string ="--debug-info"; 70export const ENTRY_LIST: string ="--npm-module-entry-list"; 71export const OUTPUT: string ="--output"; 72export const FILE_THREADS: string ="--file-threads"; 73export const MERGE_ABC: string ="--merge-abc"; 74export const ENABLE_ABC_INPUT: string ="--enable-abc-input"; 75export const CACHE_FILE: string ="--cache-file"; 76export const SIMBOL_TABLE: string ="--dump-symbol-table"; 77export const ENABLE_RELEASE_COLUMN: string ="--enable-release-column"; 78export const TARGET_API_VERSION: string = "--target-api-version="; 79export const ARKCONFIG_TS2ABC_PATH: string = 'bin/ark/build/legacy_api8/src/index.js'; 80 81export const EXPECT_ENTRY_TS: string = `${PROJECT_ROOT}/expect/expect_EntryAbility.ts`; 82export const EXPECT_INDEX_ETS: string = `${PROJECT_ROOT}/expect/expect_Index.ets`; 83export const EXPECT_SOURCEMAP_JSON: string = `${PROJECT_ROOT}/expect/sourceMaps.json`; 84export const EXPECT_TO_JS: string = `${PROJECT_ROOT}/expect/expectToJS.json`; 85export const TERSER_PROCESSED_EXPECTED_CODE: string = `${PROJECT_ROOT}/expect/terser_processed_expected_code.txt`; 86 87export const PKG_MODULES_OHPM_HYPIUM: string = 'pkg_modules/.ohpm/@ohos+hypium@1.0.6/pkg_modules/@ohos/hypium'; 88export const PKG_MODULES_ENTRY: string = 'pkg_modules@entry'; 89export const PKG_MODULES_OHPM_HYPIUM_SHORT: string = 'pkg_modules/@ohos/hypium'; 90export const MOCK_CONFIG_PATH: string = "openharmony/mockconfig"; 91 92export const OBFUSCATION_RULE_TEMPLATE_PATH: string = `${PROJECT_ROOT}/obfuscation/keepDts/obfuscation-template.txt`; 93export const OBFUSCATION_RULE_PATH: string = `${PROJECT_ROOT}/obfuscation/obfuscation.txt`; 94 95export const OBFUSCATE_RULE_BYTECODE_OBFUSCATION_ENABLE_PATH: string = `${PROJECT_ROOT}/bytecode_obfuscation/byte_obfuscation_enable.txt`;