Skip to content

Switch to scala-module-plugin, sbt 0.13.1 #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2014
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
115 changes: 9 additions & 106 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,115 +1,18 @@
import VersionKeys.{snapshotScalaBinaryVersion,deriveBinaryVersion}
scalaModuleSettings

organization := "org.scala-lang.modules"
name := "scala-parser-combinators"

name := "scala-parser-combinators"
version := "1.0.0-SNAPSHOT"

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

scalaVersion := "2.11.0-M7"
snapshotScalaBinaryVersion := "2.11.0-M8"

snapshotScalaBinaryVersion := "2.11.0-M7"

// DOUBLETHINK YOUR WAY OUT OF EDITING BELOW (THERE IS NO BELOW)

scalaBinaryVersion := deriveBinaryVersion(scalaVersion.value, snapshotScalaBinaryVersion.value)

// to allow compiling against snapshot versions of Scala
resolvers += Resolver.sonatypeRepo("snapshots")


libraryDependencies ++= Seq(
"junit" % "junit" % "4.11" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test")

// don't use for doc scope, scaladoc warnings are not to be reckoned with
// TODO: turn on for nightlies, but don't enable for PR validation... "-Xfatal-warnings"
scalacOptions in compile ++= Seq("-optimize", "-feature", "-deprecation", "-unchecked", "-Xlint")


// 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"
}


// 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")
}

credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")

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>
)

osgiSettings

val osgiVersion = version(_.replace('-', '.'))

OsgiKeys.bundleSymbolicName := s"${organization.value}.${name.value}"

OsgiKeys.bundleVersion := osgiVersion.value
// important!! must come here (why?)
scalaModuleOsgiSettings

OsgiKeys.exportPackage := Seq(s"scala.util.parsing.*;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:="."""")
))

libraryDependencies += "junit" % "junit" % "4.11" % "test"

// TODO: mima
// import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
// import com.typesafe.tools.mima.plugin.MimaKeys.previousArtifact
// previousArtifact := Some(organization.value %% name.value % binaryReferenceVersion.value)
libraryDependencies += "com.novocode" % "junit-interface" % "0.10" % "test"
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.0
sbt.version=0.13.1
11 changes: 0 additions & 11 deletions project/keys.scala

This file was deleted.

2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.6.0")
addSbtPlugin("org.scala-lang.modules" % "scala-module-plugin" % "1.0.1")