-
Notifications
You must be signed in to change notification settings - Fork 264
/
BUILD
106 lines (90 loc) · 2.4 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
load("//scala:scala.bzl", "scala_binary", "scala_library", "scala_test", "scala_macro_library")
# The examples below show how to combine Scala and Java rules.
# ScalaBinary is the Scala equivalent of JavaBinary.
java_binary(
name = "JavaBinary",
srcs = ["JavaBinary.java"],
main_class = "scala.test.JavaBinary",
deps = [":lib_import"],
)
# TODO(bazel-team): Allow java rules to depend directly on scala_library.
# For now, we have to use a java_import proxy.
java_import(
name = "lib_import",
# these are the outputs of the scala_library targets
jars = [":HelloLib_deploy.jar",
"OtherLib_deploy.jar",
"Exported_deploy.jar",
"Runtime_deploy.jar",
],
runtime_deps = ["org_scala_lang__scala_library", "OtherJavaLib"]
)
java_import(
name = "org_scala_lang__scala_library",
jars = ["@scala//:lib/scala-library.jar"]
)
scala_binary(
name = "ScalaBinary",
srcs = ["ScalaBinary.scala"],
main_class = "scala.test.ScalaBinary",
deps = [":HelloLib", ":MacroTest"],
)
scala_library(
name = "HelloLib",
srcs = ["HelloLib.scala"],
deps = [
"OtherJavaLib",
"OtherLib",
"MacroTest"
],
)
scala_test(
name = "HelloLibTest",
size = "small", # Not a macro, can pass test-specific attributes.
srcs = ["HelloLibTest.scala"],
deps = [
":HelloLib",
],
)
scala_library(
name = "OtherLib",
srcs = ["OtherLib.scala"],
exports = ["ExportOnly"], # test of exported target
)
# Test of library without src
scala_library(
name = "ExportOnly",
exports = [ "Exported" ],
)
scala_library(
name = "Exported",
srcs = ["Exported.scala"],
runtime_deps = ["Runtime"],
)
scala_macro_library(
name = "MacroTest",
srcs = ["MacroTest.scala"]
)
scala_library(
name = "Runtime",
srcs = ["Runtime.scala"],
)
java_library(
name = "OtherJavaLib",
srcs = ["OtherJavaLib.java"],
)
scala_library(
name = "ScalaLibResources",
srcs = ["src/main/scala/scala/test/ScalaLibResources.scala"],
resources = ["src/main/resources/scala/test/hellos", "src/main/resources/scala/test/byes"],
)
scala_binary(
name = "ScalaLibBinary",
srcs = ["src/main/scala/scala/test/ScalaLibBinary.scala"],
main_class = "scala.test.ScalaLibBinary",
deps = ["ScalaLibResources"],
)
scala_library(
name = "jar_export",
exports = ["@com_twitter__scalding_date//jar"]
)