• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 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("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni")
15import("//arkcompiler/ets_frontend/ets_frontend_config.gni")
16import("//arkcompiler/runtime_core/ark_config.gni")
17
18es2panda_src = [
19  "es2panda.cpp",
20  "binder/binder.cpp",
21  "binder/declaration.cpp",
22  "binder/scope.cpp",
23  "binder/variable.cpp",
24  "compiler/base/catchTable.cpp",
25  "compiler/base/condition.cpp",
26  "compiler/base/destructuring.cpp",
27  "compiler/base/hoisting.cpp",
28  "compiler/base/iterators.cpp",
29  "compiler/base/lexenv.cpp",
30  "compiler/base/literals.cpp",
31  "compiler/base/lreference.cpp",
32  "compiler/base/optionalChain.cpp",
33  "compiler/core/compileQueue.cpp",
34  "compiler/core/compilerContext.cpp",
35  "compiler/core/compilerImpl.cpp",
36  "compiler/core/dynamicContext.cpp",
37  "compiler/core/emitter/commonjs.cpp",
38  "compiler/core/emitter/emitter.cpp",
39  "compiler/core/emitter/moduleRecordEmitter.cpp",
40  "compiler/core/envScope.cpp",
41  "compiler/core/function.cpp",
42  "compiler/core/inlineCache.cpp",
43  "compiler/core/labelTarget.cpp",
44  "compiler/core/pandagen.cpp",
45  "compiler/core/regAllocator.cpp",
46  "compiler/core/regScope.cpp",
47  "compiler/core/switchBuilder.cpp",
48  "compiler/debugger/debuginfoDumper.cpp",
49  "compiler/function/asyncFunctionBuilder.cpp",
50  "compiler/function/asyncGeneratorFunctionBuilder.cpp",
51  "compiler/function/functionBuilder.cpp",
52  "compiler/function/generatorFunctionBuilder.cpp",
53  "ir/astDump.cpp",
54  "ir/base/catchClause.cpp",
55  "ir/base/classDefinition.cpp",
56  "ir/base/classProperty.cpp",
57  "ir/base/classStaticBlock.cpp",
58  "ir/base/decorator.cpp",
59  "ir/base/metaProperty.cpp",
60  "ir/base/methodDefinition.cpp",
61  "ir/base/property.cpp",
62  "ir/base/scriptFunction.cpp",
63  "ir/base/spreadElement.cpp",
64  "ir/base/templateElement.cpp",
65  "ir/expression.cpp",
66  "ir/expressions/arrayExpression.cpp",
67  "ir/expressions/arrowFunctionExpression.cpp",
68  "ir/expressions/assignmentExpression.cpp",
69  "ir/expressions/awaitExpression.cpp",
70  "ir/expressions/binaryExpression.cpp",
71  "ir/expressions/callExpression.cpp",
72  "ir/expressions/chainExpression.cpp",
73  "ir/expressions/classExpression.cpp",
74  "ir/expressions/conditionalExpression.cpp",
75  "ir/expressions/functionExpression.cpp",
76  "ir/expressions/identifier.cpp",
77  "ir/expressions/importExpression.cpp",
78  "ir/expressions/literal.cpp",
79  "ir/expressions/literals/bigIntLiteral.cpp",
80  "ir/expressions/literals/booleanLiteral.cpp",
81  "ir/expressions/literals/nullLiteral.cpp",
82  "ir/expressions/literals/numberLiteral.cpp",
83  "ir/expressions/literals/regExpLiteral.cpp",
84  "ir/expressions/literals/stringLiteral.cpp",
85  "ir/expressions/literals/taggedLiteral.cpp",
86  "ir/expressions/memberExpression.cpp",
87  "ir/expressions/newExpression.cpp",
88  "ir/expressions/objectExpression.cpp",
89  "ir/expressions/omittedExpression.cpp",
90  "ir/expressions/privateIdentifier.cpp",
91  "ir/expressions/sequenceExpression.cpp",
92  "ir/expressions/superExpression.cpp",
93  "ir/expressions/taggedTemplateExpression.cpp",
94  "ir/expressions/templateLiteral.cpp",
95  "ir/expressions/thisExpression.cpp",
96  "ir/expressions/typeArgumentsExpression.cpp",
97  "ir/expressions/unaryExpression.cpp",
98  "ir/expressions/updateExpression.cpp",
99  "ir/expressions/yieldExpression.cpp",
100  "ir/module/assertClause.cpp",
101  "ir/module/assertEntry.cpp",
102  "ir/module/exportAllDeclaration.cpp",
103  "ir/module/exportDefaultDeclaration.cpp",
104  "ir/module/exportNamedDeclaration.cpp",
105  "ir/module/exportSpecifier.cpp",
106  "ir/module/importDeclaration.cpp",
107  "ir/module/importDefaultSpecifier.cpp",
108  "ir/module/importNamespaceSpecifier.cpp",
109  "ir/module/importSpecifier.cpp",
110  "ir/statement.cpp",
111  "ir/statements/blockStatement.cpp",
112  "ir/statements/breakStatement.cpp",
113  "ir/statements/classDeclaration.cpp",
114  "ir/statements/continueStatement.cpp",
115  "ir/statements/debuggerStatement.cpp",
116  "ir/statements/doWhileStatement.cpp",
117  "ir/statements/emptyStatement.cpp",
118  "ir/statements/expressionStatement.cpp",
119  "ir/statements/forInStatement.cpp",
120  "ir/statements/forOfStatement.cpp",
121  "ir/statements/forUpdateStatement.cpp",
122  "ir/statements/functionDeclaration.cpp",
123  "ir/statements/ifStatement.cpp",
124  "ir/statements/labelledStatement.cpp",
125  "ir/statements/loopStatement.cpp",
126  "ir/statements/returnStatement.cpp",
127  "ir/statements/switchCaseStatement.cpp",
128  "ir/statements/switchStatement.cpp",
129  "ir/statements/throwStatement.cpp",
130  "ir/statements/tryStatement.cpp",
131  "ir/statements/variableDeclaration.cpp",
132  "ir/statements/variableDeclarator.cpp",
133  "ir/statements/whileStatement.cpp",
134  "ir/ts/tsAnyKeyword.cpp",
135  "ir/ts/tsArrayType.cpp",
136  "ir/ts/tsAsExpression.cpp",
137  "ir/ts/tsBigintKeyword.cpp",
138  "ir/ts/tsBooleanKeyword.cpp",
139  "ir/ts/tsClassImplements.cpp",
140  "ir/ts/tsConditionalType.cpp",
141  "ir/ts/tsConstructorType.cpp",
142  "ir/ts/tsEnumDeclaration.cpp",
143  "ir/ts/tsEnumMember.cpp",
144  "ir/ts/tsExternalModuleReference.cpp",
145  "ir/ts/tsFunctionType.cpp",
146  "ir/ts/tsImportEqualsDeclaration.cpp",
147  "ir/ts/tsImportType.cpp",
148  "ir/ts/tsIndexSignature.cpp",
149  "ir/ts/tsIndexedAccessType.cpp",
150  "ir/ts/tsInferType.cpp",
151  "ir/ts/tsInterfaceBody.cpp",
152  "ir/ts/tsInterfaceDeclaration.cpp",
153  "ir/ts/tsInterfaceHeritage.cpp",
154  "ir/ts/tsIntersectionType.cpp",
155  "ir/ts/tsLiteralType.cpp",
156  "ir/ts/tsMappedType.cpp",
157  "ir/ts/tsMethodSignature.cpp",
158  "ir/ts/tsModuleBlock.cpp",
159  "ir/ts/tsModuleDeclaration.cpp",
160  "ir/ts/tsNamedTupleMember.cpp",
161  "ir/ts/tsNamespaceExportDeclaration.cpp",
162  "ir/ts/tsNeverKeyword.cpp",
163  "ir/ts/tsNonNullExpression.cpp",
164  "ir/ts/tsNullKeyword.cpp",
165  "ir/ts/tsNumberKeyword.cpp",
166  "ir/ts/tsObjectKeyword.cpp",
167  "ir/ts/tsOptionalType.cpp",
168  "ir/ts/tsParameterProperty.cpp",
169  "ir/ts/tsParenthesizedType.cpp",
170  "ir/ts/tsPrivateIdentifier.cpp",
171  "ir/ts/tsPropertySignature.cpp",
172  "ir/ts/tsQualifiedName.cpp",
173  "ir/ts/tsRestType.cpp",
174  "ir/ts/tsSatisfiesExpression.cpp",
175  "ir/ts/tsSignatureDeclaration.cpp",
176  "ir/ts/tsStringKeyword.cpp",
177  "ir/ts/tsSymbolKeyword.cpp",
178  "ir/ts/tsTemplateLiteralType.cpp",
179  "ir/ts/tsThisType.cpp",
180  "ir/ts/tsTupleType.cpp",
181  "ir/ts/tsTypeAliasDeclaration.cpp",
182  "ir/ts/tsTypeAssertion.cpp",
183  "ir/ts/tsTypeLiteral.cpp",
184  "ir/ts/tsTypeOperator.cpp",
185  "ir/ts/tsTypeParameter.cpp",
186  "ir/ts/tsTypeParameterDeclaration.cpp",
187  "ir/ts/tsTypeParameterInstantiation.cpp",
188  "ir/ts/tsTypePredicate.cpp",
189  "ir/ts/tsTypeQuery.cpp",
190  "ir/ts/tsTypeReference.cpp",
191  "ir/ts/tsUndefinedKeyword.cpp",
192  "ir/ts/tsUnionType.cpp",
193  "ir/ts/tsUnknownKeyword.cpp",
194  "ir/ts/tsVoidKeyword.cpp",
195  "lexer/keywordsUtil.cpp",
196  "lexer/lexer.cpp",
197  "lexer/regexp/regexp.cpp",
198  "lexer/token/sourceLocation.cpp",
199  "lexer/token/token.cpp",
200  "parser/commonjs.cpp",
201  "parser/context/parserContext.cpp",
202  "parser/expressionParser.cpp",
203  "parser/module/sourceTextModuleRecord.cpp",
204  "parser/parserImpl.cpp",
205  "parser/program/program.cpp",
206  "parser/statementParser.cpp",
207  "parser/transformer/transformer.cpp",
208  "typescript/checker.cpp",
209  "typescript/core/binaryLikeExpression.cpp",
210  "typescript/core/destructuringContext.cpp",
211  "typescript/core/function.cpp",
212  "typescript/core/helpers.cpp",
213  "typescript/core/object.cpp",
214  "typescript/core/typeCreation.cpp",
215  "typescript/core/typeElaborationContext.cpp",
216  "typescript/core/typeRelation.cpp",
217  "typescript/core/util.cpp",
218  "typescript/types/anyType.cpp",
219  "typescript/types/arrayType.cpp",
220  "typescript/types/bigintLiteralType.cpp",
221  "typescript/types/bigintType.cpp",
222  "typescript/types/booleanLiteralType.cpp",
223  "typescript/types/booleanType.cpp",
224  "typescript/types/constructorType.cpp",
225  "typescript/types/enumLiteralType.cpp",
226  "typescript/types/enumType.cpp",
227  "typescript/types/functionType.cpp",
228  "typescript/types/globalTypesHolder.cpp",
229  "typescript/types/indexInfo.cpp",
230  "typescript/types/interfaceType.cpp",
231  "typescript/types/neverType.cpp",
232  "typescript/types/nonPrimitiveType.cpp",
233  "typescript/types/nullType.cpp",
234  "typescript/types/numberLiteralType.cpp",
235  "typescript/types/numberType.cpp",
236  "typescript/types/objectDescriptor.cpp",
237  "typescript/types/objectLiteralType.cpp",
238  "typescript/types/objectType.cpp",
239  "typescript/types/signature.cpp",
240  "typescript/types/stringLiteralType.cpp",
241  "typescript/types/stringType.cpp",
242  "typescript/types/symbolType.cpp",
243  "typescript/types/tupleType.cpp",
244  "typescript/types/type.cpp",
245  "typescript/types/typeParameter.cpp",
246  "typescript/types/typeReference.cpp",
247  "typescript/types/typeRelation.cpp",
248  "typescript/types/undefinedType.cpp",
249  "typescript/types/unionType.cpp",
250  "typescript/types/unknownType.cpp",
251  "typescript/types/voidType.cpp",
252  "util/base64.cpp",
253  "util/bitset.cpp",
254  "util/concurrent.cpp",
255  "util/dumper.cpp",
256  "util/helpers.cpp",
257  "util/patchFix.cpp",
258  "util/moduleHelpers.cpp",
259  "util/symbolTable.cpp",
260  "util/ustring.cpp",
261  "util/workerQueue.cpp",
262  "util/commonUtil.cpp",
263]
264
265config("es2abc_config_src") {
266  include_dirs = [
267    "./",
268    "./binder",
269    "./util",
270    "./compiler/base",
271    "./compiler/core",
272    "./compiler/debugger",
273    "./compiler/function",
274    "./ir",
275    "./ir/base",
276    "./ir/expressions",
277    "./ir/module",
278    "./ir/statements",
279    "./ir/ts",
280    "./parser",
281    "./parser/context",
282    "./lexer",
283    "./lexer/token",
284    "./lexer/regexp",
285    "./typescript",
286    "./typescript/types",
287  ]
288
289  cflags = [ "-fexceptions" ]
290}
291
292config("es2abc_config_common") {
293  configs = [
294    "$ark_root:ark_config",
295    "$sdk_libc_secshared_config",
296    "$ark_root/libpandafile:arkfile_public_config",
297    "$ark_root/libpandabase:arkbase_public_config",
298    "$ark_root/assembler:arkassembler_public_config",
299    "$ark_root/abc2program:abc2program_public_config",
300    "$ark_third_party_root/json:nlohmann_json_config",
301    ":es2abc_config_src",
302  ]
303
304  if (enable_bytecode_optimizer) {
305    defines = [ "ENABLE_BYTECODE_OPT" ]
306    configs += [
307      "$ark_root/compiler:arkcompiler_public_config",
308      "$ark_root/bytecode_optimizer:bytecodeopt_public_config",
309    ]
310  }
311}
312
313# generate headers for es2panda parser
314generated_header_dir = "${target_out_dir}/gen"
315action_foreach("gen_keywords_headers") {
316  template_files = [
317    "keywords.h.erb",
318    "keywordsMap.h.erb",
319  ]
320  keywords_templates_dir = "./lexer/templates"
321  keywords_generator = "./lexer/scripts/keywords.rb"
322
323  sources = []
324  foreach(file, template_files) {
325    sources += [ rebase_path("${keywords_templates_dir}/${file}") ]
326  }
327  outputs = [ "${generated_header_dir}/{{source_name_part}}" ]
328
329  script = "scripts/gen_keywords.sh"
330  inputs = [ "${keywords_generator}" ]
331  args = [
332    "-g",
333    rebase_path("${keywords_generator}"),
334    "-t",
335    "{{source}}",
336    "-o",
337    "{{source_name_part}}",
338    "-d",
339    rebase_path("${generated_header_dir}"),
340  ]
341}
342
343# generate headers for es2panda compiler
344isa_gen = "${ark_root}/isa/gen.rb"
345isa_gen_data = "$root_gen_dir/isa/isa.yaml"
346isa_gen_require = "${ark_root}/isa/isapi.rb"
347action_foreach("gen_isa_headers") {
348  deps = [ "//arkcompiler/runtime_core/isa:isa_combine" ]
349
350  template_files = [
351    "isa.h.erb",
352    "formats.h.erb",
353  ]
354  keywords_templates_dir = "./compiler/templates"
355
356  sources = []
357  foreach(file, template_files) {
358    sources += [ rebase_path("${keywords_templates_dir}/${file}") ]
359  }
360  outputs = [ "${generated_header_dir}/{{source_name_part}}" ]
361
362  script = "scripts/gen_isa.sh"
363  inputs = [
364    "${isa_gen}",
365    "${isa_gen_data}",
366    "${isa_gen_require}",
367  ]
368  args = [
369    "-g",
370    rebase_path("${isa_gen}"),
371    "-t",
372    "{{source}}",
373    "-a",
374    rebase_path("${isa_gen_data}"),
375    "-o",
376    "{{source_name_part}}",
377    "-d",
378    rebase_path("${generated_header_dir}"),
379    "-r",
380    rebase_path("${isa_gen_require}"),
381  ]
382}
383
384ohos_static_library("es2panda_lib") {
385  sources = es2panda_src
386  use_exceptions = true
387  if (is_mac && current_cpu == "arm64") {
388    use_rtti = true
389  }
390
391  configs = [
392    ":es2abc_config_common",
393    "../merge_abc:panda_assembly_proto_public_config",
394  ]
395
396  include_dirs = [
397    "${target_out_dir}",
398    "//third_party/icu/icu4c/source/common",
399    "//third_party/icu/icu4c/source/i18n",
400    "//third_party/icu/icu4c/source",
401  ]
402
403  deps = [
404    ":gen_isa_headers",
405    ":gen_keywords_headers",
406    "$ark_third_party_root/icu/icu4c:static_icuuc",
407    "../merge_abc:panda_assembly_proto_static",
408  ]
409
410  external_deps = []
411  if (!is_arkui_x) {
412    external_deps += [
413      "json:nlohmann_json_static",
414      "runtime_core:abc2program_frontend_static",
415      "runtime_core:libarkassembler_frontend_static",
416      "runtime_core:libarkbase_frontend_static",
417      "runtime_core:libarkfile_frontend_static",
418      "runtime_core:libarkziparchive_frontend_static",
419    ]
420
421    if (enable_bytecode_optimizer) {
422      external_deps += [
423        "runtime_core:libarkbytecodeopt_frontend_static",
424        "runtime_core:libarkcompiler_frontend_static",
425      ]
426    }
427  } else {
428    deps += [
429      "$ark_root/abc2program:abc2program_frontend_static",
430      "$ark_root/assembler:libarkassembler_frontend_static",
431      "$ark_root/libpandabase:libarkbase_frontend_static",
432      "$ark_root/libpandafile:libarkfile_frontend_static",
433      "$ark_root/libziparchive:libarkziparchive_frontend_static",
434      "$ark_third_party_root/json:nlohmann_json_static",
435    ]
436    if (enable_bytecode_optimizer) {
437      deps += [
438        "$ark_root/bytecode_optimizer:libarkbytecodeopt_frontend_static",
439        "$ark_root/compiler:libarkcompiler_frontend_static",
440      ]
441    }
442  }
443
444  cflags = [
445    "-Wno-c++20-designator",
446    "-Wno-implicit-fallthrough",
447  ]
448
449  part_name = "ets_frontend"
450  subsystem_name = "arkcompiler"
451}
452
453ohos_executable("es2panda") {
454  use_exceptions = true
455  if (is_mac && current_cpu == "arm64") {
456    use_rtti = true
457  }
458
459  sources = [
460    "aot/emitFiles.cpp",
461    "aot/main.cpp",
462    "aot/options.cpp",
463    "aot/resolveDepsRelation.cpp",
464  ]
465
466  include_dirs = [ "./aot" ]
467
468  configs = [
469    ":es2abc_config_common",
470    "//arkcompiler/ets_frontend/merge_abc:panda_assembly_proto_public_config",
471  ]
472
473  deps = [
474    ":es2panda_lib",
475    "//arkcompiler/ets_frontend/merge_abc:panda_assembly_proto_static",
476  ]
477
478  external_deps = [ "zlib:libz" ]
479
480  ldflags = []
481  if (is_linux) {
482    if (build_public_version) {
483      ldflags += [ "-Wl,-Bstatic" ]
484      ldflags += [ "-lstdc++" ]
485      ldflags += [ "-Wl,-Bdynamic" ]
486    } else {
487      libs = [ libcpp_static_lib ]
488    }
489  }
490
491  # The default stack size of the Windows platform is 1024 kb, which might lead to stack overflow.
492  # Here is to set the stack size of es2abc.exe to 10M, which is the default value for Linux platform.
493  if (is_mingw) {
494    ldflags += [ "-Wl,--stack,10485760" ]
495  }
496
497  output_name = "es2abc"
498  install_enable = false
499  part_name = "ets_frontend"
500  subsystem_name = "arkcompiler"
501}
502
503if (is_linux || (is_build_sdk && is_ohos)) {
504  ohos_copy("es2abc_build") {
505    deps = [ ":es2panda" ]
506    sources = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc" ]
507    outputs = [ "${target_out_dir}/es2abc-tmp" ]
508    module_source_dir = "${root_out_dir}/arkcompiler/ets_frontend"
509    module_install_name = "es2abc"
510  }
511
512  ohos_copy("es2abc_build_ets") {
513    deps = [ ":es2panda" ]
514    sources = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc" ]
515    outputs = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc-ets" ]
516    module_source_dir = "${root_out_dir}/arkcompiler/ets_frontend"
517    module_install_name = "es2abc"
518  }
519}
520
521if (is_mingw) {
522  ohos_copy("es2abc_build_win") {
523    deps = [ ":es2panda" ]
524    sources = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc.exe" ]
525    outputs = [ "${target_out_dir}/es2abc-tmp" ]
526    module_source_dir = "${root_out_dir}/arkcompiler/ets_frontend"
527    module_install_name = "es2abc.exe"
528  }
529
530  ohos_copy("es2abc_build_win_ets") {
531    deps = [ ":es2panda" ]
532    sources = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc.exe" ]
533    outputs = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc-win-ets" ]
534    module_source_dir = "${root_out_dir}/arkcompiler/ets_frontend"
535    module_install_name = "es2abc.exe"
536  }
537}
538
539if (is_mac) {
540  ohos_copy("es2abc_build_mac") {
541    deps = [ ":es2panda" ]
542    sources = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc" ]
543    outputs = [ "${target_out_dir}/es2abc-tmp" ]
544    module_source_dir = "${root_out_dir}/arkcompiler/ets_frontend"
545    module_install_name = "es2abc"
546  }
547
548  ohos_copy("es2abc_build_mac_ets") {
549    deps = [ ":es2panda" ]
550    sources = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc" ]
551    outputs = [ "${root_out_dir}/arkcompiler/ets_frontend/es2abc-mac-ets" ]
552    module_source_dir = "${root_out_dir}/arkcompiler/ets_frontend"
553    module_install_name = "es2abc"
554  }
555}
556
557if (is_linux) {
558  ohos_copy("build_es2abc_for_hap") {
559    deps = [ ":es2panda(${host_toolchain})" ]
560    es2abc_root_out_dir =
561        get_label_info(":es2panda_build($host_toolchain)", "root_out_dir")
562    es2abc_target_out_dir =
563        get_label_info(":es2panda_build($host_toolchain)", "target_out_dir")
564
565    sources = [ "${es2abc_root_out_dir}/arkcompiler/ets_frontend/es2abc" ]
566    outputs = [ "${es2abc_target_out_dir}/build/bin/es2abc" ]
567  }
568} else if (is_mac) {
569  ohos_copy("build_es2abc_for_hap") {
570    deps = [ ":es2panda(${host_toolchain})" ]
571    es2abc_root_out_dir =
572        get_label_info(":es2panda_build($host_toolchain)", "root_out_dir")
573    es2abc_target_out_dir =
574        get_label_info(":es2panda_build($host_toolchain)", "target_out_dir")
575
576    sources = [ "${es2abc_root_out_dir}/arkcompiler/ets_frontend/es2abc" ]
577    outputs = [ "${es2abc_target_out_dir}/build-mac/bin/es2abc" ]
578  }
579}
580
581ohos_copy("panda_es2abc") {
582  sources = [ "${es2abc_root}/scripts/ts2abc.js" ]
583
584  outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
585  module_source_dir = target_out_dir + "/$target_name/"
586  module_install_name = ""
587
588  part_name = "ets_frontend"
589  subsystem_name = "arkcompiler"
590}
591
592ohos_copy("panda_es2abc_ets") {
593  sources = [ "${es2abc_root}/scripts/ts2abc.js" ]
594  outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
595  module_source_dir = target_out_dir + "/$target_name/"
596  module_install_name = ""
597
598  part_name = "ets_frontend"
599  subsystem_name = "arkcompiler"
600}
601
602ohos_copy("es2abc_js_file") {
603  sources = [ "${es2abc_root}/scripts/ts2abc.js" ]
604  outputs = [ target_out_dir + "/{{source_file_part}}" ]
605
606  part_name = "ets_frontend"
607  subsystem_name = "arkcompiler"
608}
609
610group("es2panda_build") {
611  if (host_os == "linux") {
612    deps = [ ":es2panda(${toolchain_linux})" ]
613  }
614
615  if (host_os == "mac") {
616    deps = [ ":es2panda(${toolchain_mac})" ]
617  }
618
619  if (host_os == "ohos") {
620    deps = [ ":es2panda(${toolchain_ohos})" ]
621  }
622}
623
624group("es2panda_build_win") {
625  deps = [ ":es2panda(${toolchain_win})" ]
626}
627
628group("es2abc_tests") {
629  deps = [ "./test:es2abc_base64_tests" ]
630  deps += [ "./test:es2abc_compiler_tests" ]
631  deps += [ "./test:es2abc_parser_tests" ]
632  deps += [ "./test:es2abc_parser_tsc_tests" ]
633  deps += [ "./test:es2abc_patch_tests" ]
634  deps += [ "./test:es2abc_bytecode_tests" ]
635}
636