From c3f7cfa4b88dea88916387453e18f891b45713a0 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Fri, 24 Jan 2014 17:36:08 -0800 Subject: [PATCH] Switch to scala-module-plugin, sbt 0.13.1 --- build.sbt | 21 +++--- project/build.properties | 3 +- project/keys.scala | 15 ---- project/plugins.sbt | 8 +- .../tools/partest/utils/Properties.scala | 4 +- standard.sbt | 75 ------------------- 6 files changed, 15 insertions(+), 111 deletions(-) delete mode 100644 project/keys.scala delete mode 100644 standard.sbt diff --git a/build.sbt b/build.sbt index 83afa68..9bbd238 100644 --- a/build.sbt +++ b/build.sbt @@ -1,19 +1,22 @@ -import VersionKeys._ +scalaModuleSettings -organization := "org.scala-lang.modules" +// To facilitate scripted build of all modules (while we're working on getting dbuild up and running) +val scalaXmlVersion = sbt.settingKey[String]("Version to use for the scala-xml dependency.") -name := "scala-partest" +val scalaCheckVersion = sbt.settingKey[String]("Version to use for the scalacheck dependency.") -version := "1.0.0-SNAPSHOT" +name := "scala-partest" -scalaVersion := "2.11.0-M7" +version := "1.0.0-SNAPSHOT" -scalaXmlVersion := "1.0.0-RC7" +scalaVersion := "2.11.0-M8" -scalaCheckVersion := "1.11.1" +scalaXmlVersion := "1.0.0-RC7" + +scalaCheckVersion := "1.11.3" // used as binary version when compiling against 2.11.0-SNAPSHOT -snapshotScalaBinaryVersion := "2.11.0-M7" +snapshotScalaBinaryVersion := "2.11.0-M8" // TODO: enable "-Xfatal-warnings" for nightlies, // off by default because we don't want to break scala/scala pr validation due to deprecation @@ -41,5 +44,3 @@ libraryDependencies += "org.scala-lang" % "scalap" % sca libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided" intransitive() libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided" intransitive() - -// the boilerplate is in standard.sbt diff --git a/project/build.properties b/project/build.properties index 67c6989..37b489c 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1,2 +1 @@ -# "0.13.+" breaks plugin resolution -sbt.version=0.13.0 +sbt.version=0.13.1 diff --git a/project/keys.scala b/project/keys.scala deleted file mode 100644 index c8ebb93..0000000 --- a/project/keys.scala +++ /dev/null @@ -1,15 +0,0 @@ -object VersionKeys { - import sbt.settingKey - - // To facilitate scripted build of all modules (while we're working on getting dbuild up and running) - val scalaXmlVersion = settingKey[String]("Version to use for the scala-xml dependency.") - val scalaCheckVersion = settingKey[String]("Version to use for the scalacheck dependency.") - - val snapshotScalaBinaryVersion = settingKey[String]("The Scala binary version to use when building against Scala SNAPSHOT.") - - def deriveBinaryVersion(sv: String, snapshotScalaBinaryVersion: String) = sv match { - case snap_211 if snap_211.startsWith("2.11") && - snap_211.contains("-SNAPSHOT") => snapshotScalaBinaryVersion - case sv => sbt.CrossVersion.binaryScalaVersion(sv) - } -} \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index 1d84332..d59d681 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,7 +1 @@ -resolvers += Classpaths.typesafeResolver - -// addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.5") - -addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.2.0") - -addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.1") +addSbtPlugin("org.scala-lang.modules" % "scala-module-plugin" % "1.0.1") \ No newline at end of file diff --git a/src/main/scala/scala/tools/partest/utils/Properties.scala b/src/main/scala/scala/tools/partest/utils/Properties.scala index 344fae4..0933279 100644 --- a/src/main/scala/scala/tools/partest/utils/Properties.scala +++ b/src/main/scala/scala/tools/partest/utils/Properties.scala @@ -10,9 +10,9 @@ package scala.tools.partest package utils -/** Loads partest.properties from the jar. TODO: standardize on scala-partest.properties */ +/** Loads scala-partest.properties from the jar. */ object Properties extends scala.util.PropertiesTrait { - protected def propCategory = "partest" + protected def propCategory = "scala-partest" protected def pickJarBasedOn = classOf[nest.Runner] override def isAvian = super.isAvian } diff --git a/standard.sbt b/standard.sbt deleted file mode 100644 index 316a526..0000000 --- a/standard.sbt +++ /dev/null @@ -1,75 +0,0 @@ -import VersionKeys._ - -// DOUBLETHINK YOUR WAY OUT OF EDITING BELOW (THERE IS NO BELOW) - -scalaBinaryVersion := deriveBinaryVersion(scalaVersion.value, snapshotScalaBinaryVersion.value) - -// so we don't have to wait for sonatype to synch to maven central when deploying a new module -resolvers += Resolver.sonatypeRepo("releases") - -// to allow compiling against snapshot versions of Scala -resolvers += Resolver.sonatypeRepo("snapshots") - - -// Generate $name.properties to store our version as well as the scala version used to build -// TODO: why doesn't this work for scala-partest.properties?? (After updating def propCategory in Properties, of course) -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 / "partest.properties" - IO.write(props, null, file) - Seq(file) -} - -mappings in (Compile, packageBin) += { - (baseDirectory.value / "partest.properties") -> "partest.properties" -} - - -// maven publishing -publishTo := { - val nexus = "https://oss.sonatype.org/" - if (version.value.trim.endsWith("SNAPSHOT")) - Some("snapshots" at nexus + "content/repositories/snapshots") - else - Some("releases" at nexus + "service/local/staging/deploy/maven2") -} - -publishMavenStyle := true - -publishArtifact in Test := false - -pomIncludeRepository := { _ => false } - -pomExtra := ( - http://www.scala-lang.org/ - 2002 - - - repo - BSD 3-Clause - https://github.com/scala/{name.value}/blob/master/LICENSE.md - - - - scm:git:git://github.com/scala/{name.value}.git - https://github.com/scala/{name.value} - - - JIRA - https://issues.scala-lang.org/ - - - - epfl - EPFL - - - Typesafe - Typesafe, Inc. - - -) -