-
-
Notifications
You must be signed in to change notification settings - Fork 108
/
Common.scala
75 lines (63 loc) · 1.86 KB
/
Common.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
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
/*
* Copyright (C) from 2022 The Play Framework Contributors <https://github.com/playframework>, 2011-2021 Lightbend Inc. <https://www.lightbend.com>
*/
import sbt.Keys._
import sbt._
import sbt.plugins.JvmPlugin
import Dependencies._
object Common extends AutoPlugin {
override def trigger = noTrigger
override def requires = JvmPlugin
val repoName = "twirl"
val javacParameters = Seq(
"-encoding",
"UTF-8",
"-Xlint:-options",
"--release",
"11",
"-Xlint:deprecation",
"-Xlint:unchecked"
)
val scalacParameters = Seq(
"-deprecation",
"-feature",
"-unchecked",
"-encoding",
"utf8"
)
def crossScalacOptions(version: String) = {
CrossVersion.partialVersion(version) match {
case Some((2, n)) if n < 12 =>
scalacParameters ++ Seq(
"-release:11",
"-Ywarn-unused:imports",
"-Xlint:nullary-unit",
"-Xlint",
"-Ywarn-dead-code"
)
case _ => scalacParameters
}
}
override def projectSettings =
Seq(
scalaVersion := Scala212,
crossScalaVersions := ScalaVersions,
scalacOptions ++= crossScalacOptions(scalaVersion.value),
javacOptions ++= javacParameters
)
override def globalSettings =
Seq(
organization := "org.playframework.twirl",
organizationName := "The Play Framework Project",
organizationHomepage := Some(url("https://playframework.com/")),
homepage := Some(url(s"https://github.com/playframework/${repoName}")),
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")),
developers += Developer(
"playframework",
"The Play Framework Contributors",
"contact@playframework.com",
url("https://github.com/playframework")
),
description := "Twirl"
)
}