|
1 |
| -"""Test targets to ensure dependency version compatibility. |
| 1 | +"""Test targets to ensure dependency version compatibility.""" |
2 | 2 |
|
3 |
| -Copied and adapted targets from the main repo as noted. |
4 |
| -""" |
5 |
| -load( |
6 |
| - ":defs.bzl", |
7 |
| - "default_outputs_test", |
8 |
| - "scalafmt_scala_test", |
9 |
| - "scrooge_transitive_outputs_test", |
10 |
| -) |
11 |
| -load("@rules_java//java:defs.bzl", "java_library") |
12 |
| -load("@rules_proto//proto:defs.bzl", "proto_library") |
13 |
| -load("@rules_scala//jmh:jmh.bzl", "scala_benchmark_jmh") |
14 |
| -load("@rules_scala//scala/scalafmt:phase_scalafmt_ext.bzl", "ext_scalafmt") |
15 |
| -load("@rules_scala//scala:advanced_usage/scala.bzl", "make_scala_test") |
16 |
| -load( |
17 |
| - "@rules_scala//scala:scala.bzl", |
18 |
| - "scala_binary", |
19 |
| - "scala_doc", |
20 |
| - "scala_junit_test", |
21 |
| - "scala_library", |
22 |
| - "scala_specs2_junit_test", |
23 |
| - "scala_test", |
24 |
| -) |
25 |
| -load("@rules_scala//scala_proto:scala_proto.bzl", "scala_proto_library") |
26 |
| -load("@rules_scala//thrift:thrift.bzl", "thrift_library") |
27 |
| -load( |
28 |
| - "@rules_scala//twitter_scrooge:twitter_scrooge.bzl", |
29 |
| - "scrooge_java_library", |
30 |
| - "scrooge_scala_library", |
31 |
| -) |
32 |
| - |
33 |
| -# From: `test/BUILD` |
34 |
| -scala_binary( |
35 |
| - name = "ScalaBinary", |
36 |
| - srcs = ["ScalaBinary.scala"], |
37 |
| - main_class = "scalarules.test.ScalaBinary", |
38 |
| - deps = [ |
39 |
| - ":HelloLib", |
40 |
| - ], |
41 |
| -) |
42 |
| - |
43 |
| -scala_library( |
44 |
| - name = "HelloLib", |
45 |
| - srcs = ["HelloLib.scala"], |
46 |
| -) |
47 |
| - |
48 |
| -scala_doc( |
49 |
| - name = "ScalaDoc", |
50 |
| - deps = [":HelloLib"], |
51 |
| -) |
52 |
| - |
53 |
| -# From: `examples/testing/multi_frameworks_toolchain/example/BUILD` |
54 |
| -scala_test( |
55 |
| - name = "scalatest_example", |
56 |
| - srcs = ["ScalaTestExampleTest.scala"], |
57 |
| -) |
| 3 | +load(":defs.bzl", "scalafmt_scala_test") |
58 | 4 |
|
59 |
| -scala_specs2_junit_test( |
60 |
| - name = "specs2_example", |
61 |
| - srcs = ["Specs2ExampleTest.scala"], |
62 |
| - suffixes = ["Test"], |
63 |
| -) |
64 |
| - |
65 |
| -# Manufactured based on `docs/phase_scalafmt.md` and `test/scalafmt/BUILD`. |
| 5 | +# Based on `docs/phase_scalafmt.md`, `test/scalafmt/BUILD`, and a copy of: |
| 6 | +# examples/testing/multi_frameworks_toolchain/example/ScalaTestExampleTest.scala |
66 | 7 | scalafmt_scala_test(
|
67 | 8 | name = "ScalafmtTest",
|
68 | 9 | srcs = ["ScalaTestExampleTest.scala"],
|
69 | 10 | format = True,
|
70 | 11 | )
|
71 |
| - |
72 |
| -# From: `test/proto/BUILD` |
73 |
| -proto_library( |
74 |
| - name = "standalone_proto", |
75 |
| - srcs = ["standalone.proto"], |
76 |
| -) |
77 |
| - |
78 |
| -scala_proto_library( |
79 |
| - name = "standalone_scala_proto", |
80 |
| - deps = [":standalone_proto"], |
81 |
| -) |
82 |
| - |
83 |
| -default_outputs_test( |
84 |
| - name = "standalone_scala_proto_outs_test", |
85 |
| - expected_outs = [ |
86 |
| - "standalone_proto_scalapb-src.jar", |
87 |
| - "standalone_proto_scalapb.jar", |
88 |
| - ], |
89 |
| - target_under_test = ":standalone_scala_proto", |
90 |
| -) |
91 |
| - |
92 |
| -# From: `test/jmh/BUILD` |
93 |
| -java_library( |
94 |
| - name = "java_type", |
95 |
| - srcs = ["JavaType.java"], |
96 |
| - visibility = ["//visibility:public"], |
97 |
| -) |
98 |
| - |
99 |
| -scala_library( |
100 |
| - name = "scala_type", |
101 |
| - srcs = ["ScalaType.scala"], |
102 |
| - visibility = ["//visibility:public"], |
103 |
| -) |
104 |
| - |
105 |
| -scala_library( |
106 |
| - name = "add_numbers", |
107 |
| - srcs = ["AddNumbers.scala"], |
108 |
| - visibility = ["//visibility:public"], |
109 |
| - exports = [ |
110 |
| - ":java_type", |
111 |
| - ":scala_type", |
112 |
| - ], |
113 |
| - deps = [ |
114 |
| - ":java_type", |
115 |
| - ":scala_type", |
116 |
| - ], |
117 |
| -) |
118 |
| - |
119 |
| -scala_benchmark_jmh( |
120 |
| - name = "test_benchmark", |
121 |
| - srcs = ["TestBenchmark.scala"], |
122 |
| - data = ["data.txt"], |
123 |
| - deps = [":add_numbers"], |
124 |
| -) |
125 |
| - |
126 |
| -# From: `test/src/main/scala/scalarules/test/twitter_scrooge/BUILD` |
127 |
| - |
128 |
| -thrift_library( |
129 |
| - name = "thrift3", |
130 |
| - srcs = ["Thrift3.thrift"], |
131 |
| - visibility = ["//visibility:public"], |
132 |
| -) |
133 |
| - |
134 |
| -scrooge_scala_library( |
135 |
| - name = "scrooge3", |
136 |
| - visibility = ["//visibility:public"], |
137 |
| - deps = [":thrift3"], |
138 |
| -) |
139 |
| - |
140 |
| -scrooge_java_library( |
141 |
| - name = "scrooge3_java", |
142 |
| - visibility = ["//visibility:public"], |
143 |
| - deps = [":thrift3"], |
144 |
| -) |
145 |
| - |
146 |
| -scrooge_transitive_outputs_test( |
147 |
| - name = "scrooge_test_scala", |
148 |
| - dep = ":scrooge3", |
149 |
| - expected_jars = ["thrift3_scrooge_scala.jar"], |
150 |
| -) |
151 |
| - |
152 |
| -scrooge_transitive_outputs_test( |
153 |
| - name = "scrooge_test_java", |
154 |
| - dep = ":scrooge3_java", |
155 |
| - expected_jars = ["thrift3_scrooge_java.jar"], |
156 |
| -) |
0 commit comments