# Copyright 2010-2021, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#     * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library")
load("@com_google_protobuf//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("//bazel:stubs.bzl", "jspb_proto_library")

package(default_visibility = ["//visibility:public"])

proto_library(
    name = "commands_proto",
    srcs = [
        "commands.proto",
    ],
    deps = [
        ":candidate_window_proto",
        ":config_proto",
        ":engine_builder_proto",
        ":user_dictionary_storage_proto",
    ],
)

cc_proto_library(
    name = "commands_cc_proto",
    deps = [":commands_proto"],
)

jspb_proto_library(
    name = "commands_jspb_proto",
    deps = [":commands_proto"],
)

java_lite_proto_library(
    name = "candidate_window_java_proto_lite",
    deps = [":candidate_window_proto"],
)

java_lite_proto_library(
    name = "commands_java_proto_lite",
    deps = [":commands_proto"],
)

java_lite_proto_library(
    name = "config_java_proto_lite",
    deps = [":config_proto"],
)

java_lite_proto_library(
    name = "engine_builder_java_proto_lite",
    deps = [":engine_builder_proto"],
)

java_lite_proto_library(
    name = "user_dictionary_storage_java_proto_lite",
    deps = [":user_dictionary_storage_proto"],
)

proto_library(
    name = "config_proto",
    srcs = ["config.proto"],
)

cc_proto_library(
    name = "config_cc_proto",
    deps = [":config_proto"],
)

jspb_proto_library(
    name = "config_jspb_proto",
    deps = [":config_proto"],
)

proto_library(
    name = "renderer_proto",
    srcs = [
        "renderer_command.proto",
        "renderer_style.proto",
    ],
    deps = [":commands_proto"],
)

cc_proto_library(
    name = "renderer_cc_proto",
    deps = [":renderer_proto"],
)

proto_library(
    name = "candidate_window_proto",
    srcs = ["candidate_window.proto"],
)

cc_proto_library(
    name = "candidate_window_cc_proto",
    deps = [":candidate_window_proto"],
)

jspb_proto_library(
    name = "candidate_window_jspb_proto",
    deps = [":candidate_window_proto"],
)

proto_library(
    name = "state_proto",
    srcs = ["state.proto"],
    deps = [
        ":candidate_window_proto",
        ":commands_proto",
    ],
)

cc_proto_library(
    name = "state_cc_proto",
    deps = ["state_proto"],
)

proto_library(
    name = "user_dictionary_storage_proto",
    srcs = ["user_dictionary_storage.proto"],
)

cc_proto_library(
    name = "user_dictionary_storage_cc_proto",
    deps = [":user_dictionary_storage_proto"],
)

jspb_proto_library(
    name = "user_dictionary_storage_jspb_proto",
    deps = [":user_dictionary_storage_proto"],
)

proto_library(
    name = "segmenter_data_proto",
    srcs = ["segmenter_data.proto"],
)

cc_proto_library(
    name = "segmenter_data_cc_proto",
    deps = [":segmenter_data_proto"],
)

proto_library(
    name = "engine_builder_proto",
    srcs = ["engine_builder.proto"],
)

cc_proto_library(
    name = "engine_builder_cc_proto",
    deps = [":engine_builder_proto"],
)
