-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbuild.sbt
84 lines (80 loc) · 3.03 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
import Dependencies._
ThisBuild / version := "0.7.0-SNAPSHOT"
ThisBuild / organization := "org.scala-sbt"
ThisBuild / crossScalaVersions := Seq(scala213, scala212, scala3)
ThisBuild / scalaVersion := scala212
ThisBuild / organizationName := "sbt"
ThisBuild / organizationHomepage := Some(url("http://scala-sbt.org/"))
ThisBuild / homepage := Some(url("http://scala-sbt.org/contraband"))
ThisBuild / licenses += ("Apache-2.0", url("https://github.com/sbt/contraband/blob/master/LICENSE"))
ThisBuild / scmInfo := Some(ScmInfo(url("https://github.com/sbt/contraband"), "[email protected]:sbt/contraband.git"))
ThisBuild / developers := List(
Developer("eed3si9n", "Eugene Yokota", "@eed3si9n", url("https://github.com/eed3si9n")),
Developer("dwijnand", "Dale Wijnand", "@dwijnand", url("https://github.com/dwijnand")),
Developer("Duhemm", "Martin Duhem", "@Duhemm", url("https://github.com/Duhemm"))
)
ThisBuild / description := "Contraband is a description language for your datatypes and APIs, currently targeting Java and Scala."
Global / semanticdbEnabled := true
Global / semanticdbVersion := "4.10.1"
ThisBuild / scalacOptions ++= {
scalaBinaryVersion.value match {
case "2.12" =>
Seq("-Xsource:3")
case "2.13" =>
Seq("-Xsource:3-cross")
case _ =>
Nil
}
}
ThisBuild / publishMavenStyle := true
lazy val root = (project in file("."))
.enablePlugins(TravisSitePlugin)
.aggregate(library, plugin)
.settings(
name := "contraband root",
siteGithubRepo := "sbt/contraband",
siteEmail := { "eed3si9n" + "@" + "gmail.com" },
publish / skip := true,
crossScalaVersions := Nil,
)
lazy val library = (project in file("library"))
.enablePlugins(KeywordPlugin, SonatypePublish)
.settings(
name := "contraband",
Compile / unmanagedSourceDirectories += {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v <= 12 =>
baseDirectory.value / "src/main/scala-2.13-"
case _ =>
baseDirectory.value / "src/main/scala-2.13+"
}
},
testFrameworks += new TestFramework("verify.runner.Framework"),
libraryDependencies ++= Seq(parboiled, sjsonNewScalaJson) ++ Seq(verify % Test, scalaTest % Test, diffutils % Test)
)
lazy val plugin = (project in file("plugin"))
.enablePlugins(SbtPlugin, SonatypePublish)
.dependsOn(library)
.settings(
name := "sbt-contraband",
description := "sbt plugin to generate growable datatypes.",
scriptedLaunchOpts := {
scriptedLaunchOpts.value ++
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
},
crossScalaVersions := Seq(scala212, scala3),
pluginCrossBuild / sbtVersion := {
scalaBinaryVersion.value match {
case "2.13" => "1.5.8"
case "2.12" => "1.5.8" // set minimum sbt version
case _ => "2.0.0-M3"
}
},
scriptedSbt := {
scalaBinaryVersion.value match {
case "2.12" => "1.10.7"
case _ => "2.0.0-M3"
}
},
publishLocal := (publishLocal dependsOn (library / publishLocal)).value,
)