Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2e0f567

Browse filesBrowse files
committed
use gazelle to generate go bazel build files.
1 parent 34b2cfc commit 2e0f567
Copy full SHA for 2e0f567

File tree

Expand file treeCollapse file tree

10 files changed

+126
-15
lines changed
Filter options
Expand file treeCollapse file tree

10 files changed

+126
-15
lines changed

‎BUILD

Copy file name to clipboardExpand all lines: BUILD
+2-3Lines changed: 2 additions & 3 deletions
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

Copy file name to clipboard
+22Lines changed: 22 additions & 0 deletions
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+
)
+23Lines changed: 23 additions & 0 deletions
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+
)
+8Lines changed: 8 additions & 0 deletions
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+
)
+24Lines changed: 24 additions & 0 deletions
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+
)
+20Lines changed: 20 additions & 0 deletions
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+
)
+21Lines changed: 21 additions & 0 deletions
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

Copy file name to clipboardExpand all lines: language/java/extractor/BUILD
-1Lines changed: 0 additions & 1 deletion
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

Copy file name to clipboardExpand all lines: language/python/BUILD
-1Lines changed: 0 additions & 1 deletion
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

Copy file name to clipboardExpand all lines: language/python/extractor/BUILD
+6-10Lines changed: 6 additions & 10 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.