aboutsummaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2017-04-26 10:37:19 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2017-04-26 10:37:19 +0200
commit6afb291eea3dfadb889a3ea622d73457c2d4e3ef (patch)
treebf8d69b6f46252515f2f56c556ecf3c97b87b567 /build.sbt
parent605760dbd421e648a0dae1d07517887f69e1caa8 (diff)
downloadscala-async-6afb291eea3dfadb889a3ea622d73457c2d4e3ef.tar.gz
scala-async-6afb291eea3dfadb889a3ea622d73457c2d4e3ef.tar.bz2
scala-async-6afb291eea3dfadb889a3ea622d73457c2d4e3ef.zip
Use scala-module-plugin, update tag-based publishing
The build didn't use the `scala-module-plugin` before but duplicated most of its settings - maybe I missed the reason why this is the case? Also update tag-based publishing to the latest version.
Diffstat (limited to 'build.sbt')
-rw-r--r--build.sbt96
1 files changed, 22 insertions, 74 deletions
diff --git a/build.sbt b/build.sbt
index 50059f9..7dd623b 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,77 +1,46 @@
-crossScalaVersions := List("2.11.8", "2.12.0")
+import ScalaModulePlugin._
-scalaVersion := crossScalaVersions.value.head
+scalaModuleSettings
-// Uncomment to test with a locally built copy of Scala.
-// scalaHome := Some(file("/code/scala2/build/pack"))
-resolvers ++= (if (scalaVersion.value.endsWith("SNAPSHOT")) List(Resolver.sonatypeRepo("snapshots")) else Nil)
+scalaVersionsByJvm in ThisBuild := {
+ val v211 = "2.11.11"
+ val v212 = "2.12.2"
+ val v213 = "2.13.0-M1"
-organization := "org.scala-lang.modules"
+ Map(
+ 6 -> List(v211 -> true),
+ 7 -> List(v211 -> false),
+ 8 -> List(v212 -> true, v213 -> true, v211 -> false),
+ 9 -> List(v212 -> false, v213 -> false, v211 -> false))
+}
name := "scala-async"
+repoName := "async"
version := "0.9.7-SNAPSHOT"
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided"
-
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value % "test" // for ToolBox
-
libraryDependencies += "junit" % "junit-dep" % "4.10" % "test"
-
libraryDependencies += "com.novocode" % "junit-interface" % "0.10" % "test"
+enableOptimizer
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v", "-s")
-
-parallelExecution in Global := false
-
-scalacOptions in compile ++= Seq("-optimize", "-deprecation", "-unchecked", "-Xlint", "-feature")
-
scalacOptions in Test ++= Seq("-Yrangepos")
-// Generate $name.properties to store our version as well as the scala version used to build
-resourceGenerators in Compile <+= Def.task {
- val props = new java.util.Properties
- props.put("version.number", version.value)
- props.put("scala.version.number", scalaVersion.value)
- props.put("scala.binary.version.number", scalaBinaryVersion.value)
- val file = (resourceManaged in Compile).value / s"${name.value}.properties"
- IO.write(props, null, file)
- Seq(file)
-}
-
-mappings in (Compile, packageBin) += {
- (baseDirectory.value / s"${name.value}.properties") -> s"${name.value}.properties"
-}
+parallelExecution in Global := false
+// Uncomment to disable test compilation.
+// (sources in Test) ~= ((xs: Seq[File]) => xs.filter(f => Seq("TreeInterrogation", "package").exists(f.name.contains)))
description := "An asynchronous programming facility for Scala that offers a direct API for working with Futures."
-
homepage := Some(url("http://github.com/scala/async"))
-
startYear := Some(2012)
-
-licenses +=("Scala license", url("https://github.com/scala/async/blob/master/LICENSE"))
-
-// Uncomment to disable test compilation.
-// (sources in Test) ~= ((xs: Seq[File]) => xs.filter(f => Seq("TreeInterrogation", "package").exists(f.name.contains)))
-
-// maven publishing
-publishTo := {
- val nexus = "https://oss.sonatype.org/"
- val repo = if (version.value.trim.endsWith("SNAPSHOT"))
- "snapshots" at nexus + "content/repositories/snapshots"
- else
- "releases" at nexus + "service/local/staging/deploy/maven2"
- Some(repo)
-}
-
-publishMavenStyle := true
-
-publishArtifact in Test := false
-
-pomIncludeRepository := { _ => false }
-
pomExtra := (
+ <issueManagement>
+ <system>GitHub</system>
+ <url>https://github.com/scala/async/issues</url>
+ </issueManagement>
<developers>
<developer>
<id>phaller</id>
@@ -82,30 +51,9 @@ pomExtra := (
<developer>
<id>retronym</id>
<name>Jason Zaugg</name>
- <timezone>+1</timezone>
+ <timezone>+10</timezone>
<url>http://github.com/retronym</url>
</developer>
</developers>
- <scm>
- <url>git@github.com:scala/async.git/</url>
- <connection>scm:git:git@github.com:scala/async.git</connection>
- </scm>
)
-
-osgiSettings
-
-val osgiVersion = version(_.replace('-', '.'))
-
-OsgiKeys.bundleSymbolicName := s"${organization.value}.${name.value}"
-
-OsgiKeys.bundleVersion := osgiVersion.value
-
OsgiKeys.exportPackage := Seq(s"scala.async.*;version=${version.value}")
-
-// Sources should also have a nice MANIFEST file
-packageOptions in packageSrc := Seq(Package.ManifestAttributes(
- ("Bundle-SymbolicName", s"${organization.value}.${name.value}.source"),
- ("Bundle-Name", s"${name.value} sources"),
- ("Bundle-Version", osgiVersion.value),
- ("Eclipse-SourceBundle", s"""${organization.value}.${name.value};version="${osgiVersion.value}";roots:="."""")
- ))