-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sbt
134 lines (124 loc) · 4.13 KB
/
build.sbt
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
lazy val V = _root_.scalafix.sbt.BuildInfo
lazy val rulesCrossVersions = Seq(V.scala213, V.scala212)
lazy val scala3Version = "3.3.0"
ThisBuild / scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVersion.value)
ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.6.0"
ThisBuild / scalafixDependencies += "com.sandinh" %% "scala-rewrites" % "1.1.0-M1"
inThisBuild(
List(
organization := "net.pixiv",
homepage := Some(url("https://github.com/pixiv/scalafix-pixiv-rule")),
licenses := List(
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")
),
developers := List(
Developer(
"Javakky-pxv",
"Kazuma Iemura",
url("https://github.com/Javakky-pxv")
)
),
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
scalaVersion := "2.13.11",
sonatypeCredentialHost := "s01.oss.sonatype.org",
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"
)
)
lazy val `scalafix-rule-pixiv` = (project in file("."))
.aggregate(
rules.projectRefs ++
input.projectRefs ++
output.projectRefs ++
tests.projectRefs: _*
)
.settings(
publish / skip := true
)
lazy val src = (project in file("rules"))
.settings(
libraryDependencies ++= Seq(
"ch.epfl.scala" %% "scalafix-core" % V.scalafixVersion,
"org.scalatest" %% "scalatest" % "3.2.16"
),
scalacOptions ++= Seq(
"-deprecation",
"-feature",
"-Ywarn-unused:imports,locals,patvars"
),
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
publish / skip := true,
licenseReportTitle := "NOTICE",
licenseReportDir := `scalafix-rule-pixiv`.base,
licenseReportTypes := Seq(MarkDown)
)
lazy val rules = projectMatrix
.settings(
moduleName := "scalafix-pixiv-rule",
libraryDependencies ++= Seq(
"ch.epfl.scala" %% "scalafix-core" % V.scalafixVersion,
"org.scalatest" %% "scalatest" % "3.2.16"
)
)
.defaultAxes(VirtualAxis.jvm)
.jvmPlatform(rulesCrossVersions)
lazy val input = projectMatrix
.settings(
publish / skip := true,
libraryDependencies ++= Seq(
"org.mockito" % "mockito-core" % "5.4.0",
"org.scalatest" %% "scalatest" % "3.2.16",
"javax.inject" % "javax.inject" % "1"
)
)
.defaultAxes(VirtualAxis.jvm)
.jvmPlatform(scalaVersions = rulesCrossVersions :+ scala3Version)
lazy val output = projectMatrix
.settings(
publish / skip := true,
libraryDependencies ++= Seq(
"org.mockito" % "mockito-core" % "5.4.0",
"org.scalatest" %% "scalatest" % "3.2.16",
"jakarta.inject" % "jakarta.inject-api" % "2.0.1"
)
)
.defaultAxes(VirtualAxis.jvm)
.jvmPlatform(scalaVersions = rulesCrossVersions :+ scala3Version)
lazy val testsAggregate = Project("tests", file("target/testsAggregate"))
.aggregate(tests.projectRefs: _*)
lazy val tests = projectMatrix
.settings(
publish / skip := true,
libraryDependencies += "ch.epfl.scala" % "scalafix-testkit" % V.scalafixVersion % Test cross CrossVersion.full,
scalafixTestkitOutputSourceDirectories :=
TargetAxis
.resolve(output, Compile / unmanagedSourceDirectories)
.value,
scalafixTestkitInputSourceDirectories :=
TargetAxis
.resolve(input, Compile / unmanagedSourceDirectories)
.value,
scalafixTestkitInputClasspath :=
TargetAxis.resolve(input, Compile / fullClasspath).value,
scalafixTestkitInputScalacOptions :=
TargetAxis.resolve(input, Compile / scalacOptions).value,
scalafixTestkitInputScalaVersion :=
TargetAxis.resolve(input, Compile / scalaVersion).value
)
.defaultAxes(
rulesCrossVersions.map(VirtualAxis.scalaABIVersion) :+ VirtualAxis.jvm: _*
)
.customRow(
scalaVersions = Seq(V.scala213),
axisValues = Seq(TargetAxis(V.scala213), VirtualAxis.jvm),
settings = Seq()
)
.customRow(
scalaVersions = Seq(V.scala212),
axisValues = Seq(TargetAxis(V.scala212), VirtualAxis.jvm),
settings = Seq()
)
.dependsOn(rules)
.enablePlugins(ScalafixTestkitPlugin)