Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

Move build boilerplate to standard.sbt. #13

Merged
merged 1 commit into from
Nov 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ script:
scala:
- 2.11.0-SNAPSHOT
jdk:
- oraclejdk6
- openjdk7
notifications:
email:
Expand Down
100 changes: 15 additions & 85 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
import VersionKeys._

organization := "org.scala-lang.modules"

organization := "org.scala-lang.modules"
name := "scala-partest"

name := "scala-partest"
version := "1.0.0-SNAPSHOT"

version := "1.0.0-SNAPSHOT"
scalaVersion := "2.11.0-M7"

scalaVersion := "2.11.0-M6"
scalaXmlVersion := "1.0.0-RC7"

snapshotScalaBinaryVersion := "2.11.0-M6"
scalaCheckVersion := "1.11.1"

scalaXmlVersion := "1.0.0-RC6"
// used as binary version when compiling against 2.11.0-SNAPSHOT
snapshotScalaBinaryVersion := "2.11.0-M7"

scalaCheckVersion := "1.10.1"

// 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")
// TODO: enable "-Xfatal-warnings" for nightlies,
// off by default because we don't want to break scala/scala pr validation due to deprecation
// don't use for doc scope, scaladoc warnings are not to be reckoned with
scalacOptions in (Compile, compile) ++= Seq("-optimize", "-feature", "-deprecation", "-unchecked", "-Xlint")

// dependencies:
// dependencies
// versions involved in integration builds / that change frequently should be keys, set above!
libraryDependencies += "org.apache.ant" % "ant" % "1.8.4"

libraryDependencies += "com.googlecode.java-diff-utils" % "diffutils" % "1.3.0"
Expand All @@ -46,70 +42,4 @@ libraryDependencies += "org.scala-lang" % "scala-reflect" % sca

libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided" intransitive()

// don't use for doc scope, scaladoc warnings are not to be reckoned with
// "-Xfatal-warnings",
scalacOptions in (Compile, compile) ++= Seq("-optimize", "-feature", "-deprecation", "-unchecked", "-Xlint")


// 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 := (
<url>http://www.scala-lang.org/</url>
<inceptionYear>2002</inceptionYear>
<licenses>
<license>
<distribution>repo</distribution>
<name>BSD 3-Clause</name>
<url>https://github.com/scala/{name.value}/blob/master/LICENSE.md</url>
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/scala/{name.value}.git</connection>
<url>https://github.com/scala/{name.value}</url>
</scm>
<issueManagement>
<system>JIRA</system>
<url>https://issues.scala-lang.org/</url>
</issueManagement>
<developers>
<developer>
<id>epfl</id>
<name>EPFL</name>
</developer>
<developer>
<id>Typesafe</id>
<name>Typesafe, Inc.</name>
</developer>
</developers>
)

// the boilerplate is in standard.sbt
75 changes: 75 additions & 0 deletions standard.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
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 := (
<url>http://www.scala-lang.org/</url>
<inceptionYear>2002</inceptionYear>
<licenses>
<license>
<distribution>repo</distribution>
<name>BSD 3-Clause</name>
<url>https://github.com/scala/{name.value}/blob/master/LICENSE.md</url>
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/scala/{name.value}.git</connection>
<url>https://github.com/scala/{name.value}</url>
</scm>
<issueManagement>
<system>JIRA</system>
<url>https://issues.scala-lang.org/</url>
</issueManagement>
<developers>
<developer>
<id>epfl</id>
<name>EPFL</name>
</developer>
<developer>
<id>Typesafe</id>
<name>Typesafe, Inc.</name>
</developer>
</developers>
)