Skip to content

Port to SBT 1.2.8, sbt-scala-module, and Scala 2.13.0 #22

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
Jul 3, 2019
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
language: scala

jdk:
- oraclejdk8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove that jdk version? In the build.sbt file you tell sbt to use jdk 8 for publishing, so we should keep that version. You can use openjdk8 instead of oraclejdk8, if there is any issue with the latter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that seems to have worked

- openjdk8
- openjdk11

scala:
- 2.13.0-RC1
- 2.13.0

script:
- sbt ++$TRAVIS_SCALA_VERSION test
Expand Down
32 changes: 12 additions & 20 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
// TODO Make it a cross project including Scala.js
import ScalaModulePlugin._

scalaVersion := "2.13.0-RC1"
scalaModuleSettings

organization := "org.scala-lang"
name := "scala-collection-contrib"

version := "0.1.0-SNAPSHOT"

scalacOptions ++= Seq("-deprecation", "-feature", "-opt-warnings", "-unchecked", "-language:higherKinds")
scalaVersionsByJvm in ThisBuild := {
val v213 = "2.13.0"
Map(
8 -> List(v213 -> true),
11 -> List(v213 -> false),
12 -> List(v213 -> false))
}

scalacOptions ++= Seq("-opt-warnings", "-language:higherKinds")

scalacOptions in (Compile, doc) ++= Seq("-implicits", "-groups")

testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v", "-s", "-a")

fork in Test := true

parallelExecution in Test := false

homepage := Some(url("https://github.com/scala/scala-collection-contrib"))

licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0"))

scmInfo := Some(
ScmInfo(
url("https://github.com/scala/scala-collection-contrib"),
"scm:git:[email protected]:scala/scala-collection-contrib.git"
)
)

pomExtra :=
<developers>
<developer><id>julienrf</id><name>Julien Richard-Foy</name></developer>
<developer><id>szeiger</id><name>Stefan Zeiger</name></developer>
</developers>

// For publishing snapshots
credentials ++= (
for {
username <- sys.env.get("SONATYPE_USERNAME")
password <- sys.env.get("SONATYPE_PASSWORD")
} yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", username, password)
).toList

libraryDependencies ++= Seq(
"junit" % "junit" % "4.12",
"com.novocode" % "junit-interface" % "0.11" % Test,
Expand Down
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.18
sbt.version=1.2.8
4 changes: 3 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")

addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.0.0")

4 changes: 2 additions & 2 deletions src/main/scala/scala/collection/decorators/MapDecorator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class MapDecorator[C, M <: IsMap[C]](coll: C)(implicit val map: M) {
def leftOuterJoin[W, That](other: Map[map.K, W])(implicit bf: BuildFrom[C, (map.K, (map.V, Option[W])), That]): That = {
val b = bf.newBuilder(coll)
for ((k, v) <- map(coll)) {
b += k -> (v, other.get(k))
b += k -> ((v, other.get(k)))
}
b.result()
}
Expand All @@ -128,7 +128,7 @@ class MapDecorator[C, M <: IsMap[C]](coll: C)(implicit val map: M) {
def rightOuterJoin[W, That](other: Map[map.K, W])(implicit bf: BuildFrom[C, (map.K, (Option[map.V], W)), That]): That = {
val b = bf.newBuilder(coll)
for ((k, w) <- other) {
b += k -> (map(coll).get(k), w)
b += k -> ((map(coll).get(k), w))
}
b.result()
}
Expand Down