diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..98ac851
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,25 @@
+name: test
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+jobs:
+ test:
+ strategy:
+ fail-fast: false
+ matrix:
+ java: [8, 11, 17]
+ scala: [2.11.12, 2.12.15, 2.13.6, 3.0.2]
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - uses: coursier/cache-action@v6
+ - uses: actions/setup-java@v2
+ with:
+ distribution: adopt
+ java-version: ${{matrix.java}}
+ - name: Test
+ run: sbt ++${{matrix.scala}} test headerCheck versionPolicyCheck package
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..dc33711
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,21 @@
+name: Release
+on:
+ push:
+ tags: ["*"]
+jobs:
+ publish:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - uses: actions/setup-java@v2
+ with:
+ distribution: adopt
+ java-version: 8
+ - run: sbt versionCheck ci-release
+ env:
+ PGP_PASSPHRASE: ${{secrets.PGP_PASSPHRASE}}
+ PGP_SECRET: ${{secrets.PGP_SECRET}}
+ SONATYPE_PASSWORD: ${{secrets.SONATYPE_PASSWORD}}
+ SONATYPE_USERNAME: ${{secrets.SONATYPE_USERNAME}}
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 78948a7..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-version: ~> 1.0 # needed for imports
-
-import: scala/scala-dev:travis/default.yml
-
-language: scala
-
-scala:
- - 3.0.0
- - 3.0.0-RC3
- - 2.11.12
- - 2.12.15
- - 2.13.5
-
-env:
- - ADOPTOPENJDK=8
- - ADOPTOPENJDK=11
-
-install:
- - git fetch --tags # get all tags for sbt-dynver
-
-script: ./build.sh
-
-notifications:
- email:
- - seth.tisue@lightbend.com
diff --git a/README.md b/README.md
index 1a39420..34f30b9 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,4 @@
-# scala-java8-compat [](https://travis-ci.org/scala/scala-java8-compat) [
](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-java8-compat_2.11) [
](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-java8-compat_2.12) [
](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-java8-compat_2.13)
-
+# scala-java8-compat [
](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-java8-compat_2.11) [
](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-java8-compat_2.12) [
](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-java8-compat_2.13) [
](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-java8-compat_3)
A Java 8 compatibility kit for Scala 2.12 and 2.11.
diff --git a/benchmark/build.sbt b/benchmark/build.sbt
index 0703b42..393b763 100644
--- a/benchmark/build.sbt
+++ b/benchmark/build.sbt
@@ -5,8 +5,8 @@ val parseJmh = TaskKey[Unit]("parseJmh", "Parses JMH benchmark logs in results/j
lazy val root = (project in file(".")).settings(
name := "java8-compat-bench",
- scalaVersion := "2.11.11",
- crossScalaVersions := List("2.11.11" /* TODO, "2.12.0-M4"*/),
+ scalaVersion := "2.11.12",
+ crossScalaVersions := List("2.11.12" /* TODO, "2.12.0-M4"*/),
organization := "org.scala-lang.modules",
version := "0.6.0-SNAPSHOT",
unmanagedJars in Compile ++= Seq(baseDirectory.value / "../target/scala-2.11/scala-java8-compat_2.11-0.9.0-SNAPSHOT.jar"),
diff --git a/build.sbt b/build.sbt
index 0b34569..fdbe60d 100644
--- a/build.sbt
+++ b/build.sbt
@@ -18,7 +18,13 @@ def osgiExport(scalaVersion: String, version: String) = {
}) ++ Seq(s"scala.compat.java8.*;version=${version}")
}
+// shouldn't be necessary anymore after https://github.com/lampepfl/dotty/pull/13498
+// makes it into a release
+ThisBuild / libraryDependencySchemes += "org.scala-lang" %% "scala3-library" % "semver-spec"
+
lazy val commonSettings = Seq(
+ crossScalaVersions := Seq("2.13.6", "2.12.15", "2.11.12", "3.0.2"),
+ scalaVersion := crossScalaVersions.value.head,
versionPolicyIntention := Compatibility.BinaryAndSourceCompatible,
Compile / unmanagedSourceDirectories ++= {
(Compile / unmanagedSourceDirectories).value.flatMap { dir =>
@@ -141,7 +147,7 @@ lazy val scalaJava8Compat = (project in file("."))
JavaDoc / packageDoc / artifactName := ((sv, mod, art) => "" + mod.name + "_" + sv.binary + "-" + mod.revision + "-javadoc.jar"),
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => Seq()
- case _ => Seq(compilerPlugin("com.typesafe.genjavadoc" % "genjavadoc-plugin" % "0.17" cross CrossVersion.full))
+ case _ => Seq(compilerPlugin("com.typesafe.genjavadoc" % "genjavadoc-plugin" % "0.18" cross CrossVersion.full))
}),
Compile / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => Seq()
diff --git a/build.sh b/build.sh
deleted file mode 100755
index 1d72bea..0000000
--- a/build.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-
-set -e
-
-# Builds of tagged revisions are published to sonatype staging.
-
-# Travis runs a build on new revisions and on new tags, so a tagged revision is built twice.
-# Builds for a tag have TRAVIS_TAG defined, which we use for identifying tagged builds.
-
-# sbt-dynver sets the version number from the tag
-# sbt-travisci sets the Scala version from the travis job matrix
-
-# To back-publish an existing release for a new Scala / Scala.js / Scala Native version:
-# - check out the tag for the version that needs to be published
-# - change `.travis.yml` to adjust the version numbers and trim down the build matrix as necessary
-# - commit the changes and tag this new revision with an arbitrary suffix after a hash, e.g.,
-# `v1.2.3#dotty-0.27` (the suffix is ignored, the version will be `1.2.3`)
-
-# We release on JDK 8 (for Scala 2.x and Dotty 0.x)
-isReleaseJob() {
- if [[ "$ADOPTOPENJDK" == "8" ]]; then
- true
- else
- false
- fi
-}
-
-projectPrefix=scalaJava8Compat/
-
-verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"
-tagPat="^v$verPat(#.*)?$"
-
-if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then
- versionCheckTask="versionCheck"
- releaseTask="ci-release"
- if ! isReleaseJob; then
- echo "Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION"
- exit 0
- fi
-fi
-
-# default is +publishSigned; we cross-build with travis jobs, not sbt's crossScalaVersions
-export CI_RELEASE="${projectPrefix}publishSigned"
-export CI_SNAPSHOT_RELEASE="${projectPrefix}publish"
-
-# default is sonatypeBundleRelease, which closes and releases the staging repo
-# see https://github.com/xerial/sbt-sonatype#commands
-# for now, until we're confident in the new release scripts, just close the staging repo.
-export CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose"
-
-sbt clean ${projectPrefix}test ${projectPrefix}publishLocal $versionCheckTask $releaseTask
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 0401cc3..a668f72 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -1 +1 @@
-addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.4.0")
+addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "3.0.0")
diff --git a/src/main/scala-2.13+/scala/compat/java8/collectionImpl/package.scala b/src/main/scala-2.13+/scala/compat/java8/collectionImpl/package.scala
index ab5cfca..c02ebce 100644
--- a/src/main/scala-2.13+/scala/compat/java8/collectionImpl/package.scala
+++ b/src/main/scala-2.13+/scala/compat/java8/collectionImpl/package.scala
@@ -1,3 +1,15 @@
+/*
+ * Scala (https://www.scala-lang.org)
+ *
+ * Copyright EPFL and Lightbend, Inc.
+ *
+ * Licensed under Apache License 2.0
+ * (http://www.apache.org/licenses/LICENSE-2.0).
+ *
+ * See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
+ */
+
package scala.compat.java8
package object collectionImpl {
diff --git a/src/main/scala-2.13+/scala/compat/java8/converterImpl/StepperExtensions.scala b/src/main/scala-2.13+/scala/compat/java8/converterImpl/StepperExtensions.scala
index 15f384a..dd75253 100644
--- a/src/main/scala-2.13+/scala/compat/java8/converterImpl/StepperExtensions.scala
+++ b/src/main/scala-2.13+/scala/compat/java8/converterImpl/StepperExtensions.scala
@@ -1,3 +1,15 @@
+/*
+ * Scala (https://www.scala-lang.org)
+ *
+ * Copyright EPFL and Lightbend, Inc.
+ *
+ * Licensed under Apache License 2.0
+ * (http://www.apache.org/licenses/LICENSE-2.0).
+ *
+ * See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
+ */
+
package scala.compat.java8.converterImpl
import scala.collection.convert.StreamExtensions.AccumulatorFactoryInfo
diff --git a/src/main/scala-2.13+/scala/concurrent/java8/FuturesConvertersImplCompat.scala b/src/main/scala-2.13+/scala/concurrent/java8/FuturesConvertersImplCompat.scala
index ea4cf4d..754f784 100644
--- a/src/main/scala-2.13+/scala/concurrent/java8/FuturesConvertersImplCompat.scala
+++ b/src/main/scala-2.13+/scala/concurrent/java8/FuturesConvertersImplCompat.scala
@@ -1,3 +1,15 @@
+/*
+ * Scala (https://www.scala-lang.org)
+ *
+ * Copyright EPFL and Lightbend, Inc.
+ *
+ * Licensed under Apache License 2.0
+ * (http://www.apache.org/licenses/LICENSE-2.0).
+ *
+ * See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
+ */
+
package scala.concurrent.java8
import scala.concurrent.ExecutionContext
diff --git a/src/main/scala-2.13-/scala/concurrent/java8/FuturesConvertersImplCompat.scala b/src/main/scala-2.13-/scala/concurrent/java8/FuturesConvertersImplCompat.scala
index 4262f7a..cca7feb 100644
--- a/src/main/scala-2.13-/scala/concurrent/java8/FuturesConvertersImplCompat.scala
+++ b/src/main/scala-2.13-/scala/concurrent/java8/FuturesConvertersImplCompat.scala
@@ -1,3 +1,15 @@
+/*
+ * Scala (https://www.scala-lang.org)
+ *
+ * Copyright EPFL and Lightbend, Inc.
+ *
+ * Licensed under Apache License 2.0
+ * (http://www.apache.org/licenses/LICENSE-2.0).
+ *
+ * See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
+ */
+
package scala.concurrent.java8
import scala.concurrent.Future
diff --git a/src/test/java-2.11/scala/compat/java8/runtime/LambdaDeserializerTest.java b/src/test/java-2.11/scala/compat/java8/runtime/LambdaDeserializerTest.java
index 6640a44..a6b71d2 100644
--- a/src/test/java-2.11/scala/compat/java8/runtime/LambdaDeserializerTest.java
+++ b/src/test/java-2.11/scala/compat/java8/runtime/LambdaDeserializerTest.java
@@ -13,6 +13,7 @@
package scala.compat.java8.runtime;
import org.junit.Assert;
+import org.junit.Assume;
import org.junit.Test;
import java.io.Serializable;
@@ -26,26 +27,33 @@
public final class LambdaDeserializerTest {
private LambdaHost lambdaHost = new LambdaHost();
+ // We skip most tests on Java 17+ because of https://github.com/scala/bug/issues/12419
+ // which we only fixed for 2.12+
+
@Test
public void serializationPrivate() {
+ Assume.assumeFalse(scala.util.Properties.isJavaAtLeast("17"));
F1 f1 = lambdaHost.lambdaBackedByPrivateImplMethod();
Assert.assertEquals(f1.apply(true), reconstitute(f1).apply(true));
}
@Test
public void serializationStatic() {
+ Assume.assumeFalse(scala.util.Properties.isJavaAtLeast("17"));
F1 f1 = lambdaHost.lambdaBackedByStaticImplMethod();
Assert.assertEquals(f1.apply(true), reconstitute(f1).apply(true));
}
@Test
public void serializationVirtualMethodReference() {
+ Assume.assumeFalse(scala.util.Properties.isJavaAtLeast("17"));
F1 f1 = lambdaHost.lambdaBackedByVirtualMethodReference();
Assert.assertEquals(f1.apply(true), reconstitute(f1).apply(true));
}
@Test
public void serializationInterfaceMethodReference() {
+ Assume.assumeFalse(scala.util.Properties.isJavaAtLeast("17"));
F1 f1 = lambdaHost.lambdaBackedByInterfaceMethodReference();
I i = new I() {
};
@@ -54,18 +62,21 @@ public void serializationInterfaceMethodReference() {
@Test
public void serializationStaticMethodReference() {
+ Assume.assumeFalse(scala.util.Properties.isJavaAtLeast("17"));
F1 f1 = lambdaHost.lambdaBackedByStaticMethodReference();
Assert.assertEquals(f1.apply(true), reconstitute(f1).apply(true));
}
@Test
public void serializationNewInvokeSpecial() {
+ Assume.assumeFalse(scala.util.Properties.isJavaAtLeast("17"));
F0