forked from apicollective/apibuilder-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
177 lines (157 loc) · 6.31 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import scoverage.ScoverageKeys
name := "apibuilder-generator"
organization := "io.apibuilder.generator"
val scalaVer = "2.13.2"
scalaVersion in ThisBuild := scalaVer
lazy val generated = project
.in(file("generated"))
.enablePlugins(PlayScala)
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq(
ws,
"org.scalacheck" %% "scalacheck" % "1.14.3" % Test
),
scalacOptions += "-P:silencer:pathFilters=.*",
)
// TODO: lib will eventually be published as a jar if it turns out
// that we need it. For now it is here mostly for reference - hoping
// we end up not needing it.
lazy val lib = project
.in(file("lib"))
.dependsOn(generated % "compile; test->test")
.settings(commonSettings: _*)
lazy val generator = project
.in(file("generator"))
.dependsOn(scalaGenerator, rubyGenerator, javaGenerator, goGenerator, androidGenerator, kotlinGenerator, javaAwsLambdaPojos, postmanGenerator, csvGenerator)
.aggregate(scalaGenerator, rubyGenerator, javaGenerator, goGenerator, androidGenerator, kotlinGenerator, javaAwsLambdaPojos, postmanGenerator, csvGenerator)
.enablePlugins(PlayScala)
.settings(commonSettings: _*)
.settings(
routesImport += "io.apibuilder.generator.v0.Bindables.Core._",
routesImport += "io.apibuilder.generator.v0.Bindables.Models._",
routesGenerator := InjectedRoutesGenerator,
libraryDependencies ++= Seq(
ws,
"org.scalatestplus.play" %% "scalatestplus-play" % "5.0.0" % "test"
),
scalacOptions += "-P:silencer:pathFilters=target/.*"
)
lazy val javaAwsLambdaPojos = project
.in(file("java-aws-lambda-pojos"))
.dependsOn(lib, lib % "test->test")
.settings(commonSettings: _*)
.settings(
Seq(ScoverageKeys.coverageMinimum := 69.5),
libraryDependencies ++= Seq(
"com.amazonaws" % "aws-java-sdk-dynamodb" % "1.11.461",
"me.geso" % "tinyvalidator" % "0.9.1",
"org.projectlombok" % "lombok" % "1.18.4"
)
)
lazy val scalaGenerator = project
.in(file("scala-generator"))
.dependsOn(lib, lib % "test->test")
.settings(commonSettings: _*)
.settings(
Seq(ScoverageKeys.coverageMinimum := 85.4),
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % "2.1.1",
"org.scalameta" %% "scalafmt-core" % "2.3.2"
)
)
lazy val rubyGenerator = project
.in(file("ruby-generator"))
.dependsOn(lib, lib % "test->test")
.settings(commonSettings: _*)
.settings(Seq(ScoverageKeys.coverageMinimum := 86.5))
lazy val javaGenerator = project
.in(file("java-generator"))
.dependsOn(lib, lib % "test->test")
.settings(commonSettings: _*)
.settings(Seq(ScoverageKeys.coverageMinimum := 66.98))
lazy val goGenerator = project
.in(file("go-generator"))
.dependsOn(lib, lib % "test->test")
.settings(commonSettings: _*)
lazy val androidGenerator = project
.in(file("android-generator"))
.dependsOn(lib, lib % "test->test")
.settings(
commonSettings: _*
)
.settings(Seq(ScoverageKeys.coverageMinimum := 76.90))
val kotlinLangVersion = "1.3.72"
val mockitoVersion = "3.5.5"
val scalatestVersion = "3.2.0"
lazy val kotlinGenerator = project
.in(file("kotlin-generator"))
.dependsOn(lib, lib % "test->test")
.settings(
fork in Test := true,
baseDirectory in Test := file("."),
libraryDependencies ++= Seq(
"com.fasterxml.jackson.module" % "jackson-module-kotlin" % "2.9.9",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9",
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.9",
"org.threeten" % "threetenbp" % "1.3.8",
"com.squareup" % "kotlinpoet" % "1.3.0",
"com.squareup.retrofit2" % "retrofit" % "2.5.0",
"com.jakewharton.retrofit" % "retrofit2-rxjava2-adapter" % "1.0.0",
"org.jetbrains.kotlin" % "kotlin-stdlib" % kotlinLangVersion % "test",
"org.jetbrains.kotlin" % "kotlin-stdlib-jdk8" % kotlinLangVersion % "test",
"org.jetbrains.kotlin" % "kotlin-reflect" % kotlinLangVersion % "test",
"org.jetbrains.kotlin" % "kotlin-compiler" % kotlinLangVersion % "test",
"io.github.sullis" % "kotlin-compiler-util" % "0.0.2" % "test",
"org.scalatest" %% "scalatest" % scalatestVersion % "test",
"org.mockito" % "mockito-core" % mockitoVersion % "test"
)
)
.settings(Seq(ScoverageKeys.coverageMinimum := 94.5, ScoverageKeys.coverageFailOnMinimum := true))
lazy val csvGenerator = project
.in(file("csv-generator"))
.dependsOn(lib, lib % "test->test")
.settings(
fork in Test := true,
baseDirectory in Test := file("."),
libraryDependencies ++= Seq(
"org.apache.commons" % "commons-csv" % "1.7"
)
)
.settings(Seq(ScoverageKeys.coverageMinimum := 75.67, ScoverageKeys.coverageFailOnMinimum := true))
lazy val postmanGenerator = project
.in(file("postman-generator"))
.dependsOn(lib, lib % "test->test")
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq(
"com.lihaoyi" %% "ammonite-ops" % "2.0.4",
)
)
lazy val commonSettings: Seq[Setting[_]] = Seq(
name ~= ("apibuilder-generator-" + _),
organization := "io.apibuilder",
ScoverageKeys.coverageFailOnMinimum := true,
testOptions += Tests.Argument("-oF"),
libraryDependencies ++= Seq(
"org.atteo" % "evo-inflector" % "1.2.2",
"com.squareup.retrofit2" % "retrofit" % "2.5.0",
"io.reactivex.rxjava2" % "rxjava" % "2.2.4",
"org.scalatestplus.play" %% "scalatestplus-play" % "5.0.0" % Test,
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
"org.scalatestplus" %% "scalatestplus-scalacheck" % "3.1.0.0-RC2" % Test,
"org.mockito" % "mockito-core" % mockitoVersion % Test,
"com.github.javaparser" % "javaparser-core" % "3.16.1" % Test,
"org.scalameta" %% "scalameta" % "4.3.20" % Test,
"com.squareup" % "javapoet" % "1.12.1",
compilerPlugin("com.github.ghik" % "silencer-plugin" % "1.6.0" cross CrossVersion.full),
"com.github.ghik" % "silencer-lib" % "1.6.0" % Provided cross CrossVersion.full,
),
libraryDependencies += guice,
scalacOptions ++= Seq("-feature", "-Ycache-plugin-class-loader:last-modified", "-Ycache-macro-class-loader:last-modified"),
scalacOptions += s"-P:silencer:sourceRoots=${baseDirectory.value.getCanonicalPath}",
sources in(Compile, doc) := Seq.empty,
publishArtifact in(Compile, packageDoc) := false,
)
version := "0.8.90"