Skip to content

Commit 6187a61

Browse files
committed
Demonstrate scalac plugins and compiler options.
1 parent ea49fd0 commit 6187a61

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

3rdparty/jvm/com/lihaoyi/BUILD

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
jvm_artifact(
2+
name="acyclic",
3+
group="com.lihaoyi",
4+
artifact="acyclic_2.13",
5+
version="0.2.1",
6+
packages=["acyclic.**"],
7+
)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[
2+
{
3+
"coord": {
4+
"group": "com.lihaoyi",
5+
"artifact": "acyclic_2.13",
6+
"version": "0.2.1",
7+
"packaging": "jar"
8+
},
9+
"directDependencies": [],
10+
"dependencies": [],
11+
"file_name": "com.lihaoyi_acyclic_2.13_0.2.1.jar",
12+
"file_digest": {
13+
"fingerprint": "4bc4656140ad5e4802fedcdbe920ec7c92dbebf5e76d1c60d35676a314481944",
14+
"serialized_bytes_length": 62534
15+
},
16+
"remote_url": null,
17+
"pants_address": null
18+
}
19+
]

BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
scalac_plugin(
2+
name="acyclic",
3+
artifact="3rdparty/jvm/com/lihaoyi:acyclic",
4+
)

pants.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,23 @@ backend_packages = [
1010
"pants.backend.experimental.java.lint.google_java_format",
1111
]
1212

13+
[javac]
14+
args = [
15+
"-deprecation",
16+
"-encoding UTF-8",
17+
]
18+
19+
[scalac]
20+
args = [
21+
"-deprecation",
22+
"-encoding UTF-8",
23+
# An option for the compiler plugin enabled below.
24+
"-P:acyclic:force",
25+
]
26+
# Globally enabled `scalac` plugins, which are defined as `scalac_plugin` targets. This one is
27+
# defined at the root of the repository.
28+
plugins_global = ["//:acyclic"]
29+
1330
[anonymous-telemetry]
1431
enabled = true
1532
repo_id = "79B3C35A-85A9-41A4-AAA8-04484F41A8F7"

0 commit comments

Comments
 (0)