-
-
Notifications
You must be signed in to change notification settings - Fork 278
/
CommonProtos.scala
38 lines (33 loc) · 1.07 KB
/
CommonProtos.scala
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
package scalapb.docs
object CommonProtos {
def row(libName: String, version: String): String = {
s"""### $libName
|ScalaPB 0.10.x:
|```scala
|libraryDependencies ++= Seq(
| "com.thesamet.scalapb.common-protos" %% "${libName}-scalapb_0.10" % "${version}" % "protobuf",
| "com.thesamet.scalapb.common-protos" %% "${libName}-scalapb_0.10" % "${version}"
|)
|```
|ScalaPB 0.9.x:
|```scala
|libraryDependencies ++= Seq(
| "com.thesamet.scalapb.common-protos" %% "${libName}-scalapb_0.9" % "${version}" % "protobuf",
| "com.thesamet.scalapb.common-protos" %% "${libName}-scalapb_0.9" % "${version}"
|)
|```
|""".stripMargin
}
def header: String = ""
def footer: String = ""
def table: String = {
Seq(
("proto-google-common-protos", "2.5.0-0"),
("proto-google-cloud-pubsub-v1", "1.96.2-1"),
("pgv-proto", "0.6.1-0")
).map((row _).tupled).mkString(header, "", "footer")
}
def printTable(): Unit = {
println(table)
}
}