sbt/build.sbt

174 lines
5.0 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._
2015-12-24 01:23:11 +01:00
def baseVersion: String = "0.1.0-M8"
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(
2015-09-17 03:07:41 +02:00
scalaVersion := scala211,
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"),
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("-target", "6", "-source", "6", "-Xlint", "-Xlint:-serial"),
2015-08-31 09:02:44 +02:00
crossScalaVersions := Seq(scala210, scala211),
scalacOptions ++= Seq(
"-encoding", "utf8",
"-deprecation",
"-feature",
"-unchecked",
"-Xlint",
"-language:higherKinds",
"-language:implicitConversions",
// "-Xfuture",
"-Yinline-warnings",
// "-Yfatal-warnings",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard"),
2015-09-04 07:48:44 +02:00
publishArtifact in Compile := true,
publishArtifact in Test := true
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"
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",
2015-09-05 07:42:34 +02:00
libraryDependencies ++= Seq(jline, sbtIO)
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").
2015-09-04 23:40:48 +02:00
dependsOn(utilInterface, utilTesting % Test).
2014-12-18 05:38:10 +01:00
settings(
2015-09-04 23:40:48 +02:00
commonSettings,
publishArtifact in (Test, packageBin) := true,
2015-08-20 06:18:02 +02:00
name := "Util Logging",
2014-12-18 13:57:05 +01:00
libraryDependencies += jline
)
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
)
// Persisted caching based on SBinary
2015-08-20 06:43:22 +02:00
lazy val utilCache = (project in internalPath / "util-cache").
2015-08-20 06:18:02 +02:00
dependsOn(utilCollection).
2014-12-18 05:38:10 +01:00
settings(
2015-08-20 06:18:02 +02:00
commonSettings,
name := "Util Cache",
2015-08-31 01:51:03 +02:00
libraryDependencies ++= Seq(sbinary, sbtSerialization, scalaReflect.value, sbtIO) ++ scalaXml.value
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").
2015-08-20 06:18:02 +02:00
dependsOn(utilCache).
2014-12-18 05:38:10 +01:00
settings(
2015-08-20 06:18:02 +02:00
commonSettings,
name := "Util Tracking",
libraryDependencies += sbtIO
2014-12-18 05:38:10 +01:00
)
2015-09-04 23:40:48 +02:00
// Internal utility for testing
lazy val utilTesting = (project in internalPath / "util-testing").
settings(
commonSettings,
name := "Util Testing",
libraryDependencies ++= Seq(scalaCheck, scalatest)
)
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 += sbtIO,
libraryDependencies ++= {
if (scalaVersion.value startsWith "2.11") Seq(parserCombinator211)
else Seq()
}
)
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
}
)