-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
build.sbt
125 lines (117 loc) · 3.5 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
import com.typesafe.tools.mima.core._
inThisBuild(
List(
scalaVersion := "2.12.20",
crossScalaVersions := Seq("2.12.20", "2.13.15", "3.3.4"),
scalacOptions ++= List("-release", "8"),
javacOptions ++= List("-target", "8", "-source", "8"),
organization := "com.thesamet.scalapb"
)
)
ThisBuild / versionScheme := Some("early-semver")
val protobufJava = "com.google.protobuf" % "protobuf-java" % "3.25.5"
val coursierVersion = "2.1.19"
lazy val bridge: Project = project
.in(file("bridge"))
.settings(
name := "protoc-bridge",
scalacOptions ++= (if (scalaVersion.value.startsWith("2.13."))
Seq("-deprecation", "-Xfatal-warnings")
else Nil),
libraryDependencies ++= Seq(
"dev.dirs" % "directories" % "26",
protobufJava % "provided",
protobufJava % "test",
"org.scalatestplus" %% "scalacheck-1-16" % "3.2.14.0" % "test",
"org.scalatest" %% "scalatest" % "3.2.19" % "test",
"org.scalacheck" %% "scalacheck" % "1.18.1" % "test",
"io.get-coursier" %% "coursier" % coursierVersion % "test" cross CrossVersion.for3Use2_13
),
conflictWarning := {
if (scalaBinaryVersion.value == "3") {
ConflictWarning("warn", Level.Warn, false)
} else {
conflictWarning.value
}
},
Test / testOptions ++= {
scalaBinaryVersion.value match {
case "2.12" =>
Nil
case _ =>
// TODO
Seq(
Tests.Exclude(
Set(
"protocbridge.codegen.CodeGenAppSpec",
"protocbridge.ProtocCacheSpec"
)
)
)
}
},
scalacOptions ++= (if (scalaVersion.value.startsWith("2.13."))
Seq("-Wconf:origin=.*JavaConverters.*:s")
else Nil),
mimaPreviousArtifacts := Set(
organization.value %% name.value % "0.9.0-RC2"
),
mimaBinaryIssueFilters ++= Seq(
ProblemFilters
.exclude[DirectMissingMethodProblem]("protocbridge.frontend.*"),
ProblemFilters.exclude[ReversedMissingMethodProblem](
"protocbridge.frontend.PluginFrontend.prepare"
)
)
)
lazy val protocCacheCoursier = project
.in(file("protoc-cache-coursier"))
.dependsOn(bridge)
.settings(
name := "protoc-cache-coursier",
conflictWarning := {
if (scalaBinaryVersion.value == "3") {
ConflictWarning("warn", Level.Warn, false)
} else {
conflictWarning.value
}
},
libraryDependencies ++= Seq(
"io.get-coursier" %% "coursier" % coursierVersion cross CrossVersion.for3Use2_13
)
)
lazy val protocGen = project
.in(file("protoc-gen"))
.dependsOn(bridge % "compile->compile;test->test")
.settings(
name := "protoc-gen",
conflictWarning := {
if (scalaBinaryVersion.value == "3") {
ConflictWarning("warn", Level.Warn, false)
} else {
conflictWarning.value
}
},
libraryDependencies ++= Seq(
protobufJava % "provided"
),
mimaPreviousArtifacts := Set(
organization.value %% name.value % "0.9.0-RC3"
),
mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[Problem]("protocgen.CodeGenRequest.*")
),
Test / unmanagedResourceDirectories ++= (bridge / Test / unmanagedResourceDirectories).value
)
lazy val root = project
.in(file("."))
.settings(
publishArtifact := false,
publish := {},
publishLocal := {}
)
.aggregate(
bridge,
protocGen,
protocCacheCoursier
)