From 6d89b9565c1a70046db35b779b6f100bb60333b8 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 21:33:24 -0600 Subject: [PATCH 1/9] fix headerCheck --- 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 f2cec653..a37d605c 100644 --- a/build.sbt +++ b/build.sbt @@ -212,6 +212,7 @@ lazy val `scalafix-input` = project .settings( scalaVersion := scalafixScala212, publish / skip := true, + excludeFilter := HiddenFileFilter || "*.scala", // exclude from headerCheck addCompilerPlugin(scalafixSemanticdb), scalacOptions ++= Seq( "-Yrangepos", @@ -225,7 +226,10 @@ val `scalafix-output` = MultiScalaProject( "scalafix/output", _.settings(sharedScalafixSettings) .settings(commonSettings) - .settings(publish / skip := true) + .settings( + publish / skip := true, + excludeFilter := HiddenFileFilter || "*.scala", // exclude from headerCheck + ) .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 df9d8dbd251fef9ec94f625700b2cfb7cc39cc55 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 21:33:43 -0600 Subject: [PATCH 2/9] minor readme adjustments --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9d72f527..0c2614f8 100644 --- a/README.md +++ b/README.md @@ -1,5 +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. @@ -17,7 +15,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 +49,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.31") ``` ### Collection213Upgrade From e2616f8c80f32882122ddbf24d0e288c60101bf1 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 21:33:59 -0600 Subject: [PATCH 3/9] bring Scala version in .travis.yml in line with build.sbt --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2b564fb1..2eb6a0aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ scala: - 2.11.12 - 2.12.15 - 2.13.6 - - 3.0.1 + - 3.0.2 env: - SCALAJS_VERSION= ADOPTOPENJDK=8 @@ -37,7 +37,7 @@ matrix: # Scala Native doesn't support Scala 3 yet - - scala: 3.0.1 + - scala: 3.0.2 env: SCALANATIVE_VERSION=0.4.0 ADOPTOPENJDK=8 install: From 1ea3e8372878e2b687c446651fb3d49939fb5470 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 21:35:10 -0600 Subject: [PATCH 4/9] minor cleanup in build.sbt --- build.sbt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/build.sbt b/build.sbt index a37d605c..1050f008 100644 --- a/build.sbt +++ b/build.sbt @@ -1,10 +1,6 @@ import _root_.scalafix.sbt.BuildInfo.{scalafixVersion, scala212 => scalafixScala212} -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. @@ -60,11 +56,12 @@ lazy val scala30 = "3.0.2" lazy val compat = MultiScalaCrossProject(JSPlatform, JVMPlatform, NativePlatform)( "compat", - _.settings(scalaModuleSettings) + _.settings(ScalaModulePlugin.scalaModuleSettings) .settings(commonSettings) .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" @@ -170,9 +167,10 @@ lazy val `binary-compat` = project lazy val `scalafix-rules` = project .in(file("scalafix/rules")) - .settings(scalaModuleSettings) + .settings(ScalaModulePlugin.scalaModuleSettings) .settings(commonSettings) .settings( + scalaModuleAutomaticModuleName := None, organization := (compat212JVM / organization).value, publishTo := (compat212JVM / publishTo).value, versionPolicyIntention := Compatibility.None, @@ -303,7 +301,8 @@ val isBinaryCompat = sys.env.get("TEST_BINARY_COMPAT").nonEmpty val jdkVersion = sys.env.get("ADOPTOPENJDK").map(_.toInt) // required by sbt-scala-module -inThisBuild( +inThisBuild { + import scala.sys.process._ Seq( commands += Command.command("scalafmt-test") { state => val exitCode = Seq("admin/scalafmt.sh", "--test") ! state.globalLogging.full @@ -389,4 +388,4 @@ inThisBuild( state.copy(remainingCommands = newCommands ::: state.remainingCommands) } ) -) +} From 70556f6bff683edc6d658b8f263663c0a6c0654b Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 21:35:34 -0600 Subject: [PATCH 5/9] cleanup in project/plugins.sbt --- project/plugins.sbt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 35ade440..e0dda919 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,13 +1,7 @@ -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-js" % "sbt-scalajs" % "1.7.0") +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0") +addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.1.0") addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.4.0") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.31") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") From a67c861fff6c32ca6d6612eb0ba0ac8f760e67ca Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 21:36:21 -0600 Subject: [PATCH 6/9] upgrade to sbt-scala-module 3.0.0 (was 2.4.0) --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index e0dda919..ce41a12e 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,6 +2,6 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0 addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.1.0") -addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.4.0") +addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "3.0.0") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.31") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") From 78c0a97400f1db63f577a550392f923c9ef1d426 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 21:37:40 -0600 Subject: [PATCH 7/9] enforce headerCheck in CI --- build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sbt b/build.sbt index 1050f008..961aa2e3 100644 --- a/build.sbt +++ b/build.sbt @@ -375,6 +375,7 @@ inThisBuild { List(s"$projectPrefix/clean"), List(s"$testProjectPrefix/test"), List(s"$projectPrefix/publishLocal"), + List("headerCheck"), publishTask ).flatten } From da8296afbbcb39b30c31e675c2b58f64655e7aca Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 21:39:16 -0600 Subject: [PATCH 8/9] remove CLA check this will be re-added uniformly across modules later; see scala/scala-dev#792 --- .travis.yml | 3 --- admin/checkCLA.sh | 20 -------------------- 2 files changed, 23 deletions(-) delete mode 100755 admin/checkCLA.sh diff --git a/.travis.yml b/.travis.yml index 2eb6a0aa..e0f69674 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,4 @@ matrix: install: - git fetch --tags # get all tags for sbt-dynver -before_script: - - admin/checkCLA.sh - script: sbt ci 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; From 09e5cebf0ac3fc3583e4b17944e59a443f967be8 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 4 Oct 2021 21:58:57 -0600 Subject: [PATCH 9/9] eliminate use of backticked project names --- CONTRIBUTING.md | 2 +- build.sbt | 86 ++++++++++++++++++++++++------------------------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e21ef57f..8852f93d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,7 +69,7 @@ sbt task to run the migration tool on the input files and check whether the resu expected output files: ~~~ -> scalafix-tests/test +> scalafixTests/test ~~~ Fix the implementation of the rule (in the `rules/src/main/scala/fix/NewCollections.scala` file) until the diff --git a/build.sbt b/build.sbt index 961aa2e3..824f9ce1 100644 --- a/build.sbt +++ b/build.sbt @@ -32,16 +32,16 @@ lazy val root = project compat213Native, compat30JVM, compat30JS, - `scalafix-data211`, - `scalafix-data212`, - `scalafix-data213`, - `scalafix-input`, - `scalafix-output211`, - `scalafix-output212`, - `scalafix-output213`, - // `scalafix-output213-failure`, - `scalafix-rules`, - `scalafix-tests` + scalafixData211, + scalafixData212, + scalafixData213, + scalafixInput, + scalafixOutput211, + scalafixOutput212, + scalafixOutput213, + // scalafixOutput213Failure, + scalafixRules, + scalafixTests ) .disablePlugins(ScalafixPlugin) @@ -129,20 +129,20 @@ lazy val compat213Native = compat213.native lazy val compat30JVM = compat30.jvm lazy val compat30JS = compat30.js -lazy val `binary-compat-old` = project +lazy val binaryCompatOld = project .in(file("binary-compat/old")) .settings(commonSettings) .settings(scalaVersion := scala212) .disablePlugins(ScalafixPlugin) -lazy val `binary-compat-new` = project +lazy val binaryCompatNew = project .in(file("binary-compat/new")) .settings(commonSettings) .settings(scalaVersion := scala212) .dependsOn(compat212JVM) .disablePlugins(ScalafixPlugin) -lazy val `binary-compat` = project +lazy val binaryCompat = project .in(file("binary-compat/test")) .settings(commonSettings) .settings( @@ -152,20 +152,20 @@ lazy val `binary-compat` = project versionPolicyIntention := Compatibility.None, buildInfoPackage := "build", buildInfoKeys := Seq[BuildInfoKey]( - "oldClasses" -> (`binary-compat-old` / Compile / classDirectory).value.toString, - "newClasses" -> (`binary-compat-new` / Compile / classDirectory).value.toString + "oldClasses" -> (binaryCompatOld / Compile / classDirectory).value.toString, + "newClasses" -> (binaryCompatNew / Compile / classDirectory).value.toString ), Test / test := (Test / test) .dependsOn( - `binary-compat-old` / Compile / compile, - `binary-compat-new` / Compile / compile, + binaryCompatOld / Compile / compile, + binaryCompatNew / Compile / compile, ) .value ) .enablePlugins(BuildInfoPlugin) .disablePlugins(ScalafixPlugin) -lazy val `scalafix-rules` = project +lazy val scalafixRules = project .in(file("scalafix/rules")) .settings(ScalaModulePlugin.scalaModuleSettings) .settings(commonSettings) @@ -191,19 +191,19 @@ lazy val sharedScalafixSettings = Seq( ) // common part between input/output -lazy val `scalafix-data` = MultiScalaProject( - "scalafix-data", +lazy val scalafixData = MultiScalaProject( + "scalafixData", "scalafix/data", _.settings(sharedScalafixSettings) .settings(commonSettings) .settings(publish / skip := true) ) -val `scalafix-data211` = `scalafix-data`(scala211, _.dependsOn(compat211JVM)) -val `scalafix-data212` = `scalafix-data`(scalafixScala212, _.dependsOn(compat212JVM)) -val `scalafix-data213` = `scalafix-data`(scala213, _.dependsOn(compat213JVM)) +val scalafixData211 = scalafixData(scala211, _.dependsOn(compat211JVM)) +val scalafixData212 = scalafixData(scalafixScala212, _.dependsOn(compat212JVM)) +val scalafixData213 = scalafixData(scala213, _.dependsOn(compat213JVM)) -lazy val `scalafix-input` = project +lazy val scalafixInput = project .in(file("scalafix/input")) .settings(commonSettings) .settings(sharedScalafixSettings) @@ -217,10 +217,10 @@ lazy val `scalafix-input` = project "-P:semanticdb:synthetics:on" ) ) - .dependsOn(`scalafix-data212`) + .dependsOn(scalafixData212) -val `scalafix-output` = MultiScalaProject( - "scalafix-output", +val scalafixOutput = MultiScalaProject( + "scalafixOutput", "scalafix/output", _.settings(sharedScalafixSettings) .settings(commonSettings) @@ -246,32 +246,32 @@ lazy val output213 = Def.setting((ThisBuild / baseDirectory).value / "scalafix/output213/src/main/scala") lazy val addOutput213 = Compile / unmanagedSourceDirectories += output213.value -lazy val `scalafix-output211` = `scalafix-output`( +lazy val scalafixOutput211 = scalafixOutput( scala211, - _.dependsOn(`scalafix-data211`) + _.dependsOn(scalafixData211) ) -lazy val `scalafix-output212` = `scalafix-output`( +lazy val scalafixOutput212 = scalafixOutput( scala212, _.settings(addOutput212) .settings(addOutput212Plus) - .dependsOn(`scalafix-data212`) + .dependsOn(scalafixData212) ) -lazy val `scalafix-output213` = `scalafix-output`( +lazy val scalafixOutput213 = scalafixOutput( scala213, _.settings(addOutput213) .settings(addOutput212Plus) - .dependsOn(`scalafix-data213`) + .dependsOn(scalafixData213) ) -lazy val `scalafix-output213-failure` = project +lazy val scalafixOutput213Failure = project .in(file("scalafix/output213-failure")) .settings(commonSettings) .settings(sharedScalafixSettings) .settings(publish / skip := true) -lazy val `scalafix-tests` = project +lazy val scalafixTests = project .in(file("scalafix/tests")) .settings(commonSettings) .settings(sharedScalafixSettings) @@ -285,10 +285,10 @@ lazy val `scalafix-tests` = project output212Plus.value, output213.value ), - scalafixTestkitInputSourceDirectories := (`scalafix-input` / Compile / sourceDirectories).value, - scalafixTestkitInputClasspath := (`scalafix-input` / Compile / fullClasspath).value, + scalafixTestkitInputSourceDirectories := (scalafixInput / Compile / sourceDirectories).value, + scalafixTestkitInputClasspath := (scalafixInput / Compile / fullClasspath).value, ) - .dependsOn(`scalafix-input`, `scalafix-rules`) + .dependsOn(scalafixInput, scalafixRules) .enablePlugins(BuildInfoPlugin, ScalafixTestkitPlugin) val travisScalaVersion = sys.env.get("TRAVIS_SCALA_VERSION").flatMap(Version.parse) @@ -304,7 +304,7 @@ val jdkVersion = sys.env.get("ADOPTOPENJDK").map(_.toInt) inThisBuild { import scala.sys.process._ Seq( - commands += Command.command("scalafmt-test") { state => + commands += Command.command("scalafmtTest") { state => val exitCode = Seq("admin/scalafmt.sh", "--test") ! state.globalLogging.full if (exitCode == 0) state else state.fail }, @@ -315,7 +315,7 @@ inThisBuild { commands += Command.command("ci") { state => val toRun: Seq[String] = if (isScalafmt) { - Seq("scalafmt-test") + Seq("scalafmtTest") } else { List( "TRAVIS_SCALA_VERSION", @@ -331,11 +331,11 @@ inThisBuild { val platformSuffix = if (isScalaJs) "JS" else if (isScalaNative) "Native" else "" val compatProject = "compat" + travisScalaVersion.get.binary + platformSuffix - val binaryCompatProject = "binary-compat" + val binaryCompatProject = "binaryCompat" val testProjectPrefix = if (isScalafix) { - "scalafix-tests" + "scalafixTests" } else if (isBinaryCompat) { binaryCompatProject } else { @@ -344,7 +344,7 @@ inThisBuild { val projectPrefix = if (isScalafix) { - "scalafix-rules" + "scalafixRules" } else if (isBinaryCompat) { binaryCompatProject } else {