Skip to content

Commit 8773982

Browse files
committed
Merge branch 'main' into lhk_dev
2 parents 4c68270 + 8cd2000 commit 8773982

File tree

10 files changed

+126
-15
lines changed

10 files changed

+126
-15
lines changed

BUILD

+2-3
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,6 @@ copy_to_bin(
467467
visibility = ["//visibility:public"],
468468
)
469469

470-
471470
# copy_to_directory(
472471
# name = "copy-godel-0.3-lib",
473472
# srcs = [
@@ -703,8 +702,8 @@ pkg_tar(
703702
strip_prefix = strip_prefix.from_pkg(),
704703
visibility = ["//visibility:public"],
705704
deps = [
706-
":sparrow-cli-pkg",
707705
":coref-cfamily-src-extractor-pkg",
706+
":sparrow-cli-pkg",
708707
],
709708
)
710709

@@ -726,4 +725,4 @@ pkg_tar(
726725
# "-build_file_proto_mode=disable_global",
727726
# ],
728727
# command = "update-repos",
729-
# )
728+
# )

language/go/extractor/BUILD

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
load("@bazel_gazelle//:def.bzl", "gazelle")
3+
4+
# gazelle:prefix alipay.com/code_insight/coref-go-extractor
5+
gazelle(name = "gazelle")
6+
7+
go_library(
8+
name = "coref-go-extractor_lib",
9+
srcs = ["main.go"],
10+
importpath = "alipay.com/code_insight/coref-go-extractor",
11+
visibility = ["//visibility:private"],
12+
deps = [
13+
"//language/go/extractor/src/config",
14+
"//language/go/extractor/src/core",
15+
],
16+
)
17+
18+
go_binary(
19+
name = "extractor",
20+
embed = [":coref-go-extractor_lib"],
21+
visibility = ["//visibility:public"],
22+
)
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2+
3+
go_library(
4+
name = "cli_lib",
5+
srcs = [
6+
"extractor_cli.go",
7+
"helper.go",
8+
],
9+
importpath = "alipay.com/code_insight/coref-go-extractor/src/cli",
10+
visibility = ["//visibility:private"],
11+
deps = [
12+
"//language/go/extractor/src/config",
13+
"//language/go/extractor/src/core",
14+
"//language/go/extractor/src/util",
15+
"@org_golang_x_mod//semver",
16+
],
17+
)
18+
19+
go_binary(
20+
name = "cli",
21+
embed = [":cli_lib"],
22+
visibility = ["//visibility:public"],
23+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
2+
3+
go_library(
4+
name = "config",
5+
srcs = ["config.go"],
6+
importpath = "alipay.com/code_insight/coref-go-extractor/src/config",
7+
visibility = ["//visibility:public"],
8+
)
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
2+
3+
go_library(
4+
name = "core",
5+
srcs = [
6+
"extract_file.go",
7+
"extract_mod.go",
8+
"extract_pkg.go",
9+
"extraction.go",
10+
"label.go",
11+
"profile.go",
12+
],
13+
importpath = "alipay.com/code_insight/coref-go-extractor/src/core",
14+
visibility = ["//visibility:public"],
15+
deps = [
16+
"//language/go/extractor/src/config",
17+
"//language/go/extractor/src/orm",
18+
"//language/go/extractor/src/util",
19+
"@io_gorm_gorm//:gorm",
20+
"@org_golang_x_mod//modfile",
21+
"@org_golang_x_tools//go/packages",
22+
"@org_modernc_mathutil//:mathutil",
23+
],
24+
)
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
2+
3+
go_library(
4+
name = "orm",
5+
srcs = [
6+
"data_decl.go",
7+
"data_types.go",
8+
"db_model.go",
9+
"db_writer.go",
10+
],
11+
importpath = "alipay.com/code_insight/coref-go-extractor/src/orm",
12+
visibility = ["//visibility:public"],
13+
deps = [
14+
"@com_github_glebarez_sqlite//:sqlite",
15+
"@io_gorm_gorm//:gorm",
16+
"@io_gorm_gorm//logger",
17+
"@io_gorm_gorm//schema",
18+
"@org_golang_x_tools//go/packages",
19+
],
20+
)
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
2+
3+
go_library(
4+
name = "util",
5+
srcs = [
6+
"setup.go",
7+
"util.go",
8+
],
9+
importpath = "alipay.com/code_insight/coref-go-extractor/src/util",
10+
visibility = ["//visibility:public"],
11+
)
12+
13+
go_test(
14+
name = "util_test",
15+
srcs = ["util_test.go"],
16+
embed = [":util"],
17+
deps = [
18+
"@com_github_stretchr_testify//assert",
19+
"@com_github_stretchr_testify//require",
20+
],
21+
)

language/java/extractor/BUILD

-1
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,3 @@ genrule(
127127
"@maven//:org_xerial_sqlite_jdbc",
128128
],
129129
)
130-

language/python/BUILD

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Using filegroup is encouraged instead of referencing directories directly. The latter is unsound.
32
# When combined with glob, filegroup can ensure that all files are explicitly known to the build system.
43
filegroup(

language/python/extractor/BUILD

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
load("//:visibility.bzl", "PUBLIC_VISIBILITY")
2-
32
load("@rules_python//python:defs.bzl", "py_runtime_pair")
4-
53
load("@python3_10//:defs.bzl", "interpreter")
64

75
py_runtime(
86
name = "my_py3_runtime",
7+
interpreter = interpreter,
98
python_version = "PY3",
10-
interpreter = interpreter
119
)
1210

1311
#py_runtime_pair(
@@ -26,10 +24,8 @@ package(
2624
)
2725

2826
load("@deps//:requirements.bzl", "requirement")
29-
3027
load("@rules_python//python:defs.bzl", "py_library")
3128

32-
3329
#py_binary(
3430
# name = "coref-python-src-extractor1",
3531
# srcs = glob(["src/**/*.py"], exclude=["**/tests/**"]),
@@ -45,7 +41,10 @@ load("@rules_python//python:defs.bzl", "py_library")
4541

4642
py_library(
4743
name = "test",
48-
srcs = glob(["src/**/*.py"], exclude=["**/tests/**"]),
44+
srcs = glob(
45+
["src/**/*.py"],
46+
exclude = ["**/tests/**"],
47+
),
4948
visibility = ["//visibility:public"],
5049
deps = [
5150
requirement("tqdm"),
@@ -61,7 +60,6 @@ filegroup(
6160
],
6261
)
6362

64-
6563
genrule(
6664
name = "test1",
6765
srcs = [
@@ -77,8 +75,6 @@ genrule(
7775
$(PYTHON3) $(locations //language/python/extractor:install_source)
7876
cp language/python/extractor/src/dist/coref-python-src-extractor $(RULEDIR)
7977
""",
80-
toolchains=["@rules_python//python:current_py_toolchain",],
78+
toolchains = ["@rules_python//python:current_py_toolchain"],
8179
visibility = ["//visibility:public"],
8280
)
83-
84-

0 commit comments

Comments
 (0)