sbt/project/Settings.scala

75 lines
2.0 KiB
Scala
Raw Normal View History

2017-04-02 21:51:11 +02:00
import java.nio.file.Files
2017-04-02 21:51:11 +02:00
import sbt._
import sbt.Keys._
2017-10-26 14:53:18 +02:00
import sbt.ScriptedPlugin.autoImport.{sbtLauncher, scriptedBufferLog, ScriptedLaunchConf, scriptedLaunchOpts}
2017-04-02 21:51:11 +02:00
import com.typesafe.sbt.pgp._
import coursier.ShadingPlugin.autoImport._
import Aliases._
2017-05-15 15:32:47 +02:00
object Settings {
2017-04-02 21:51:11 +02:00
2018-09-28 17:55:42 +02:00
def scala212 = "2.12.7"
2017-04-02 21:51:11 +02:00
def sonatypeRepository(name: String) = {
2017-05-06 16:50:43 +02:00
resolvers += Resolver.sonatypeRepo(name)
2017-04-02 21:51:11 +02:00
}
2018-09-28 17:55:42 +02:00
lazy val shared = Publish.released ++ Seq(
2017-04-02 21:51:11 +02:00
organization := "io.get-coursier",
sonatypeRepository("releases"),
2018-09-28 17:55:42 +02:00
crossScalaVersions := Seq(scala212),
scalaVersion := scala212,
2018-03-12 11:18:19 +01:00
scalacOptions ++= Seq(
"-target:jvm-1.8",
"-feature",
"-deprecation",
"-language:higherKinds",
"-language:implicitConversions"
),
javacOptions ++= Seq(
"-source", "1.8",
"-target", "1.8"
),
2017-10-24 17:47:29 +02:00
javacOptions.in(Keys.doc) := Seq()
2017-04-02 21:51:11 +02:00
)
lazy val utest = Seq(
2018-09-28 17:55:42 +02:00
libs += Deps.utest % Test,
2017-04-02 21:51:11 +02:00
testFrameworks += new TestFramework("utest.runner.Framework")
)
2018-09-28 17:55:42 +02:00
def sbt10Version = "1.0.2"
2017-04-02 21:51:11 +02:00
lazy val plugin =
2018-09-28 17:55:42 +02:00
shared ++
withScriptedTests ++
2017-04-02 21:51:11 +02:00
Seq(
scriptedLaunchOpts ++= Seq(
"-Xmx1024M",
"-Dplugin.version=" + version.value,
"-Dsbttest.base=" + (sourceDirectory.value / "sbt-test").getAbsolutePath
),
scriptedBufferLog := false,
2018-09-28 17:55:42 +02:00
sbtPlugin := true,
sbtVersion.in(pluginCrossBuild) := sbt10Version
2017-04-02 21:51:11 +02:00
)
lazy val shading =
inConfig(_root_.coursier.ShadingPlugin.Shading)(PgpSettings.projectSettings) ++
2018-02-22 11:30:51 +01:00
// Why does this have to be repeated here?
2017-10-24 17:47:29 +02:00
// Can't figure out why configuration gets lost without this in particular...
2017-04-02 21:51:11 +02:00
_root_.coursier.ShadingPlugin.projectSettings ++
Seq(
shadingNamespace := "coursier.shaded",
publish := publish.in(Shading).value,
publishLocal := publishLocal.in(Shading).value,
PgpKeys.publishSigned := PgpKeys.publishSigned.in(Shading).value,
PgpKeys.publishLocalSigned := PgpKeys.publishLocalSigned.in(Shading).value
)
}