load("@rbs//kotlin/rules.rbs", "kotlin_binary", "kotlin_library", "kotlin_test", "kotlin_lint")
load("@rbs//oci/rules.rbs", "oci_image")
kotlin_library(
name = "springboot_lib",
srcs = glob(["src/main/kotlin/**/*.kt"]),
deps = ["@external://org_springframework_boot_spring_boot_starter_web:3.2.2"],
)
kotlin_binary(
name = "app",
srcs = glob(["src/main/kotlin/**/*.kt"]),
main = "com.example.springboot.ApplicationKt",
resources = ["src/main/resources/application.properties"],
deps = ["@external://org_springframework_boot_spring_boot_starter_web:3.2.2"],
javaopts = ["-Djava.awt.headless=true"],
)
kotlin_test(
name = "greeting_service_test",
srcs = [
"src/main/kotlin/com/example/springboot/GreetingService.kt",
"src/test/kotlin/com/example/springboot/GreetingServiceTest.kt",
],
deps = ["@external://org_springframework_boot_spring_boot_starter_web:3.2.2"],
args = ["--select-class=com.example.springboot.GreetingServiceTest"],
)
kotlin_lint(
name = "app_lint",
srcs = glob(["src/main/kotlin/**/*.kt"]),
)
oci_image(
name = "image",
binary = ":app",
base = "ubuntu:22.04",
env = {"JAVA_OPTS": "-Djava.awt.headless=true"},
tag = "kotlin-springboot-example:latest",
)