From ee114b06cf530e9b37f28eaefaf86a6bb99e59ed Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 23 Aug 2013 19:23:18 +0200 Subject: Polishing the build - move to maven group org.scala-lang.modules / scala-async - add config to publish to sonatype OSS - generate a scala-async.properties files (ala the scala-parser-combinators build) --- build.sbt | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'build.sbt') diff --git a/build.sbt b/build.sbt index a013bb2..b485264 100644 --- a/build.sbt +++ b/build.sbt @@ -1,10 +1,11 @@ scalaVersion := "2.10.3-RC1" -organization := "org.typesafe.async" // TODO new org name under scala-lang. - // Uncomment to test with a locally built copy of Scala. // scalaHome := Some(file("/code/scala2/build/pack")) + +organization := "org.scala-lang.modules.async" // TODO new org name under scala-lang. + name := "scala-async" version := "1.0.0-SNAPSHOT" @@ -45,10 +46,26 @@ libraryDependencies ++= (scalaHome.value match { scalacOptions += "-P:continuations:enable" -scalacOptions ++= Seq("-deprecation", "-unchecked", "-Xlint", "-feature") +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" +} + + description := "An asynchronous programming facility for Scala, in the spirit of C# await/async" homepage := Some(url("http://github.com/scala/async")) @@ -60,6 +77,22 @@ licenses +=("Scala license", url("https://github.com/scala/async/blob/master/LIC // 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 := ( -- cgit v1.2.3