-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sbt
More file actions
128 lines (114 loc) · 4.15 KB
/
Copy pathbuild.sbt
File metadata and controls
128 lines (114 loc) · 4.15 KB
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
// Copyright (C) from 2022 The Play Framework Contributors <https://github.com/playframework>, 2011-2021 Lightbend Inc. <https://www.lightbend.com>
import BuildSettings._
import Dependencies._
import Generators._
import sbt.Keys.parallelExecution
import sbt._
import sbt.io.Path._
import org.scalafmt.sbt.ScalafmtPlugin
ThisBuild / scalacOptions ++= Seq(
"-encoding",
"utf-8",
"-release:21",
"-rewrite",
// "-Wunused:all",
// "-Werror",
"-deprecation"
)
ThisBuild / publishTo := Option(Resolver.file("file", new File(sys.props.getOrElse("publishTo", ""))))
lazy val StreamsProject = Project("Play-Streams", file("core/play-streams"))
.settings(playCommonSettings)
.settings(libraryDependencies ++= streamsDependencies)
lazy val PlayExceptionsProject = Project("Play-Exceptions", file("core/play-exceptions"))
.settings(playCommonSettings)
.settings(
autoScalaLibrary := false,
crossPaths := false
)
lazy val PlayProject = Project("Play", file("core/play"))
.settings(playCommonSettings)
.settings(
libraryDependencies ++= runtime(
scalaVersion.value
) ++ scalacheckDependencies ++ cookieEncodingDependencies :+
jimfs % Test,
(Compile / sourceGenerators) += Def
.task(
PlayVersion(
version.value,
scalaVersion.value,
sbtVersion.value,
Dependencies.pekkoVersion,
(Compile / sourceManaged).value
)
)
.taskValue
)
.dependsOn(PlayExceptionsProject, PlayConfiguration, StreamsProject)
lazy val PlayServerProject = Project("Play-Server", file("transport/server/play-server"))
.settings(playCommonSettings)
.settings(libraryDependencies ++= playServerDependencies)
.dependsOn(PlayProject)
lazy val PlayNettyServerProject = Project("Play-Netty-Server", file("transport/server/play-netty-server"))
.settings(playCommonSettings)
.settings(libraryDependencies ++= netty)
.dependsOn(PlayServerProject)
lazy val PlayLogback = Project("Play-Logback", file("core/play-logback"))
.settings(playCommonSettings)
.settings(
libraryDependencies += logback,
Test / parallelExecution := false,
Test / scalacOptions := (Test / scalacOptions).value.diff(Seq("-deprecation"))
)
.dependsOn(PlayProject)
lazy val PlayConfiguration = Project("Play-Configuration", file("core/play-configuration"))
.settings(playCommonSettings)
.settings(
libraryDependencies ++= Seq(typesafeConfig, slf4jApi) ++ specs2Deps.map(_ % Test),
(Test / parallelExecution) := false,
(Test / scalacOptions) := (Test / scalacOptions).value.diff(Seq("-deprecation"))
)
.dependsOn(PlayExceptionsProject)
// ----- Development-mode tooling (sbt-2 plugin + routes compiler) -----
lazy val SbtRoutesCompilerProject = PlaySbtProject("Sbt-Routes-Compiler", "dev-mode/routes-compiler")
.enablePlugins(SbtTwirl, Snapshot4sPlugin)
.settings(
libraryDependencies ++= routesCompilerDependencies,
TwirlKeys.templateFormats := Map("twirl" -> "play.routes.compiler.ScalaFormat")
)
lazy val SbtPluginProject = PlaySbtPluginProject("Sbt-Plugin", "dev-mode/sbt-plugin")
.enablePlugins(SbtPlugin, BuildInfoPlugin)
.settings(
buildInfoPackage := "lichess.play.sbt",
libraryDependencies ++= sbtDependencies,
(Compile / sourceGenerators) += Def.task {
PlayVersion(
version.value,
(SbtRoutesCompilerProject / scalaVersion).value,
sbtVersion.value,
Dependencies.pekkoVersion,
(Compile / sourceManaged).value
)
}.taskValue
)
.dependsOn(SbtRoutesCompilerProject, PlayExceptionsProject)
// Provides the ScriptedTools auto plugin used by the sbt-plugin scripted tests.
lazy val SbtScriptedToolsProject = PlaySbtPluginProject("Sbt-Scripted-Tools", "dev-mode/sbt-scripted-tools")
.enablePlugins(SbtPlugin)
.dependsOn(SbtPluginProject)
lazy val PlayFramework = Project("Play-Framework", file("."))
.settings(publish / skip := true)
.aggregate(
// runtime
PlayProject,
PlayNettyServerProject,
PlayServerProject,
PlayLogback,
PlayConfiguration,
PlayExceptionsProject,
StreamsProject,
// dev-mode tooling
SbtRoutesCompilerProject,
SbtPluginProject,
SbtScriptedToolsProject
)