From 7e6ea2dd50bb79c86f989741802b6718756465b0 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Thu, 30 Sep 2021 18:28:00 -0600 Subject: [PATCH 01/14] WIP: replace Travis-CI with GitHub Actions --- .github/workflows/ci.yml | 25 ++++++++ .github/workflows/release.yml | 21 +++++++ .travis.yml | 49 --------------- README.md | 10 +-- admin/checkCLA.sh | 20 ------ admin/install-scalafmt-githook.sh | 10 --- admin/pre-commit | 3 - admin/scalafmt.sh | 22 ------- build.sbt | 101 +----------------------------- project/plugins.sbt | 19 +++--- 10 files changed, 58 insertions(+), 222 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .travis.yml delete mode 100755 admin/checkCLA.sh delete mode 100755 admin/install-scalafmt-githook.sh delete mode 100755 admin/pre-commit delete mode 100755 admin/scalafmt.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..98ac8515 --- /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 00000000..dc337111 --- /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 2b564fb1..00000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -version: ~> 1.0 # needed for imports - -import: scala/scala-dev:travis/default.yml - -language: scala - -scala: - - 2.11.12 - - 2.12.15 - - 2.13.6 - - 3.0.1 - -env: - - SCALAJS_VERSION= ADOPTOPENJDK=8 - - SCALAJS_VERSION=1.7.0 ADOPTOPENJDK=8 - - SCALANATIVE_VERSION=0.4.0 ADOPTOPENJDK=8 - - SCALAJS_VERSION= ADOPTOPENJDK=11 - - SCALAJS_VERSION= ADOPTOPENJDK=17 - -matrix: - - include: - - # run migration test - - scala: 2.12.15 - env: TEST_SCALAFIX=true ADOPTOPENJDK=8 - - # run binary compatibility test - - scala: 2.12.15 - env: TEST_BINARY_COMPAT=true ADOPTOPENJDK=8 - - # run scalafmt - - scala: 2.12.15 - env: TEST_SCALAFMT=true ADOPTOPENJDK=8 - - exclude: - - # Scala Native doesn't support Scala 3 yet - - - scala: 3.0.1 - env: SCALANATIVE_VERSION=0.4.0 ADOPTOPENJDK=8 - -install: - - git fetch --tags # get all tags for sbt-dynver - -before_script: - - admin/checkCLA.sh - -script: sbt ci diff --git a/README.md b/README.md index 9d72f527..64b64a26 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ -[![Build Status](https://travis-ci.org/scala/scala-collection-compat.svg?branch=master)](https://travis-ci.org/scala/scala-collection-compat) - -## Purpose and scope - This library makes some Scala 2.13 APIs available on Scala 2.11 and 2.12. The idea is to facilitate @@ -17,7 +13,7 @@ Only the most commonly used APIs are supported; many are missing. Contributions To use this library, add the following to your `build.sbt`: ``` -libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "2.5.0" +libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "" ``` All future versions will remain backwards binary compatible with 2.0.0. (The 1.0.0 release was withdrawn and should not be used.) @@ -51,11 +47,11 @@ And, it includes support for some non-collections classes such as the `@nowarn` ## Migration rules -The migration rules use scalafix. Please see the [official installation instructions](https://scalacenter.github.io/scalafix/docs/users/installation.html) and, in particular, check that your full Scala version is supported (ex 2.12.13). +The migration rules use scalafix. Please see the [official installation instructions](https://scalacenter.github.io/scalafix/docs/users/installation.html) and, in particular, check that your full Scala version is supported (ex 2.12.15). ```scala // project/plugins.sbt -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.29") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.30") ``` ### Collection213Upgrade diff --git a/admin/checkCLA.sh b/admin/checkCLA.sh deleted file mode 100755 index 5e65685c..00000000 --- a/admin/checkCLA.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -# Script copied from https://github.com/scalameta/scalameta -set -e - -if [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then - echo "Incoming pull request from https://github.com/$TRAVIS_REPO_SLUG/pull/$TRAVIS_PULL_REQUEST"; - author=$(curl -s "https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST" | jq -r ".user.login"); - if [ $? -ne 0 ] ; then exit 1; fi; - echo "Pull request submitted by $author"; - signed=$(curl -s https://www.lightbend.com/contribute/cla/scala/check/$author | jq -r ".signed"); - if [ $? -ne 0 ] ; then exit 1; fi; - if [ "$signed" = "true" ] ; then - echo "CLA check for $author successful"; - else - echo "CLA check for $author failed"; - echo "Please sign the Scala CLA to contribute to $TRAVIS_REPO_SLUG"; - echo "Go to https://www.lightbend.com/contribute/cla/scala and then resubmit this pull request"; - exit 1; - fi; -fi; diff --git a/admin/install-scalafmt-githook.sh b/admin/install-scalafmt-githook.sh deleted file mode 100755 index a8707044..00000000 --- a/admin/install-scalafmt-githook.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# set -x - -HERE="`dirname $0`" -DST="$HERE/../.git/hooks/pre-commit" - -if [ ! -f $DST ]; then - cp "$HERE/pre-commit" $DST -fi diff --git a/admin/pre-commit b/admin/pre-commit deleted file mode 100755 index 38c17f1a..00000000 --- a/admin/pre-commit +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -$GIT_DIR/../admin/scalafmt.sh --test $GIT_DIR/.. diff --git a/admin/scalafmt.sh b/admin/scalafmt.sh deleted file mode 100755 index 369bf463..00000000 --- a/admin/scalafmt.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# set -x - -HERE="`dirname $0`" -VERSION="1.5.1" -COURSIER="$HERE/.coursier" -SCALAFMT="$HERE/.scalafmt-$VERSION" - -if [ ! -f $COURSIER ]; then - # note that the launch script we're using here is considered antiquated and was removed by - # https://github.com/coursier/coursier/pull/1565 - curl -L -o $COURSIER 'https://github.com/coursier/coursier/blob/483c980e784cf33168be94cfc1e5682f56d71142/coursier?raw=true' - chmod +x $COURSIER -fi - -if [ ! -f $SCALAFMT ]; then - $COURSIER bootstrap com.geirsson:scalafmt-cli_2.11:$VERSION --main org.scalafmt.cli.Cli -o $SCALAFMT - chmod +x $SCALAFMT -fi - -$SCALAFMT "$@" diff --git a/build.sbt b/build.sbt index f2cec653..7cb9c55a 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,6 @@ import com.lightbend.tools.scalamoduleplugin.ScalaModulePlugin._ import scala.sys.process._ lazy val commonSettings = Seq( - scalaModuleAutomaticModuleName := Some("scala.collection.compat"), headerLicense := Some(HeaderLicense.Custom(s"""|Scala (https://www.scala-lang.org) | |Copyright EPFL and Lightbend, Inc. @@ -65,6 +64,7 @@ lazy val compat = MultiScalaCrossProject(JSPlatform, JVMPlatform, NativePlatform .settings( name := "scala-collection-compat", moduleName := "scala-collection-compat", + scalaModuleAutomaticModuleName := Some("scala.collection.compat"), scalacOptions ++= Seq("-feature", "-language:higherKinds", "-language:implicitConversions"), Compile / unmanagedSourceDirectories += { val sharedSourceDir = (ThisBuild / baseDirectory).value / "compat/src/main" @@ -173,6 +173,7 @@ lazy val `scalafix-rules` = project .settings(scalaModuleSettings) .settings(commonSettings) .settings( + scalaModuleAutomaticModuleName := None, organization := (compat212JVM / organization).value, publishTo := (compat212JVM / publishTo).value, versionPolicyIntention := Compatibility.None, @@ -288,101 +289,3 @@ lazy val `scalafix-tests` = project ) .dependsOn(`scalafix-input`, `scalafix-rules`) .enablePlugins(BuildInfoPlugin, ScalafixTestkitPlugin) - -val travisScalaVersion = sys.env.get("TRAVIS_SCALA_VERSION").flatMap(Version.parse) -val isTravisTag = sys.env.get("TRAVIS_TAG").exists(_.nonEmpty) -val isScalaJs = sys.env.get("SCALAJS_VERSION").exists(_.nonEmpty) -val isScalaNative = sys.env.get("SCALANATIVE_VERSION").exists(_.nonEmpty) -val isScalafix = sys.env.get("TEST_SCALAFIX").nonEmpty -val isScalafmt = sys.env.get("TEST_SCALAFMT").nonEmpty -val isBinaryCompat = sys.env.get("TEST_BINARY_COMPAT").nonEmpty -val jdkVersion = sys.env.get("ADOPTOPENJDK").map(_.toInt) - -// required by sbt-scala-module -inThisBuild( - Seq( - commands += Command.command("scalafmt-test") { state => - val exitCode = Seq("admin/scalafmt.sh", "--test") ! state.globalLogging.full - if (exitCode == 0) state else state.fail - }, - commands += Command.command("scalafmt") { state => - Seq("admin/scalafmt.sh") ! state.globalLogging.full - state - }, - commands += Command.command("ci") { state => - val toRun: Seq[String] = - if (isScalafmt) { - Seq("scalafmt-test") - } else { - List( - "TRAVIS_SCALA_VERSION", - "TRAVIS_TAG", - "SCALAJS_VERSION", - "SCALANATIVE_VERSION", - "TEST_SCALAFIX", - "TEST_SCALAFMT", - "TEST_BINARY_COMPAT" - ).foreach(k => - println(k.padTo(20, " ").mkString("") + " -> " + sys.env.getOrElse(k, "None"))) - - val platformSuffix = if (isScalaJs) "JS" else if (isScalaNative) "Native" else "" - - val compatProject = "compat" + travisScalaVersion.get.binary + platformSuffix - val binaryCompatProject = "binary-compat" - - val testProjectPrefix = - if (isScalafix) { - "scalafix-tests" - } else if (isBinaryCompat) { - binaryCompatProject - } else { - compatProject - } - - val projectPrefix = - if (isScalafix) { - "scalafix-rules" - } else if (isBinaryCompat) { - binaryCompatProject - } else { - compatProject - } - - val publishTask = - if (isTravisTag && !isBinaryCompat && jdkVersion == Some(8)) { - // we cannot run "ci-release" because that reads the `CI_RELEASE` / `CI_SONATYPE_RELEASE` - // env vars, which we cannot modify from java (easily). so we inline what this command does. - CiReleasePlugin.setupGpg() - List( - // same fix as https://github.com/olafurpg/sbt-ci-release/pull/66 - // need to replicate it here since we're not using the `ci-release` command - "set pgpSecretRing := pgpSecretRing.value", - "set pgpPublicRing := pgpPublicRing.value", - s"$projectPrefix/publishSigned", - "sonatypePrepare", - "sonatypeBundleUpload", - "sonatypeClose" - ) - } else { - Nil - } - - Seq( - List(s"""++${sys.env.get("TRAVIS_SCALA_VERSION").get}!"""), - List(s"$projectPrefix/clean"), - List(s"$testProjectPrefix/test"), - List(s"$projectPrefix/publishLocal"), - publishTask - ).flatten - } - - println("---------") - println("Running CI: ") - toRun.foreach(println) - println("---------") - - val newCommands = toRun.toList.map(Exec(_, None)) - state.copy(remainingCommands = newCommands ::: state.remainingCommands) - } - ) -) diff --git a/project/plugins.sbt b/project/plugins.sbt index 35ade440..15af941f 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,13 +1,8 @@ -val crossVer = "1.1.0" -val scalaJSVersion = - Option(System.getenv("SCALAJS_VERSION")).filter(_.nonEmpty).getOrElse("1.7.0") -val scalaNativeVersion = - Option(System.getenv("SCALANATIVE_VERSION")).filter(_.nonEmpty).getOrElse("0.4.0") - -addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion) -addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % crossVer) -addSbtPlugin("org.scala-native" % "sbt-scala-native" % scalaNativeVersion) -addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % crossVer) -addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.4.0") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.31") +addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "3.0.0") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.30") + +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") +addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.1.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0") From c6821e03fffc52be616551c68399a924189de889 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 16:17:16 -0600 Subject: [PATCH 02/14] AdoptOpenJDK is now Temurin --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98ac8515..932ecdb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - uses: coursier/cache-action@v6 - uses: actions/setup-java@v2 with: - distribution: adopt + distribution: temurin 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 index dc337111..d69ab720 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-java@v2 with: - distribution: adopt + distribution: temurin java-version: 8 - run: sbt versionCheck ci-release env: From 8ba463e154c6f13bfb9c055f6b9e437f4dd1ea7a Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 19:26:01 -0600 Subject: [PATCH 03/14] wip --- .jvmopts | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .jvmopts diff --git a/.jvmopts b/.jvmopts deleted file mode 100644 index e69de29b..00000000 From d8315abbdad7385da7b9e2d53eca63811f9e9f34 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 19:35:33 -0600 Subject: [PATCH 04/14] wip --- .jvmopts | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .jvmopts diff --git a/.jvmopts b/.jvmopts new file mode 100644 index 00000000..a91983bf --- /dev/null +++ b/.jvmopts @@ -0,0 +1,2 @@ +-Xmx2G + From 2fd1953142cb9156e865afe4abc1878e86b1a3e3 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 19:41:09 -0600 Subject: [PATCH 05/14] wip --- .github/workflows/ci.yml | 7 +++++-- .jvmopts | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 .jvmopts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 932ecdb2..7accfd2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,6 @@ jobs: 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 @@ -22,4 +21,8 @@ jobs: distribution: temurin java-version: ${{matrix.java}} - name: Test - run: sbt ++${{matrix.scala}} test headerCheck versionPolicyCheck package + run: sbt test package + - name: Headers + run: sbt headerCheck + - name: Version policy + run: sbt PolicyCheck diff --git a/.jvmopts b/.jvmopts deleted file mode 100644 index a91983bf..00000000 --- a/.jvmopts +++ /dev/null @@ -1,2 +0,0 @@ --Xmx2G - From b950863ceef69b2e5dec16a6989fd1c779f6bb80 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 19:49:39 -0600 Subject: [PATCH 06/14] wip --- .jvmopts | 1 + 1 file changed, 1 insertion(+) create mode 100644 .jvmopts diff --git a/.jvmopts b/.jvmopts new file mode 100644 index 00000000..7e1a33fa --- /dev/null +++ b/.jvmopts @@ -0,0 +1 @@ +-Xmx2G From b69872dab0b12a7e9f394ad58a4ecd862c34a4ca Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 20:02:38 -0600 Subject: [PATCH 07/14] wip --- build.sbt | 6 +++++- .../scala/jdk/CollectionConverters.scala | 12 ++++++++++++ .../scala/util/control/compat/ControlThrowable.scala | 1 + .../scala/util/control/compat/package.scala | 12 ++++++++++++ .../test/scala/collection/LazyListGCTest.scala | 12 ++++++++++++ .../scala/scala/jdk/CollectionConvertersTest.scala | 12 ++++++++++++ .../src/test/scala/scala/util/ChainingOpsTest.scala | 12 ++++++++++++ compat/src/test/scala/scala/util/UsingTest.scala | 12 ++++++++++++ .../util/control/compat/ControlThrowableTest.scala | 12 ++++++++++++ .../test/scala/collection/LazyListLazinessTest.scala | 12 ++++++++++++ .../scala/test/scala/collection/LazyListTest.scala | 12 ++++++++++++ .../scala/test/scala/collection/LazyZipTest.scala | 12 ++++++++++++ .../test/scala/test/scala/collection/MapTest.scala | 1 + 13 files changed, 127 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 7cb9c55a..60d9ce74 100644 --- a/build.sbt +++ b/build.sbt @@ -213,6 +213,7 @@ lazy val `scalafix-input` = project .settings( scalaVersion := scalafixScala212, publish / skip := true, + excludeFilter := HiddenFileFilter || "*.scala", addCompilerPlugin(scalafixSemanticdb), scalacOptions ++= Seq( "-Yrangepos", @@ -226,7 +227,10 @@ val `scalafix-output` = MultiScalaProject( "scalafix/output", _.settings(sharedScalafixSettings) .settings(commonSettings) - .settings(publish / skip := true) + .settings( + publish / skip := true, + excludeFilter := HiddenFileFilter || "*.scala", + ) .disablePlugins(ScalafixPlugin) ) diff --git a/compat/src/main/scala-2.11_2.12/scala/jdk/CollectionConverters.scala b/compat/src/main/scala-2.11_2.12/scala/jdk/CollectionConverters.scala index 0a254eac..3cefffdc 100644 --- a/compat/src/main/scala-2.11_2.12/scala/jdk/CollectionConverters.scala +++ b/compat/src/main/scala-2.11_2.12/scala/jdk/CollectionConverters.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.jdk import scala.collection.convert.{DecorateAsJava, DecorateAsScala} diff --git a/compat/src/main/scala-2.11_2.12/scala/util/control/compat/ControlThrowable.scala b/compat/src/main/scala-2.11_2.12/scala/util/control/compat/ControlThrowable.scala index 08b4bb8f..ff42324b 100644 --- a/compat/src/main/scala-2.11_2.12/scala/util/control/compat/ControlThrowable.scala +++ b/compat/src/main/scala-2.11_2.12/scala/util/control/compat/ControlThrowable.scala @@ -9,6 +9,7 @@ * See the NOTICE file distributed with this work for * additional information regarding copyright ownership. */ + package scala.util.control.compat /** A parent class for throwable objects intended for flow control. diff --git a/compat/src/main/scala-2.13/scala/util/control/compat/package.scala b/compat/src/main/scala-2.13/scala/util/control/compat/package.scala index bad246d6..41866d1a 100644 --- a/compat/src/main/scala-2.13/scala/util/control/compat/package.scala +++ b/compat/src/main/scala-2.13/scala/util/control/compat/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.util.control package object compat { diff --git a/compat/src/test/scala-jvm/test/scala/collection/LazyListGCTest.scala b/compat/src/test/scala-jvm/test/scala/collection/LazyListGCTest.scala index eb741958..6b936739 100644 --- a/compat/src/test/scala-jvm/test/scala/collection/LazyListGCTest.scala +++ b/compat/src/test/scala-jvm/test/scala/collection/LazyListGCTest.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 test.scala.collection import org.junit.Assert._ diff --git a/compat/src/test/scala/scala/jdk/CollectionConvertersTest.scala b/compat/src/test/scala/scala/jdk/CollectionConvertersTest.scala index 8eb12800..329bafd9 100644 --- a/compat/src/test/scala/scala/jdk/CollectionConvertersTest.scala +++ b/compat/src/test/scala/scala/jdk/CollectionConvertersTest.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.jdk import java.{lang => jl, util => ju} diff --git a/compat/src/test/scala/scala/util/ChainingOpsTest.scala b/compat/src/test/scala/scala/util/ChainingOpsTest.scala index 5ec37c98..94e95304 100644 --- a/compat/src/test/scala/scala/util/ChainingOpsTest.scala +++ b/compat/src/test/scala/scala/util/ChainingOpsTest.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.util import org.junit.Assert._ diff --git a/compat/src/test/scala/scala/util/UsingTest.scala b/compat/src/test/scala/scala/util/UsingTest.scala index a2f1173e..e401ed28 100644 --- a/compat/src/test/scala/scala/util/UsingTest.scala +++ b/compat/src/test/scala/scala/util/UsingTest.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.util import org.junit.Test diff --git a/compat/src/test/scala/scala/util/control/compat/ControlThrowableTest.scala b/compat/src/test/scala/scala/util/control/compat/ControlThrowableTest.scala index 43caa63a..f7e7cb49 100644 --- a/compat/src/test/scala/scala/util/control/compat/ControlThrowableTest.scala +++ b/compat/src/test/scala/scala/util/control/compat/ControlThrowableTest.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.util.control.compat import org.junit.Test diff --git a/compat/src/test/scala/test/scala/collection/LazyListLazinessTest.scala b/compat/src/test/scala/test/scala/collection/LazyListLazinessTest.scala index 494d476b..883c5418 100644 --- a/compat/src/test/scala/test/scala/collection/LazyListLazinessTest.scala +++ b/compat/src/test/scala/test/scala/collection/LazyListLazinessTest.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 test.scala.collection import org.junit.Test diff --git a/compat/src/test/scala/test/scala/collection/LazyListTest.scala b/compat/src/test/scala/test/scala/collection/LazyListTest.scala index 3126b55b..fbcac1c9 100644 --- a/compat/src/test/scala/test/scala/collection/LazyListTest.scala +++ b/compat/src/test/scala/test/scala/collection/LazyListTest.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 test.scala.collection import org.junit.Test diff --git a/compat/src/test/scala/test/scala/collection/LazyZipTest.scala b/compat/src/test/scala/test/scala/collection/LazyZipTest.scala index a583da52..3754d98a 100644 --- a/compat/src/test/scala/test/scala/collection/LazyZipTest.scala +++ b/compat/src/test/scala/test/scala/collection/LazyZipTest.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 test.scala.collection import org.junit.Assert.assertEquals diff --git a/compat/src/test/scala/test/scala/collection/MapTest.scala b/compat/src/test/scala/test/scala/collection/MapTest.scala index 63a6a233..dbc5eab1 100644 --- a/compat/src/test/scala/test/scala/collection/MapTest.scala +++ b/compat/src/test/scala/test/scala/collection/MapTest.scala @@ -9,6 +9,7 @@ * See the NOTICE file distributed with this work for * additional information regarding copyright ownership. */ + package test.scala.collection import org.junit.Test From aef25bee008e25ef2611bd0544495afba3d63a5f Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 20:16:06 -0600 Subject: [PATCH 08/14] wip --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 15af941f..e4f39b31 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "3.0.0") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.30") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.29") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.1.0") From 0af9dede783f91935a72fe78f6b96bbad42b1b6e Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 20:16:34 -0600 Subject: [PATCH 09/14] wip --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7accfd2e..4d824fac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: java-version: ${{matrix.java}} - name: Test run: sbt test package - - name: Headers - run: sbt headerCheck - name: Version policy run: sbt PolicyCheck + - name: Headers + run: sbt headerCheck From 826a295480e7a0fc5af794028533219bd5b7250a Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 20:18:18 -0600 Subject: [PATCH 10/14] wip --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d824fac..24c6a3d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,9 @@ jobs: java-version: ${{matrix.java}} - name: Test run: sbt test package + - name: Bincompat + run: sbt binary-compat/test - name: Version policy - run: sbt PolicyCheck + run: sbt versionPolicyCheck - name: Headers run: sbt headerCheck From 5d1d2dcdd6893838e64686d70dc5a2f6dea91100 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 20:23:38 -0600 Subject: [PATCH 11/14] wip --- .gitignore | 14 ++++---------- CONTRIBUTING.md | 4 +--- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 0c14c00e..c144fb02 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,5 @@ -/.settings/ -/.idea/ target/ *.log -*.iml /\.target/ /\.cache /\.project @@ -13,16 +10,13 @@ target/ /bin/ /.cache-main /.cache-tests -admin/.coursier -admin/.scalafmt* -# metals +# IDEs and editors +/.settings/ +/.idea/ +*.iml .bloop/ /.metals/ /project/**/metals.sbt - -# sbt - Build Server Protocol /.bsp/ - -# vscode /.vscode/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e21ef57f..bb35ea30 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,9 +53,7 @@ class ToIteratorVsIteratorSrc(xs: Iterable[Int]) { - run sbt and then run the following task `compile`; -5. Format your code with the `scalafmt` sbt task. - -6. Commit your changes, push your branch to your fork and create a pull request. +5. Commit your changes, push your branch to your fork and create a pull request. Then maybe someone will take over and implement your use case… or maybe you will (see next section)! From 9a7ff3c3f120d4641cfbe7941f4d09b5e525a551 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 20:29:08 -0600 Subject: [PATCH 12/14] wip --- .github/workflows/ci.yml | 2 -- .jvmopts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24c6a3d9..b71a9428 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,5 @@ jobs: run: sbt test package - name: Bincompat run: sbt binary-compat/test - - name: Version policy - run: sbt versionPolicyCheck - name: Headers run: sbt headerCheck diff --git a/.jvmopts b/.jvmopts index 7e1a33fa..56aefe05 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1 +1 @@ --Xmx2G +-Xmx4G From 8b39038e2f9007f97ff9769c7126cea006fb103a Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 20:31:51 -0600 Subject: [PATCH 13/14] wip --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index e4f39b31..641ee76a 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "3.0.0") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.29") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.31") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.1.0") From 23d1e4d6a165f03f72c75fbc92107767eb12f42e Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 20:35:11 -0600 Subject: [PATCH 14/14] wip --- .github/workflows/ci.yml | 2 -- README.md | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b71a9428..e6cc9fcc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,5 @@ jobs: java-version: ${{matrix.java}} - name: Test run: sbt test package - - name: Bincompat - run: sbt binary-compat/test - name: Headers run: sbt headerCheck diff --git a/README.md b/README.md index 64b64a26..e68b5798 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ The migration rules use scalafix. Please see the [official installation instruct ```scala // project/plugins.sbt -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.30") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.31") ``` ### Collection213Upgrade