aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/BUILD
blob: 193570ebb4ee81b1310d8eb9321a0e72d0345a54 (plain)
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
package(default_visibility = ["//src:__subpackages__"])

filegroup(
    name = "srcs",
    srcs = glob(
        ["**"],
    ),
)

# @AutoCodec annotation and plugin. Used by clients.
java_library(
    name = "autocodec",
    exported_plugins = [":autocodec-plugin"],
    exports = [":autocodec-annotation"],
)

# @AutoCodec annotation only. Used by clients and the processor.
java_library(
    name = "autocodec-annotation",
    srcs = ["AutoCodec.java"],
)

# Installs the @AutoCodec annotation processor as a compiler plugin.
java_plugin(
    name = "autocodec-plugin",
    processor_class = "com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodecProcessor",
    deps = [
        ":autocodec-processor",
    ],
)

# @AutoCodec annotation processor implementation.
java_library(
    name = "autocodec-processor",
    srcs = ["AutoCodecProcessor.java"],
    deps = [
        ":autocodec-annotation",
        ":autocodec-util",
        "//src/main/java/com/google/devtools/build/lib/skyframe/serialization",
        "//third_party:auto_service",
        "//third_party:guava",
        "//third_party/java/javapoet",
        "//third_party/protobuf:protobuf_java",
    ],
)

# Code shared between autocodec-processor and fake-autocodec-processor.
java_library(
    name = "autocodec-util",
    srcs = ["AutoCodecUtil.java"],
    deps = [
        ":autocodec-annotation",
        "//third_party:guava",
    ],
)

# This is a fake implementation for bootstrapping. It must *not* be used in production.
java_library(
    name = "fake-autocodec-processor",
    srcs = ["FakeAutoCodecProcessor.java"],
    deps = [
        ":autocodec-util",
        "//src/main/java/com/google/devtools/build/lib/skyframe/serialization",
        "//third_party:auto_service",
        "//third_party:guava",
        "//third_party/java/javapoet",
        "//third_party/protobuf:protobuf_java",
    ],
)

load("//tools/build_defs/pkg:pkg.bzl", "pkg_tar")

# .tar archive of dependencies used for bootstrapping.
pkg_tar(
    name = "bootstrap_autocodec",
    # The .jar files are created within the .tar file under third_party/bazel_bootstrap so that
    # they will appear there in bazel-distfile, which in turn makes them visible for bootstrapping
    # from the LIBRARY_JARS rule of bazel/scripts/bootstrap/compile.sh.
    files = {
        ":libautocodec-annotation.jar": "third_party/bazel_bootstrap/libautocodec-annotation.jar",
        ":libautocodec-util.jar": "third_party/bazel_bootstrap/libautocodec-util.jar",
        ":libfake-autocodec-processor.jar": "third_party/bazel_bootstrap/libfake-autocodec-processor.jar",
        "//src/main/java/com/google/devtools/build/lib/skyframe/serialization:libserialization.jar": "third_party/bazel_bootstrap/libserialization.jar",
    },
    visibility = ["//visibility:public"],
)