-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
87 lines (81 loc) · 2.29 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
load("@gazelle//:def.bzl", "gazelle")
load("@rules_go//go:def.bzl", "go_library", "go_test")
# No need for gazelle:prefix as it reads from go.mod
gazelle(
name = "gazelle",
command = "fix",
)
gazelle(
name = "gazelle_diff",
command = "fix",
extra_args = ["--mode=diff"],
)
go_library(
name = "specops",
srcs = [
"compile.go",
"opcodes.gen.bazel.go", # keep
"run.go",
"specops.go",
"stack.go",
"tags.go",
],
importpath = "github.com/arr4n/specops",
visibility = ["//visibility:public"],
deps = [
"//evmdebug",
"//revert",
"//runopts",
"//stack",
"//types",
"@com_github_ethereum_go_ethereum//common",
"@com_github_ethereum_go_ethereum//core",
"@com_github_ethereum_go_ethereum//core/rawdb",
"@com_github_ethereum_go_ethereum//core/state",
"@com_github_ethereum_go_ethereum//core/tracing",
"@com_github_ethereum_go_ethereum//core/vm",
"@com_github_ethereum_go_ethereum//crypto",
"@com_github_ethereum_go_ethereum//params",
"@com_github_holiman_uint256//:uint256",
],
)
go_test(
name = "specops_test",
srcs = [
"examples_test.go",
"pushlabels_test.go",
"specops_test.go",
"tags_test.go",
],
embed = [":specops"],
deps = [
"//stack",
"//types",
"@com_github_ethereum_go_ethereum//common",
"@com_github_ethereum_go_ethereum//core/vm",
"@com_github_ethereum_go_ethereum//crypto",
"@com_github_google_go_cmp//cmp",
"@com_github_holiman_uint256//:uint256",
],
)
genrule(
name = "gen_opcodes",
outs = ["opcodes.gen.bazel.go"],
cmd = "$(location //internal/opcopy) > $@",
tools = ["//internal/opcopy"],
visibility = ["//visibility:private"],
)
# Provide a concrete version of the generated file for compatibility with
# regular Go tooling.
#
# The go_library(), however, directly depends on the genrule() so we don't have
# to run the write() every time //internal/opcopy is updated.
#
# gazelle:exclude opcodes.gen.go
write_source_files(
name = "write_gen_opcodes",
files = {
"opcodes.gen.go": ":gen_opcodes",
},
)