2014-12-18 13:57:05 +01:00
|
|
|
import Dependencies._
|
2015-08-20 06:18:02 +02:00
|
|
|
import Util._
|
2016-02-14 17:42:00 +01:00
|
|
|
import com.typesafe.tools.mima.core._, ProblemFilters._
|
2015-08-20 06:18:02 +02:00
|
|
|
|
2016-11-16 00:03:18 +01:00
|
|
|
def baseVersion: String = "0.1.0-M15"
|
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"),
|
2015-03-24 21:16:55 +01:00
|
|
|
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"),
|
2016-06-19 14:06:43 +02:00
|
|
|
crossScalaVersions := Seq(scala211),
|
2016-06-19 12:42:31 +02:00
|
|
|
scalacOptions ++= Seq("-Ywarn-unused", "-Ywarn-unused-import"),
|
2016-11-23 00:41:29 +01:00
|
|
|
scalacOptions --= // scalac 2.10 rejects some HK types under -Xfuture it seems..
|
|
|
|
|
(CrossVersion partialVersion scalaVersion.value collect { case (2, 10) => List("-Xfuture", "-Ywarn-unused", "-Ywarn-unused-import") }).toList.flatten,
|
2016-11-28 18:16:20 +01:00
|
|
|
scalacOptions in console in Compile -= "-Ywarn-unused-import",
|
|
|
|
|
scalacOptions in console in Test -= "-Ywarn-unused-import",
|
2016-02-14 17:42:00 +01:00
|
|
|
previousArtifact := None, // 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
|
|
|
).
|
2015-02-06 20:35:32 +01: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",
|
2015-02-06 20:35:32 +01:00
|
|
|
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
|
2015-03-24 21:12:51 +01:00
|
|
|
)
|
|
|
|
|
|
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,
|
2015-03-27 00:22:24 +01:00
|
|
|
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,
|
2015-08-31 15:25:10 +02:00
|
|
|
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,
|
2015-03-27 00:22:24 +01:00
|
|
|
Util.keywordsSettings,
|
2016-06-19 14:06:43 +02:00
|
|
|
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",
|
2016-10-27 13:05:29 +02:00
|
|
|
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").
|
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,
|
2016-11-23 00:41:29 +01:00
|
|
|
crossScalaVersions := Seq(scala210, scala211),
|
2015-08-20 06:18:02 +02:00
|
|
|
name := "Util Logging",
|
2014-12-18 13:57:05 +01:00
|
|
|
libraryDependencies += jline
|
2015-07-15 10:01:11 +02:00
|
|
|
)
|
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",
|
2016-10-27 13:05:29 +02:00
|
|
|
libraryDependencies ++= Seq(sjsonnew, scalaReflect.value),
|
2016-06-27 15:27:42 +02:00
|
|
|
libraryDependencies += sjsonnewScalaJson % Test
|
2016-10-27 13:05:29 +02:00
|
|
|
).
|
|
|
|
|
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
|
2016-10-27 13:05:29 +02:00
|
|
|
).
|
|
|
|
|
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-11-23 00:41:29 +01:00
|
|
|
crossScalaVersions := Seq(scala210, scala211),
|
2015-09-04 23:40:48 +02:00
|
|
|
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 ++= {
|
|
|
|
|
if (scalaVersion.value startsWith "2.11") Seq(parserCombinator211)
|
|
|
|
|
else Seq()
|
|
|
|
|
}
|
2016-10-27 13:05:29 +02: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
|
|
|
|
|
}
|
|
|
|
|
)
|