Skip to content

Commit 374a634

Browse files
authored
Merge pull request #486 from SethTisue/bye-bye-travis-ci-try-2
upgrade to sbt-scala-module 3.0.0
2 parents 00985ac + 09e5ceb commit 374a634

File tree

18 files changed

+189
-94
lines changed

18 files changed

+189
-94
lines changed

.travis.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ scala:
88
- 2.11.12
99
- 2.12.15
1010
- 2.13.6
11-
- 3.0.1
11+
- 3.0.2
1212

1313
env:
1414
- SCALAJS_VERSION= ADOPTOPENJDK=8
@@ -37,13 +37,10 @@ matrix:
3737

3838
# Scala Native doesn't support Scala 3 yet
3939

40-
- scala: 3.0.1
40+
- scala: 3.0.2
4141
env: SCALANATIVE_VERSION=0.4.0 ADOPTOPENJDK=8
4242

4343
install:
4444
- git fetch --tags # get all tags for sbt-dynver
4545

46-
before_script:
47-
- admin/checkCLA.sh
48-
4946
script: sbt ci

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ sbt task to run the migration tool on the input files and check whether the resu
6969
expected output files:
7070

7171
~~~
72-
> scalafix-tests/test
72+
> scalafixTests/test
7373
~~~
7474

7575
Fix the implementation of the rule (in the `rules/src/main/scala/fix/NewCollections.scala` file) until the

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
[![Build Status](https://travis-ci.org/scala/scala-collection-compat.svg?branch=master)](https://travis-ci.org/scala/scala-collection-compat)
2-
31
## Purpose and scope
42

53
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
1715
To use this library, add the following to your `build.sbt`:
1816

1917
```
20-
libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "2.5.0"
18+
libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "<version>"
2119
```
2220

2321
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`
5149

5250
## Migration rules
5351

54-
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).
52+
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).
5553

5654
```scala
5755
// project/plugins.sbt
58-
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.29")
56+
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.31")
5957
```
6058

6159
### Collection213Upgrade

admin/checkCLA.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

build.sbt

Lines changed: 56 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import _root_.scalafix.sbt.BuildInfo.{scalafixVersion, scala212 => scalafixScala212}
2-
import com.lightbend.tools.scalamoduleplugin.ScalaModulePlugin._
3-
4-
import scala.sys.process._
52

63
lazy val commonSettings = Seq(
7-
scalaModuleAutomaticModuleName := Some("scala.collection.compat"),
84
headerLicense := Some(HeaderLicense.Custom(s"""|Scala (https://www.scala-lang.org)
95
|
106
|Copyright EPFL and Lightbend, Inc.
@@ -36,16 +32,16 @@ lazy val root = project
3632
compat213Native,
3733
compat30JVM,
3834
compat30JS,
39-
`scalafix-data211`,
40-
`scalafix-data212`,
41-
`scalafix-data213`,
42-
`scalafix-input`,
43-
`scalafix-output211`,
44-
`scalafix-output212`,
45-
`scalafix-output213`,
46-
// `scalafix-output213-failure`,
47-
`scalafix-rules`,
48-
`scalafix-tests`
35+
scalafixData211,
36+
scalafixData212,
37+
scalafixData213,
38+
scalafixInput,
39+
scalafixOutput211,
40+
scalafixOutput212,
41+
scalafixOutput213,
42+
// scalafixOutput213Failure,
43+
scalafixRules,
44+
scalafixTests
4945
)
5046
.disablePlugins(ScalafixPlugin)
5147

@@ -60,11 +56,12 @@ lazy val scala30 = "3.0.2"
6056

6157
lazy val compat = MultiScalaCrossProject(JSPlatform, JVMPlatform, NativePlatform)(
6258
"compat",
63-
_.settings(scalaModuleSettings)
59+
_.settings(ScalaModulePlugin.scalaModuleSettings)
6460
.settings(commonSettings)
6561
.settings(
6662
name := "scala-collection-compat",
6763
moduleName := "scala-collection-compat",
64+
scalaModuleAutomaticModuleName := Some("scala.collection.compat"),
6865
scalacOptions ++= Seq("-feature", "-language:higherKinds", "-language:implicitConversions"),
6966
Compile / unmanagedSourceDirectories += {
7067
val sharedSourceDir = (ThisBuild / baseDirectory).value / "compat/src/main"
@@ -132,20 +129,20 @@ lazy val compat213Native = compat213.native
132129
lazy val compat30JVM = compat30.jvm
133130
lazy val compat30JS = compat30.js
134131

135-
lazy val `binary-compat-old` = project
132+
lazy val binaryCompatOld = project
136133
.in(file("binary-compat/old"))
137134
.settings(commonSettings)
138135
.settings(scalaVersion := scala212)
139136
.disablePlugins(ScalafixPlugin)
140137

141-
lazy val `binary-compat-new` = project
138+
lazy val binaryCompatNew = project
142139
.in(file("binary-compat/new"))
143140
.settings(commonSettings)
144141
.settings(scalaVersion := scala212)
145142
.dependsOn(compat212JVM)
146143
.disablePlugins(ScalafixPlugin)
147144

148-
lazy val `binary-compat` = project
145+
lazy val binaryCompat = project
149146
.in(file("binary-compat/test"))
150147
.settings(commonSettings)
151148
.settings(
@@ -155,24 +152,25 @@ lazy val `binary-compat` = project
155152
versionPolicyIntention := Compatibility.None,
156153
buildInfoPackage := "build",
157154
buildInfoKeys := Seq[BuildInfoKey](
158-
"oldClasses" -> (`binary-compat-old` / Compile / classDirectory).value.toString,
159-
"newClasses" -> (`binary-compat-new` / Compile / classDirectory).value.toString
155+
"oldClasses" -> (binaryCompatOld / Compile / classDirectory).value.toString,
156+
"newClasses" -> (binaryCompatNew / Compile / classDirectory).value.toString
160157
),
161158
Test / test := (Test / test)
162159
.dependsOn(
163-
`binary-compat-old` / Compile / compile,
164-
`binary-compat-new` / Compile / compile,
160+
binaryCompatOld / Compile / compile,
161+
binaryCompatNew / Compile / compile,
165162
)
166163
.value
167164
)
168165
.enablePlugins(BuildInfoPlugin)
169166
.disablePlugins(ScalafixPlugin)
170167

171-
lazy val `scalafix-rules` = project
168+
lazy val scalafixRules = project
172169
.in(file("scalafix/rules"))
173-
.settings(scalaModuleSettings)
170+
.settings(ScalaModulePlugin.scalaModuleSettings)
174171
.settings(commonSettings)
175172
.settings(
173+
scalaModuleAutomaticModuleName := None,
176174
organization := (compat212JVM / organization).value,
177175
publishTo := (compat212JVM / publishTo).value,
178176
versionPolicyIntention := Compatibility.None,
@@ -193,39 +191,43 @@ lazy val sharedScalafixSettings = Seq(
193191
)
194192

195193
// common part between input/output
196-
lazy val `scalafix-data` = MultiScalaProject(
197-
"scalafix-data",
194+
lazy val scalafixData = MultiScalaProject(
195+
"scalafixData",
198196
"scalafix/data",
199197
_.settings(sharedScalafixSettings)
200198
.settings(commonSettings)
201199
.settings(publish / skip := true)
202200
)
203201

204-
val `scalafix-data211` = `scalafix-data`(scala211, _.dependsOn(compat211JVM))
205-
val `scalafix-data212` = `scalafix-data`(scalafixScala212, _.dependsOn(compat212JVM))
206-
val `scalafix-data213` = `scalafix-data`(scala213, _.dependsOn(compat213JVM))
202+
val scalafixData211 = scalafixData(scala211, _.dependsOn(compat211JVM))
203+
val scalafixData212 = scalafixData(scalafixScala212, _.dependsOn(compat212JVM))
204+
val scalafixData213 = scalafixData(scala213, _.dependsOn(compat213JVM))
207205

208-
lazy val `scalafix-input` = project
206+
lazy val scalafixInput = project
209207
.in(file("scalafix/input"))
210208
.settings(commonSettings)
211209
.settings(sharedScalafixSettings)
212210
.settings(
213211
scalaVersion := scalafixScala212,
214212
publish / skip := true,
213+
excludeFilter := HiddenFileFilter || "*.scala", // exclude from headerCheck
215214
addCompilerPlugin(scalafixSemanticdb),
216215
scalacOptions ++= Seq(
217216
"-Yrangepos",
218217
"-P:semanticdb:synthetics:on"
219218
)
220219
)
221-
.dependsOn(`scalafix-data212`)
220+
.dependsOn(scalafixData212)
222221

223-
val `scalafix-output` = MultiScalaProject(
224-
"scalafix-output",
222+
val scalafixOutput = MultiScalaProject(
223+
"scalafixOutput",
225224
"scalafix/output",
226225
_.settings(sharedScalafixSettings)
227226
.settings(commonSettings)
228-
.settings(publish / skip := true)
227+
.settings(
228+
publish / skip := true,
229+
excludeFilter := HiddenFileFilter || "*.scala", // exclude from headerCheck
230+
)
229231
.disablePlugins(ScalafixPlugin)
230232
)
231233

@@ -244,32 +246,32 @@ lazy val output213 =
244246
Def.setting((ThisBuild / baseDirectory).value / "scalafix/output213/src/main/scala")
245247
lazy val addOutput213 = Compile / unmanagedSourceDirectories += output213.value
246248

247-
lazy val `scalafix-output211` = `scalafix-output`(
249+
lazy val scalafixOutput211 = scalafixOutput(
248250
scala211,
249-
_.dependsOn(`scalafix-data211`)
251+
_.dependsOn(scalafixData211)
250252
)
251253

252-
lazy val `scalafix-output212` = `scalafix-output`(
254+
lazy val scalafixOutput212 = scalafixOutput(
253255
scala212,
254256
_.settings(addOutput212)
255257
.settings(addOutput212Plus)
256-
.dependsOn(`scalafix-data212`)
258+
.dependsOn(scalafixData212)
257259
)
258260

259-
lazy val `scalafix-output213` = `scalafix-output`(
261+
lazy val scalafixOutput213 = scalafixOutput(
260262
scala213,
261263
_.settings(addOutput213)
262264
.settings(addOutput212Plus)
263-
.dependsOn(`scalafix-data213`)
265+
.dependsOn(scalafixData213)
264266
)
265267

266-
lazy val `scalafix-output213-failure` = project
268+
lazy val scalafixOutput213Failure = project
267269
.in(file("scalafix/output213-failure"))
268270
.settings(commonSettings)
269271
.settings(sharedScalafixSettings)
270272
.settings(publish / skip := true)
271273

272-
lazy val `scalafix-tests` = project
274+
lazy val scalafixTests = project
273275
.in(file("scalafix/tests"))
274276
.settings(commonSettings)
275277
.settings(sharedScalafixSettings)
@@ -283,10 +285,10 @@ lazy val `scalafix-tests` = project
283285
output212Plus.value,
284286
output213.value
285287
),
286-
scalafixTestkitInputSourceDirectories := (`scalafix-input` / Compile / sourceDirectories).value,
287-
scalafixTestkitInputClasspath := (`scalafix-input` / Compile / fullClasspath).value,
288+
scalafixTestkitInputSourceDirectories := (scalafixInput / Compile / sourceDirectories).value,
289+
scalafixTestkitInputClasspath := (scalafixInput / Compile / fullClasspath).value,
288290
)
289-
.dependsOn(`scalafix-input`, `scalafix-rules`)
291+
.dependsOn(scalafixInput, scalafixRules)
290292
.enablePlugins(BuildInfoPlugin, ScalafixTestkitPlugin)
291293

292294
val travisScalaVersion = sys.env.get("TRAVIS_SCALA_VERSION").flatMap(Version.parse)
@@ -299,9 +301,10 @@ val isBinaryCompat = sys.env.get("TEST_BINARY_COMPAT").nonEmpty
299301
val jdkVersion = sys.env.get("ADOPTOPENJDK").map(_.toInt)
300302

301303
// required by sbt-scala-module
302-
inThisBuild(
304+
inThisBuild {
305+
import scala.sys.process._
303306
Seq(
304-
commands += Command.command("scalafmt-test") { state =>
307+
commands += Command.command("scalafmtTest") { state =>
305308
val exitCode = Seq("admin/scalafmt.sh", "--test") ! state.globalLogging.full
306309
if (exitCode == 0) state else state.fail
307310
},
@@ -312,7 +315,7 @@ inThisBuild(
312315
commands += Command.command("ci") { state =>
313316
val toRun: Seq[String] =
314317
if (isScalafmt) {
315-
Seq("scalafmt-test")
318+
Seq("scalafmtTest")
316319
} else {
317320
List(
318321
"TRAVIS_SCALA_VERSION",
@@ -328,11 +331,11 @@ inThisBuild(
328331
val platformSuffix = if (isScalaJs) "JS" else if (isScalaNative) "Native" else ""
329332

330333
val compatProject = "compat" + travisScalaVersion.get.binary + platformSuffix
331-
val binaryCompatProject = "binary-compat"
334+
val binaryCompatProject = "binaryCompat"
332335

333336
val testProjectPrefix =
334337
if (isScalafix) {
335-
"scalafix-tests"
338+
"scalafixTests"
336339
} else if (isBinaryCompat) {
337340
binaryCompatProject
338341
} else {
@@ -341,7 +344,7 @@ inThisBuild(
341344

342345
val projectPrefix =
343346
if (isScalafix) {
344-
"scalafix-rules"
347+
"scalafixRules"
345348
} else if (isBinaryCompat) {
346349
binaryCompatProject
347350
} else {
@@ -372,6 +375,7 @@ inThisBuild(
372375
List(s"$projectPrefix/clean"),
373376
List(s"$testProjectPrefix/test"),
374377
List(s"$projectPrefix/publishLocal"),
378+
List("headerCheck"),
375379
publishTask
376380
).flatten
377381
}
@@ -385,4 +389,4 @@ inThisBuild(
385389
state.copy(remainingCommands = newCommands ::: state.remainingCommands)
386390
}
387391
)
388-
)
392+
}

compat/src/main/scala-2.11_2.12/scala/jdk/CollectionConverters.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
/*
2+
* Scala (https://www.scala-lang.org)
3+
*
4+
* Copyright EPFL and Lightbend, Inc.
5+
*
6+
* Licensed under Apache License 2.0
7+
* (http://www.apache.org/licenses/LICENSE-2.0).
8+
*
9+
* See the NOTICE file distributed with this work for
10+
* additional information regarding copyright ownership.
11+
*/
12+
113
package scala.jdk
214

315
import scala.collection.convert.{DecorateAsJava, DecorateAsScala}

compat/src/main/scala-2.11_2.12/scala/util/control/compat/ControlThrowable.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* See the NOTICE file distributed with this work for
1010
* additional information regarding copyright ownership.
1111
*/
12+
1213
package scala.util.control.compat
1314

1415
/** A parent class for throwable objects intended for flow control.

compat/src/main/scala-2.13/scala/util/control/compat/package.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
/*
2+
* Scala (https://www.scala-lang.org)
3+
*
4+
* Copyright EPFL and Lightbend, Inc.
5+
*
6+
* Licensed under Apache License 2.0
7+
* (http://www.apache.org/licenses/LICENSE-2.0).
8+
*
9+
* See the NOTICE file distributed with this work for
10+
* additional information regarding copyright ownership.
11+
*/
12+
113
package scala.util.control
214

315
package object compat {

0 commit comments

Comments
 (0)