File tree Expand file tree Collapse file tree
main/kotlin/hs/kr/entrydsm
test/kotlin/hs/kr/entrydsm Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ load ("@rules_kotlin//kotlin:jvm.bzl" , "kt_jvm_binary" , "kt_jvm_test" )
2+ load ("//:kotlin.bzl" , "setup_kotlin_compiler" , "setup_spring_allopen_plugin" )
3+ load ("//module-a:deps.bzl" , "MODULE_DEPS" , "TEST_DEPS" )
4+
5+ package (default_visibility = ["//visibility:public" ])
6+
7+ setup_kotlin_compiler ()
8+ setup_spring_allopen_plugin ()
9+
10+ kt_jvm_binary (
11+ name = "main" ,
12+ srcs = glob (["src/main/kotlin/**/*.kt" ]),
13+ main_class = "hs.kr.entrydsm.example.ExampleApplicationKt" ,
14+ plugins = ["//:spring_allopen" ],
15+ deps = MODULE_DEPS ,
16+ javac_opts = "//:javac_options" ,
17+ kotlinc_opts = "//:kotlinc_options" ,
18+ )
19+
20+ kt_jvm_test (
21+ name = "test" ,
22+ srcs = glob (["src/test/kotlin/**/*.kt" ]),
23+ test_class = "hs.kr.entrydsm.example.ExampleApplicationTest" ,
24+ plugins = ["//:spring_allopen" ],
25+ deps = MODULE_DEPS + TEST_DEPS ,
26+ javac_opts = "//:javac_options" ,
27+ kotlinc_opts = "//:kotlinc_options" ,
28+ )
Original file line number Diff line number Diff line change 1+ SPRING_DEPS = [
2+ "@maven//:org_springframework_boot_spring_boot_starter_web" ,
3+ "@maven//:org_springframework_boot_spring_boot_starter_actuator" ,
4+ ]
5+
6+ KOTLIN_DEPS = [
7+ "@maven//:org_jetbrains_kotlin_kotlin_reflect" ,
8+ "@maven//:com_fasterxml_jackson_module_jackson_module_kotlin" ,
9+ ]
10+
11+ TEST_DEPS = [
12+ "@maven//:org_springframework_boot_spring_boot_starter_test" ,
13+ "@maven//:junit_junit" ,
14+ ]
15+
16+ MODULE_DEPS = SPRING_DEPS + KOTLIN_DEPS
Original file line number Diff line number Diff line change 1+ package hs.kr.entrydsm.example
2+
3+ import org.springframework.boot.autoconfigure.SpringBootApplication
4+ import org.springframework.boot.runApplication
5+
6+ @SpringBootApplication
7+ class ExampleApplication
8+
9+ fun main (args : Array <String >) {
10+ runApplication<ExampleApplication >(* args)
11+ }
Original file line number Diff line number Diff line change 1+ package hs.kr.entrydsm.example
2+
3+ import org.junit.jupiter.api.Assertions.assertEquals
4+ import org.junit.jupiter.api.Test
5+
6+ class ExampleApplicationTest {
7+ @Test
8+ fun contextLoads () {
9+ // Spring Boot context loading test
10+ assertEquals(4 , 2 + 2 )
11+ }
12+ }
You can’t perform that action at this time.
0 commit comments