aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/BUILD
blob: 8653eb5e462852918a5be6a5762650b629690bee (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
87
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",
        # Generated classes have the following dependencies.
        ":registered-singleton",
        ":unsafe-provider",
        "//third_party/protobuf:protobuf_java",
        "//src/main/java/com/google/devtools/build/lib/skyframe/serialization",
    ],
)

java_library(
    name = "registered-singleton",
    srcs = ["RegisteredSingletonDoNotUse.java"],
)

# @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",
    ],
)

java_library(
    name = "unsafe-provider",
    srcs = ["UnsafeProvider.java"],
)

# @AutoCodec annotation processor implementation.
java_library(
    name = "autocodec-processor",
    srcs = [
        "AutoCodecProcessor.java",
        "AutoCodecUtil.java",
        "Marshallers.java",
        "SerializationCodeGenerator.java",
    ],
    deps = [
        ":autocodec-annotation",
        ":registered-singleton",
        ":unsafe-provider",
        "//src/main/java/com/google/devtools/build/lib/skyframe/serialization",
        "//third_party:auto_service",
        "//third_party:auto_value",
        "//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-processor.jar": "third_party/bazel_bootstrap/libautocodec-processor.jar",
        ":libregistered-singleton.jar": "third_party/bazel_bootstrap/libregistered-singleton.jar",
        ":libunsafe-provider.jar": "third_party/bazel_bootstrap/libunsafe-provider.jar",
        "//src/main/java/com/google/devtools/build/lib/skyframe/serialization:libserialization.jar": "third_party/bazel_bootstrap/libserialization.jar",
    },
    visibility = ["//visibility:public"],
)