load("//common:defs.bzl", "copy_file")
load("//java:defs.bzl", "java_export")
load("//java:version.bzl", "SE_VERSION")

java_export(
    name = "manager",
    srcs = glob(["*.java"]),
    maven_coordinates = "org.seleniumhq.selenium:selenium-manager:%s" % SE_VERSION,
    opens_to = [
        "org.seleniumhq.selenium.json",
    ],
    pom_template = "//java/src/org/openqa/selenium:template-pom",
    resources = [
        ":manager-linux",
        ":manager-macos",
        ":manager-windows",
    ],
    tags = [
        "release-artifact",
    ],
    visibility = [
        "//visibility:public",
    ],
    deps = [
        "//java/src/org/openqa/selenium:core",
        "//java/src/org/openqa/selenium/json",
        "//java/src/org/openqa/selenium/os",
    ],
)

copy_file(
    name = "manager-linux",
    src = "//common/manager:selenium-manager-linux",
    out = "linux/selenium-manager",
)

copy_file(
    name = "manager-macos",
    src = "//common/manager:selenium-manager-macos",
    out = "macos/selenium-manager",
)

copy_file(
    name = "manager-windows",
    src = "//common/manager:selenium-manager-windows",
    out = "windows/selenium-manager.exe",
)
