Skip to content

Commit 34bac99

Browse files
committed
[feat] add_arkts_build_script
1 parent 383f84b commit 34bac99

File tree

3 files changed

+64
-34
lines changed

3 files changed

+64
-34
lines changed

BUILD

+34-34
Original file line numberDiff line numberDiff line change
@@ -378,28 +378,28 @@ pkg_files(
378378
)
379379

380380
# Pack ArkTs artifacts
381-
# pkg_files(
382-
# name = "coref-arkts-lib-script-pkg",
383-
# srcs = [
384-
# "//language/arkts:lib",
385-
# ],
386-
# attributes = pkg_attributes(
387-
# mode = "0644",
388-
# ),
389-
# prefix = "lib/coref/arkts",
390-
# strip_prefix = strip_prefix.from_pkg() + "lib",
391-
# )
381+
pkg_files(
382+
name = "coref-arkts-lib-script-pkg",
383+
srcs = [
384+
"//language/arkts:lib",
385+
],
386+
attributes = pkg_attributes(
387+
mode = "0644",
388+
),
389+
prefix = "lib/coref/arkts",
390+
strip_prefix = strip_prefix.from_pkg() + "lib",
391+
)
392392

393-
# pkg_files(
394-
# name = "coref-arkts-src-extractor-pkg",
395-
# srcs = [
396-
# "//language/arkts/extractor:coref-arkts-src-extractor",
397-
# ],
398-
# attributes = pkg_attributes(
399-
# mode = "0755",
400-
# ),
401-
# prefix = "language/arkts/extractor",
402-
# )
393+
pkg_files(
394+
name = "coref-arkts-src-extractor-pkg",
395+
srcs = [
396+
"//language/arkts/extractor:coref-arkts-src-extractor",
397+
],
398+
attributes = pkg_attributes(
399+
mode = "0755",
400+
),
401+
prefix = "language/arkts/extractor",
402+
)
403403

404404
# Current pkg_tar/pkg_files rules can't pack a directory generated from genrule.
405405
# To workaround this, use the deprecated pkg_tar rule instead
@@ -506,7 +506,7 @@ coref_lib_script_pkgs = [
506506
":coref-cfamily-lib-script-pkg",
507507
":coref-properties-lib-script-pkg",
508508
":coref-sql-lib-script-pkg",
509-
# ":coref-arkts-lib-script-pkg",
509+
":coref-arkts-lib-script-pkg",
510510
]
511511

512512
coref_libscript_languages = [
@@ -519,7 +519,7 @@ coref_libscript_languages = [
519519
"properties",
520520
"sql",
521521
# "swift",
522-
# "arkts",
522+
"arkts",
523523
]
524524

525525
copy_to_directory(
@@ -626,15 +626,15 @@ copy_to_directory(
626626
# visibility = ["//visibility:public"],
627627
# )
628628

629-
# copy_to_directory(
630-
# name = "copy-arkts-lib-script",
631-
# srcs = [
632-
# "//language/arkts:lib",
633-
# ],
634-
# out = "lib/coref/arkts",
635-
# replace_prefixes = {"language/arkts/lib": ""},
636-
# visibility = ["//visibility:public"],
637-
# )
629+
copy_to_directory(
630+
name = "copy-arkts-lib-script",
631+
srcs = [
632+
"//language/arkts:lib",
633+
],
634+
out = "lib/coref/arkts",
635+
replace_prefixes = {"language/arkts/lib": ""},
636+
visibility = ["//visibility:public"],
637+
)
638638

639639
genrule(
640640
name = "coref-lib-script-gen",
@@ -650,7 +650,7 @@ genrule(
650650
":copy-sql-lib-script",
651651
":copy-cfamily-lib-script",
652652
# ":copy-swift-lib-script",
653-
# ":copy-arkts-lib-script",
653+
":copy-arkts-lib-script",
654654
],
655655
outs = ["lib/coref/%s.gdl" % language for language in coref_libscript_languages],
656656
cmd = """
@@ -680,7 +680,7 @@ pkg_tar(
680680
name = "sparrow-cli",
681681
srcs = [
682682
":coref-lib-pkg",
683-
# ":coref-arkts-src-extractor-pkg",
683+
":coref-arkts-src-extractor-pkg",
684684
# ":coref-go-src-extractor-pkg",
685685
":coref-sql-src-extractor-pkg",
686686
":coref-java-src-extractor-pkg",

WORKSPACE

+17
Original file line numberDiff line numberDiff line change
@@ -560,3 +560,20 @@ aspect_bazel_lib_dependencies()
560560
# sha256 = "d4292d9b898a9d264c3e8ea58c83074a63d0c8d84602f4a85b9dbb1b4dcd52ad",
561561
# urls = ["https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/swift/lib_InternalSwiftSyntaxParser/5.5.3-alios7/lib_InternalSwiftSyntaxParser.zip"],
562562
# )
563+
564+
565+
# third_party_typescript 4.9.5-raw Release
566+
# Replace with the third_party_typescript commit you want to use.
567+
third_party_typescript_commit = "5bef9c4ec07035be8167d8190f6df47275b81058"
568+
third_party_typescript_SHA256 = "e703a2ccb546e7fa78f0a0681cbc9569991b807247ff903bf6f0fe5304ec0fe9"
569+
570+
http_archive(
571+
name = "ohos_typescript_src",
572+
sha256 = third_party_typescript_SHA256,
573+
strip_prefix = "third_party_typescript-" + third_party_typescript_commit,
574+
build_file = "//:external/rules_ohos_typescript/ohos_typescript.BUILD",
575+
urls = [
576+
"https://gitee.com/openharmony/third_party_typescript/repository/archive/{commit}.zip".format(commit = third_party_typescript_commit),
577+
"https://antsys-sparrow-data.cn-shanghai-alipay-office.oss-alipay.aliyuncs.com/sparrow/public/tools/ohos-typescript/third_party_typescript-{commit}.zip".format(commit = third_party_typescript_commit),
578+
],
579+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
filegroup(
2+
name = "ohos_typescript",
3+
srcs = glob(["**/*"]),
4+
visibility = ["//visibility:public"],
5+
)
6+
7+
filegroup(
8+
name = "compile_typescript",
9+
srcs = [
10+
"compile_typescript.py",
11+
],
12+
visibility = ["//visibility:public"],
13+
)

0 commit comments

Comments
 (0)