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 WIN_ES2ABC_PATH: string = '/build-win/bin/es2abc.exe'; 40export const WIN_TS2ABC_PATH: string = '/build-win/src/index.js'; 41export const WIN_MERGERABC_PATH: string = '/build-win/bin/merge_abc.exe'; 42export const WIN_JS2ABC_PATH: string = '/build-win/bin/js2abc.exe'; 43export const WIN_AOTCOMPILER_PATH: string = '/build-win/bin/ark_aot_compiler.exe'; 44export const MAC_ES2ABC_PATH: string = '/build-mac/bin/es2abc'; 45export const MAC_TS2ABC_PATH: string = '/build-mac/src/index.js'; 46export const MAC_MERGERABC_PATH: string = '/build-mac/bin/merge_abc'; 47export const MAC_JS2ABC_PATH: string = '/build-mac/bin/js2abc'; 48export const MAC_AOTCOMPILER_PATH: string = '/build-mac/bin/ark_aot_compiler'; 49export const ARKROOT_PATH: string = path.resolve(__dirname, '../../../../bin/ark') 50export const MODULE_TEST_PATH: string = `${PROJECT_ROOT}/testTsModuleRequest/src/main/ets/`; 51export const TEST_TS: string = 'src/main/ets/pages/test.ts'; 52export const TEST_ETS: string = 'src/main/ets/pages/test.ets'; 53export const TEST_JS: string = 'src/main/ets/pages/test.js'; 54export const TEST_JSON: string = 'src/main/ets/pages/test.json'; 55export const SYMBOLMAP_MAP: string = 'entry/build/loader_out/ets/symbolMap.map'; 56export const DEFAULT_ETS: string = 'entry/build/loader_out/ets'; 57export const BUILD_INFO: string ='entry/build/filesInfo.txt'; 58export const BUILD_NPM: string ='entry/build/npmEntries.txt'; 59export const MODULES_ABC: string ='entry/build/modules.abc'; 60export const PREVIEW_DEBUG_INFO: string ='entry/preview/filesInfo.txt'; 61export const PREVIEW_DEBUG_NPM: string ='entry/preview/npmEntries.txt'; 62export const PREVIEW_MODULES_ABC: string ='entry/preview/modules.abc'; 63export const BUILD_CACHE: string ='entry/build/modules.cache'; 64export const BUILD_RELEASE_CACHE: string ='entry/build/modules.cache'; 65export const PREVIEW_DEBUG_CACHE: string ='entry/preview/modules.cache'; 66export const DEBUG_INFO: string ="--debug-info"; 67export const ENTRY_LIST: string ="--npm-module-entry-list"; 68export const OUTPUT: string ="--output"; 69export const FILE_THREADS: string ="--file-threads"; 70export const MERGE_ABC: string ="--merge-abc"; 71export const ENABLE_ABC_INPUT: string ="--enable-abc-input"; 72export const CACHE_FILE: string ="--cache-file"; 73export const SIMBOL_TABLE: string ="--dump-symbol-table"; 74export const TARGET_API_VERSION: string = "--target-api-version="; 75export const ARKCONFIG_TS2ABC_PATH: string = 'bin/ark/build/legacy_api8/src/index.js'; 76 77export const EXPECT_ENTRY_TS: string = `${PROJECT_ROOT}/expect/expect_EntryAbility.ts`; 78export const EXPECT_INDEX_ETS: string = `${PROJECT_ROOT}/expect/expect_Index.ets`; 79export const EXPECT_SOURCEMAP_JSON: string = `${PROJECT_ROOT}/expect/sourceMaps.json`; 80export const EXPECT_TO_JS: string = `${PROJECT_ROOT}/expect/expectToJS.json`; 81export const TERSER_PROCESSED_EXPECTED_CODE: string = `${PROJECT_ROOT}/expect/terser_processed_expected_code.txt`; 82 83export const PKG_MODULES_OHPM_HYPIUM: string = 'pkg_modules/.ohpm/@ohos+hypium@1.0.6/pkg_modules/@ohos/hypium'; 84export const PKG_MODULES_ENTRY: string = 'pkg_modules@entry'; 85export const PKG_MODULES_OHPM_HYPIUM_SHORT: string = 'pkg_modules/@ohos/hypium'; 86export const MOCK_CONFIG_PATH: string = "openharmony/mockconfig"; 87 88export const OBFUSCATION_RULE_TEMPLATE_PATH: string = `${PROJECT_ROOT}/obfuscation/keepDts/obfuscation-template.txt`; 89export const OBFUSCATION_RULE_PATH: string = `${PROJECT_ROOT}/obfuscation/obfuscation.txt`;