sbt/build.sbt

183 lines
5.9 KiB
Plaintext
Raw Normal View History

2014-12-18 13:57:05 +01:00
import Dependencies._
2015-08-20 06:18:02 +02:00
import Util._
import com.typesafe.tools.mima.core._, ProblemFilters._
2015-08-20 06:18:02 +02:00
def baseVersion: String = "1.0.0-M19"
2015-08-20 06:18:02 +02:00
def internalPath = file("internal")
2014-12-18 05:38:10 +01:00
def commonSettings: Seq[Setting[_]] = Seq(
scalaVersion := scala212,
2015-08-20 06:18:02 +02:00
// publishArtifact in packageDoc := false,
2014-12-18 05:38:10 +01:00
resolvers += Resolver.typesafeIvyRepo("releases"),
resolvers += Resolver.sonatypeRepo("snapshots"),
2016-12-06 16:34:03 +01:00
resolvers += Resolver.mavenLocal,
2015-08-20 06:18:02 +02:00
// concurrentRestrictions in Global += Util.testExclusiveRestriction,
2014-12-18 05:38:10 +01:00
testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"),
javacOptions in compile ++= Seq("-Xlint", "-Xlint:-serial"),
2016-12-22 17:50:53 +01:00
crossScalaVersions := Seq(scala211, scala212),
2016-12-23 04:30:45 +01:00
scalacOptions := {
val old = scalacOptions.value
scalaVersion.value match {
case sv if sv.startsWith("2.10") => old diff List("-Xfuture", "-Ywarn-unused", "-Ywarn-unused-import")
case _ => old ++ List("-Ywarn-unused", "-Ywarn-unused-import")
}
},
scalacOptions in console in Compile -= "-Ywarn-unused-import",
scalacOptions in console in Test -= "-Ywarn-unused-import",
2016-12-22 17:50:53 +01:00
mimaPreviousArtifacts := Set(), // Some(organization.value %% moduleName.value % "1.0.0"),
2015-09-04 07:48:44 +02:00
publishArtifact in Compile := true,
2016-05-11 17:30:40 +02:00
publishArtifact in Test := false
2014-12-18 05:38:10 +01:00
)
2015-08-20 06:18:02 +02:00
lazy val utilRoot: Project = (project in file(".")).
aggregate(
utilInterface, utilControl, utilCollection, utilApplyMacro, utilComplete,
2015-12-23 09:36:38 +01:00
utilLogging, utilRelation, utilLogic, utilCache, utilTracking, utilTesting,
utilScripted
2015-08-20 06:18:02 +02:00
).
settings(
2015-08-31 09:02:44 +02:00
inThisBuild(Seq(
2015-09-17 04:06:13 +02:00
git.baseVersion := baseVersion,
bintrayPackage := "util",
2015-08-31 09:02:44 +02:00
homepage := Some(url("https://github.com/sbt/util")),
description := "Util module for sbt",
2015-09-17 04:06:13 +02:00
scmInfo := Some(ScmInfo(url("https://github.com/sbt/util"), "git@github.com:sbt/util.git"))
2015-08-31 09:02:44 +02:00
)),
2015-08-20 06:18:02 +02:00
commonSettings,
name := "Util Root",
publish := {},
2015-08-31 09:19:51 +02:00
publishLocal := {},
2015-09-05 07:42:34 +02:00
publishArtifact in Compile := false,
publishArtifact in Test := false,
publishArtifact := false,
customCommands
)
2014-12-18 05:38:10 +01:00
// defines Java structures used across Scala versions, such as the API structures and relationships extracted by
// the analysis compiler phases and passed back to sbt. The API structures are defined in a simple
// format from which Java sources are generated by the datatype generator Projproject
2015-08-20 06:43:22 +02:00
lazy val utilInterface = (project in internalPath / "util-interface").
2014-12-18 05:38:10 +01:00
settings(
2015-08-20 06:18:02 +02:00
commonSettings,
javaOnlySettings,
2015-08-20 06:18:02 +02:00
name := "Util Interface",
exportJars := true
)
2015-08-20 06:43:22 +02:00
lazy val utilControl = (project in internalPath / "util-control").
2015-08-20 06:18:02 +02:00
settings(
commonSettings,
name := "Util Control"
2014-12-18 05:38:10 +01:00
)
2015-08-20 06:43:22 +02:00
lazy val utilCollection = (project in internalPath / "util-collection").
2015-09-04 23:40:48 +02:00
dependsOn(utilTesting % Test).
2014-12-18 05:38:10 +01:00
settings(
2015-09-04 23:40:48 +02:00
commonSettings,
Util.keywordsSettings,
name := "Util Collection",
libraryDependencies ++= Seq(sjsonnew)
2014-12-18 05:38:10 +01:00
)
2015-08-20 06:43:22 +02:00
lazy val utilApplyMacro = (project in internalPath / "util-appmacro").
2015-08-20 06:18:02 +02:00
dependsOn(utilCollection).
2014-12-18 05:38:10 +01:00
settings(
2015-09-04 23:40:48 +02:00
commonSettings,
2015-08-20 06:18:02 +02:00
name := "Util Apply Macro",
2014-12-18 13:57:05 +01:00
libraryDependencies += scalaCompiler.value
2014-12-18 05:38:10 +01:00
)
// Command line-related utilities.
2015-08-20 06:43:22 +02:00
lazy val utilComplete = (project in internalPath / "util-complete").
2015-09-04 23:40:48 +02:00
dependsOn(utilCollection, utilControl, utilTesting % Test).
2014-12-18 05:38:10 +01:00
settings(
2015-09-04 23:40:48 +02:00
commonSettings,
2015-08-20 06:18:02 +02:00
name := "Util Completion",
libraryDependencies += jline
).
configure(addSbtIO)
2014-12-18 05:38:10 +01:00
// logging
2015-08-20 06:43:22 +02:00
lazy val utilLogging = (project in internalPath / "util-logging").
enablePlugins(ContrabandPlugin, JsonCodecPlugin).
dependsOn(utilInterface, utilCollection, utilTesting % Test).
2014-12-18 05:38:10 +01:00
settings(
2015-09-04 23:40:48 +02:00
commonSettings,
2016-12-23 04:30:45 +01:00
crossScalaVersions := Seq(scala210, scala211, scala212),
2015-08-20 06:18:02 +02:00
name := "Util Logging",
libraryDependencies ++= Seq(jline, log4jApi, log4jCore, disruptor, sjsonnewScalaJson, scalaReflect.value),
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala"
)
2014-12-18 05:38:10 +01:00
// Relation
2015-08-20 06:43:22 +02:00
lazy val utilRelation = (project in internalPath / "util-relation").
2015-09-04 23:40:48 +02:00
dependsOn(utilTesting % Test).
2014-12-18 05:38:10 +01:00
settings(
2015-09-04 23:40:48 +02:00
commonSettings,
2015-08-20 06:18:02 +02:00
name := "Util Relation"
2014-12-18 05:38:10 +01:00
)
// A logic with restricted negation as failure for a unique, stable model
2015-08-20 06:43:22 +02:00
lazy val utilLogic = (project in internalPath / "util-logic").
2015-09-04 23:40:48 +02:00
dependsOn(utilCollection, utilRelation, utilTesting % Test).
2014-12-18 05:38:10 +01:00
settings(
2015-09-04 23:40:48 +02:00
commonSettings,
2015-08-20 06:18:02 +02:00
name := "Util Logic"
2014-12-18 05:38:10 +01:00
)
2016-06-27 15:27:42 +02:00
// Persisted caching based on sjson-new
2015-08-20 06:43:22 +02:00
lazy val utilCache = (project in internalPath / "util-cache").
2016-06-27 15:27:42 +02:00
dependsOn(utilCollection, utilTesting % Test).
2014-12-18 05:38:10 +01:00
settings(
2015-08-20 06:18:02 +02:00
commonSettings,
name := "Util Cache",
libraryDependencies ++= Seq(sjsonnew, scalaReflect.value),
2016-06-27 15:27:42 +02:00
libraryDependencies += sjsonnewScalaJson % Test
).
configure(addSbtIO)
2014-12-18 05:38:10 +01:00
// Builds on cache to provide caching for filesystem-related operations
2015-08-20 06:43:22 +02:00
lazy val utilTracking = (project in internalPath / "util-tracking").
2016-06-27 15:27:42 +02:00
dependsOn(utilCache, utilTesting % Test).
2014-12-18 05:38:10 +01:00
settings(
2015-08-20 06:18:02 +02:00
commonSettings,
name := "Util Tracking",
2016-06-27 15:27:42 +02:00
libraryDependencies += sjsonnewScalaJson % Test
).
configure(addSbtIO)
2015-09-04 23:40:48 +02:00
// Internal utility for testing
lazy val utilTesting = (project in internalPath / "util-testing").
settings(
commonSettings,
2016-12-23 04:30:45 +01:00
crossScalaVersions := Seq(scala210, scala211, scala212),
2015-09-04 23:40:48 +02:00
name := "Util Testing",
libraryDependencies ++= Seq(scalaCheck, scalatest)
).
configure(addSbtIO)
2015-09-05 07:42:34 +02:00
2015-12-23 09:36:38 +01:00
lazy val utilScripted = (project in internalPath / "util-scripted").
dependsOn(utilLogging).
settings(
commonSettings,
name := "Util Scripted",
libraryDependencies ++= {
2016-12-22 17:50:53 +01:00
scalaVersion.value match {
case sv if sv startsWith "2.11" => Seq(parserCombinator211)
case sv if sv startsWith "2.12" => Seq(parserCombinator211)
case _ => Seq()
}
2015-12-23 09:36:38 +01:00
}
).
configure(addSbtIO)
2015-12-23 09:36:38 +01:00
2015-09-05 07:42:34 +02:00
def customCommands: Seq[Setting[_]] = Seq(
commands += Command.command("release") { state =>
// "clean" ::
"so compile" ::
"so publishSigned" ::
"reload" ::
state
}
)