1# Copyright (c) 2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/ohos.gni") 15import("//build/ohos/notice/notice.gni") 16 17typescript_sources = [ 18 "lib/.gitattributes", 19 "lib/README.md", 20 "lib/cancellationToken.js", 21 "lib/cs/diagnosticMessages.generated.json", 22 "lib/de/diagnosticMessages.generated.json", 23 "lib/es/diagnosticMessages.generated.json", 24 "lib/fr/diagnosticMessages.generated.json", 25 "lib/it/diagnosticMessages.generated.json", 26 "lib/ja/diagnosticMessages.generated.json", 27 "lib/ko/diagnosticMessages.generated.json", 28 "lib/lib.d.ts", 29 "lib/lib.dom.d.ts", 30 "lib/lib.dom.iterable.d.ts", 31 "lib/lib.es2015.collection.d.ts", 32 "lib/lib.es2015.core.d.ts", 33 "lib/lib.es2015.d.ts", 34 "lib/lib.es2015.generator.d.ts", 35 "lib/lib.es2015.iterable.d.ts", 36 "lib/lib.es2015.promise.d.ts", 37 "lib/lib.es2015.proxy.d.ts", 38 "lib/lib.es2015.reflect.d.ts", 39 "lib/lib.es2015.symbol.d.ts", 40 "lib/lib.es2015.symbol.wellknown.d.ts", 41 "lib/lib.es2016.array.include.d.ts", 42 "lib/lib.es2016.d.ts", 43 "lib/lib.es2016.full.d.ts", 44 "lib/lib.es2017.d.ts", 45 "lib/lib.es2017.full.d.ts", 46 "lib/lib.es2017.intl.d.ts", 47 "lib/lib.es2017.object.d.ts", 48 "lib/lib.es2017.sharedmemory.d.ts", 49 "lib/lib.es2017.string.d.ts", 50 "lib/lib.es2017.typedarrays.d.ts", 51 "lib/lib.es2018.asyncgenerator.d.ts", 52 "lib/lib.es2018.asynciterable.d.ts", 53 "lib/lib.es2018.d.ts", 54 "lib/lib.es2018.full.d.ts", 55 "lib/lib.es2018.intl.d.ts", 56 "lib/lib.es2018.promise.d.ts", 57 "lib/lib.es2018.regexp.d.ts", 58 "lib/lib.es2019.array.d.ts", 59 "lib/lib.es2019.d.ts", 60 "lib/lib.es2019.full.d.ts", 61 "lib/lib.es2019.intl.d.ts", 62 "lib/lib.es2019.object.d.ts", 63 "lib/lib.es2019.string.d.ts", 64 "lib/lib.es2019.symbol.d.ts", 65 "lib/lib.es2020.bigint.d.ts", 66 "lib/lib.es2020.d.ts", 67 "lib/lib.es2020.date.d.ts", 68 "lib/lib.es2020.full.d.ts", 69 "lib/lib.es2020.intl.d.ts", 70 "lib/lib.es2020.number.d.ts", 71 "lib/lib.es2020.promise.d.ts", 72 "lib/lib.es2020.sharedmemory.d.ts", 73 "lib/lib.es2020.string.d.ts", 74 "lib/lib.es2020.symbol.wellknown.d.ts", 75 "lib/lib.es2021.d.ts", 76 "lib/lib.es2021.full.d.ts", 77 "lib/lib.es2021.intl.d.ts", 78 "lib/lib.es2021.promise.d.ts", 79 "lib/lib.es2021.string.d.ts", 80 "lib/lib.es2021.weakref.d.ts", 81 "lib/lib.es2022.array.d.ts", 82 "lib/lib.es2022.d.ts", 83 "lib/lib.es2022.error.d.ts", 84 "lib/lib.es2022.full.d.ts", 85 "lib/lib.es2022.intl.d.ts", 86 "lib/lib.es2022.object.d.ts", 87 "lib/lib.es2022.sharedmemory.d.ts", 88 "lib/lib.es2022.string.d.ts", 89 "lib/lib.es5.d.ts", 90 "lib/lib.es6.d.ts", 91 "lib/lib.esnext.d.ts", 92 "lib/lib.esnext.full.d.ts", 93 "lib/lib.esnext.intl.d.ts", 94 "lib/lib.scripthost.d.ts", 95 "lib/lib.webworker.d.ts", 96 "lib/lib.webworker.importscripts.d.ts", 97 "lib/lib.webworker.iterable.d.ts", 98 "lib/pl/diagnosticMessages.generated.json", 99 "lib/pt-br/diagnosticMessages.generated.json", 100 "lib/ru/diagnosticMessages.generated.json", 101 "lib/tr/diagnosticMessages.generated.json", 102 "lib/tsc.js", 103 "lib/tsserver.js", 104 "lib/tsserverlibrary.d.ts", 105 "lib/tsserverlibrary.js", 106 "lib/typesMap.json", 107 "lib/typescript.d.ts", 108 "lib/typescript.js", 109 "lib/typingsInstaller.js", 110 "lib/watchGuard.js", 111 "lib/zh-cn/diagnosticMessages.generated.json", 112 "lib/zh-tw/diagnosticMessages.generated.json", 113] 114 115group("build_typescript") { 116 deps = [ 117 "//third_party/typescript:build_typescript_pack", 118 "//third_party/typescript:typescript_notice", 119 ] 120} 121 122action("build_typescript_pack") { 123 sources = typescript_sources 124 script = "compile_typescript.py" 125 args = [ 126 rebase_path(get_path_info("./", "abspath")), 127 rebase_path("${target_out_dir}"), 128 ] 129 outputs = [ "${target_out_dir}/ohos-typescript-4.9.5-r4.tgz" ] 130} 131 132ohos_prebuilt_etc("build_typescript_etc") { 133 deps = [ 134 ":build_typescript", 135 ":build_typescript_pack", 136 ] 137 target_outputs_ = get_target_outputs(":build_typescript_pack") 138 source = target_outputs_[0] 139 install_enable = false 140 part_name = "typescript" 141 subsystem_name = "thirdparty" 142} 143 144collect_notice("typescript_notice") { 145 license_file = "LICENSE" 146 module_source_dir = get_label_info(":${target_name}", "dir") 147 outputs = [ 148 "${sdk_notice_dir}/ets/build-tools/ets-loader/node_modules/typescript.txt", 149 ] 150} 151