-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
80 lines (71 loc) · 2.74 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
import sbt.Defaults.sbtPluginExtra
import sbtrelease.ReleaseStateTransformations.{setReleaseVersion, _}
import com.twitter.scrooge.{ScroogeConfig, Compiler}
import sbt.url
import sbtversionpolicy.withsbtrelease.ReleaseVersion
name := "scrooge-extras"
ThisBuild / organization := "com.gu"
ThisBuild / scalaVersion := "2.12.18"
ThisBuild / licenses := Seq(License.Apache2)
ThisBuild / scalacOptions := Seq("-release:11")
val scroogeVersion = "22.7.0" // remember to also update plugins.sbt if this version changes
lazy val artifactProductionSettings = Seq(
organization := "com.gu",
Test / testOptions +=
Tests.Argument(TestFrameworks.ScalaTest, "-u", s"test-results/scala-${scalaVersion.value}", "-o"),
resolvers ++= Resolver.sonatypeOssRepos("public")
)
lazy val sbtScroogeTypescript = project.in(file("sbt-scrooge-typescript"))
.dependsOn(typescript)
.settings(artifactProductionSettings)
.settings(
name := "sbt-scrooge-typescript",
sbtPlugin := true,
// this plugin depends on the scrooge plugin
libraryDependencies += sbtPluginExtra(
"com.twitter" % "scrooge-sbt-plugin" % scroogeVersion,
(pluginCrossBuild / sbtBinaryVersion).value,
(update / scalaBinaryVersion).value
)
)
lazy val typescript = project.in(file("scrooge-generator-typescript"))
.settings(artifactProductionSettings)
.settings(
name := "scrooge-generator-typescript",
libraryDependencies ++= Seq(
"com.twitter" %% "scrooge-generator" % scroogeVersion,
"com.twitter" %% "scrooge-core" % scroogeVersion % "test",
"com.github.spullara.mustache.java" % "compiler" % "0.9.10",
"org.scalatest" %% "scalatest" % "3.2.14" % "test",
//Update vulnerable dependencies
"org.codehaus.plexus" % "plexus-utils" % "3.5.0",
"org.apache.thrift" % "libthrift" % "0.17.0"
),
Test / sourceGenerators += { () =>
val scroogeConfig = ScroogeConfig(
destFolder = ((Compile / sourceManaged).value / "generated").getAbsolutePath,
thriftFiles = ((Test / resourceDirectory).value / "school" ** "*.thrift").get().map(_.getAbsolutePath).toList,
language = "scala"
)
val compiler = new Compiler(scroogeConfig)
compiler.run()
((Compile / sourceManaged).value / "generated" ** "*.scala").get()
}
)
lazy val root = Project(id = "root", base = file("."))
.aggregate(sbtScroogeTypescript, typescript)
.settings(
publish / skip := true,
releaseVersion := ReleaseVersion.fromAggregatedAssessedCompatibilityWithLatestRelease().value,
releaseProcess := Seq(
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
setNextVersion,
commitNextVersion
)
)