diff --git a/BUILD b/BUILD index 6adf23f..38096a4 100644 --- a/BUILD +++ b/BUILD @@ -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 @@ -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 = [ @@ -519,7 +519,7 @@ coref_libscript_languages = [ "properties", "sql", # "swift", - # "arkts", + "arkts", ] copy_to_directory( @@ -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", @@ -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 = """ @@ -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", diff --git a/WORKSPACE b/WORKSPACE index f2acc2b..20d9c68 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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), + ], +) diff --git a/external/rules_ohos_typescript/ohos_typescript.BUILD b/external/rules_ohos_typescript/ohos_typescript.BUILD new file mode 100644 index 0000000..4a89461 --- /dev/null +++ b/external/rules_ohos_typescript/ohos_typescript.BUILD @@ -0,0 +1,13 @@ +filegroup( + name = "ohos_typescript", + srcs = glob(["**/*"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "compile_typescript", + srcs = [ + "compile_typescript.py", + ], + visibility = ["//visibility:public"], +)