Skip to content

[feat] add_arkts_build_script #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -378,28 +378,28 @@ pkg_files(
)

# Pack ArkTs artifacts
# pkg_files(
# name = "coref-arkts-lib-script-pkg",
# srcs = [
# "//language/arkts:lib",
# ],
# attributes = pkg_attributes(
# mode = "0644",
# ),
# prefix = "lib/coref/arkts",
# strip_prefix = strip_prefix.from_pkg() + "lib",
# )
pkg_files(
name = "coref-arkts-lib-script-pkg",
srcs = [
"//language/arkts:lib",
],
attributes = pkg_attributes(
mode = "0644",
),
prefix = "lib/coref/arkts",
strip_prefix = strip_prefix.from_pkg() + "lib",
)

# pkg_files(
# name = "coref-arkts-src-extractor-pkg",
# srcs = [
# "//language/arkts/extractor:coref-arkts-src-extractor",
# ],
# attributes = pkg_attributes(
# mode = "0755",
# ),
# prefix = "language/arkts/extractor",
# )
pkg_files(
name = "coref-arkts-src-extractor-pkg",
srcs = [
"//language/arkts/extractor:coref-arkts-src-extractor",
],
attributes = pkg_attributes(
mode = "0755",
),
prefix = "language/arkts/extractor",
)

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

coref_libscript_languages = [
Expand All @@ -519,7 +519,7 @@ coref_libscript_languages = [
"properties",
"sql",
# "swift",
# "arkts",
"arkts",
]

copy_to_directory(
Expand Down Expand Up @@ -626,15 +626,15 @@ copy_to_directory(
# visibility = ["//visibility:public"],
# )

# copy_to_directory(
# name = "copy-arkts-lib-script",
# srcs = [
# "//language/arkts:lib",
# ],
# out = "lib/coref/arkts",
# replace_prefixes = {"language/arkts/lib": ""},
# visibility = ["//visibility:public"],
# )
copy_to_directory(
name = "copy-arkts-lib-script",
srcs = [
"//language/arkts:lib",
],
out = "lib/coref/arkts",
replace_prefixes = {"language/arkts/lib": ""},
visibility = ["//visibility:public"],
)

genrule(
name = "coref-lib-script-gen",
Expand All @@ -650,7 +650,7 @@ genrule(
":copy-sql-lib-script",
":copy-cfamily-lib-script",
# ":copy-swift-lib-script",
# ":copy-arkts-lib-script",
":copy-arkts-lib-script",
],
outs = ["lib/coref/%s.gdl" % language for language in coref_libscript_languages],
cmd = """
Expand Down Expand Up @@ -680,7 +680,7 @@ pkg_tar(
name = "sparrow-cli",
srcs = [
":coref-lib-pkg",
# ":coref-arkts-src-extractor-pkg",
":coref-arkts-src-extractor-pkg",
# ":coref-go-src-extractor-pkg",
":coref-sql-src-extractor-pkg",
":coref-java-src-extractor-pkg",
Expand Down
17 changes: 17 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -560,3 +560,20 @@ aspect_bazel_lib_dependencies()
# sha256 = "d4292d9b898a9d264c3e8ea58c83074a63d0c8d84602f4a85b9dbb1b4dcd52ad",
# 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"],
# )


# third_party_typescript 4.9.5-raw Release
# Replace with the third_party_typescript commit you want to use.
third_party_typescript_commit = "5bef9c4ec07035be8167d8190f6df47275b81058"
third_party_typescript_SHA256 = "e703a2ccb546e7fa78f0a0681cbc9569991b807247ff903bf6f0fe5304ec0fe9"

http_archive(
name = "ohos_typescript_src",
sha256 = third_party_typescript_SHA256,
strip_prefix = "third_party_typescript-" + third_party_typescript_commit,
build_file = "//:external/rules_ohos_typescript/ohos_typescript.BUILD",
urls = [
"https://gitee.com/openharmony/third_party_typescript/repository/archive/{commit}.zip".format(commit = third_party_typescript_commit),
"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),
],
)
13 changes: 13 additions & 0 deletions external/rules_ohos_typescript/ohos_typescript.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
filegroup(
name = "ohos_typescript",
srcs = glob(["**/*"]),
visibility = ["//visibility:public"],
)

filegroup(
name = "compile_typescript",
srcs = [
"compile_typescript.py",
],
visibility = ["//visibility:public"],
)