-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD
52 lines (46 loc) · 1.42 KB
/
BUILD
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
load("@aspect_bazel_lib//lib:tar.bzl", "tar")
load("@container_structure_test//:defs.bzl", "container_structure_test")
load("@rules_java//java:defs.bzl", "java_binary", "java_library", "java_test")
load("@rules_oci//oci:defs.bzl", "oci_image")
package(default_visibility = ["//visibility:public"])
java_library(
name = "flink-example-lib",
srcs = glob(["src/main/java/com/example/myproject/*.java"]),
deps = [
"@maven//:com_amazonaws_aws_kinesisanalytics_runtime",
"@maven//:com_google_guava_guava",
"@maven//:org_apache_flink_flink_connector_aws_kinesis_streams",
"@maven//:org_apache_flink_flink_connector_kinesis",
"@maven//:org_apache_flink_flink_core",
"@maven//:org_apache_flink_flink_streaming_java",
],
)
java_binary(
name = "flink-example",
main_class = "com.example.myproject.BasicStreamingJob",
runtime_deps = [":flink-example-lib"],
)
java_test(
name = "tests",
srcs = glob(["src/test/java/com/example/myproject/*.java"]),
test_class = "com.example.myproject.TestApp",
deps = [
":flink-example-lib",
"@maven//:com_google_guava_guava",
"@maven//:junit_junit",
],
)
tar(
name = "layer",
srcs = ["flink-example_deploy.jar"],
)
oci_image(
name = "image",
base = "@distroless_java",
entrypoint = [
"java",
"-jar",
"/flink-example-deploy.jar",
],
tars = [":layer"],
)