Skip to content
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

Play 2.9 & Scala 3 #321

Merged
merged 8 commits into from
Nov 10, 2023
Merged

Play 2.9 & Scala 3 #321

merged 8 commits into from
Nov 10, 2023

Conversation

AshCorr
Copy link
Contributor

@AshCorr AshCorr commented Nov 8, 2023

What this changes

Play 2.9 was just released, this PR bumps play-mockws to the newest version. Play 3.x has also just been released but will involve some breaking changes, figure some people might have some benefit to having a Play 2.9 version of this library before then.

How this was tested

Tests ran against Scala 2.13 and Scala 3 with:

sbt ++3.3.1! test
sbt ++2.13.1! test

RELEASE-NOTES.md Outdated
Copy link
Contributor Author

@AshCorr AshCorr Nov 8, 2023

Choose a reason for hiding this comment

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

Included the changes to RELEASE-NOTES.md, version.sbt, and README.md to release 2.9, but feel free to drop these changes if you want to make them yourself!

@AshCorr AshCorr force-pushed the ash/play-2.9 branch 4 times, most recently from d97acb7 to 2827377 Compare November 8, 2023 11:15
@AshCorr AshCorr changed the title Play 2.9 Play 2.9 & Scala 3 Nov 8, 2023
@AshCorr AshCorr force-pushed the ash/play-2.9 branch 3 times, most recently from e351f57 to d45833a Compare November 8, 2023 13:00
@@ -1 +1 @@
sbt.version = 1.3.12
sbt.version = 1.5.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Scala 3 requires atleast SBT 1.5

Copy link
Collaborator

Choose a reason for hiding this comment

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

Play 2.9 requires at least sbt 1.9.6, not sure how this affect libraries such as this one though but upgrading to sbt 1.9.7 should be straightforward, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -45,16 +45,16 @@ class AuthenticationTest extends AnyFunSuite with Matchers with ScalaCheckProper
}

a[UnsupportedOperationException] shouldBe thrownBy(
await(ws.url("/").withAuth("user", "s3cr3t", WSAuthScheme.NTLM).get)
await(ws.url("/").withAuth("user", "s3cr3t", WSAuthScheme.NTLM).get())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Functions must be called using parenthesis in Scala now

@@ -20,6 +20,9 @@ import scala.concurrent.Future
import scala.concurrent.duration._
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
import play.api.libs.ws.writeableOf_String
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are implicit BodyParser implementations for reading and writting Strings to request bodies. They now need to be imported explicitly in Scala 3 (I think? Scala 3 compilation wouldn't work unless I did).

Copy link
Collaborator

Choose a reason for hiding this comment

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

I had the same "issue" in my projects, not sure if that's really intended though.

@AshCorr AshCorr marked this pull request as ready for review November 8, 2023 13:05
@AshCorr AshCorr mentioned this pull request Nov 8, 2023
Copy link
Collaborator

@avdv avdv left a comment

Choose a reason for hiding this comment

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

Thank you, LGTM.

@avdv avdv merged commit 14c0e06 into leanovate:master Nov 10, 2023
3 checks passed
@@ -22,21 +22,21 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.10, 2.13.1]
java: [temurin@8]
scala: [2.13.1, 3.3.1]
Copy link

Choose a reason for hiding this comment

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

Why 2.13.1? The latest 2.13.x release is 2.13.12
Is this a typo, like everywhere in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2.13.1 was the previously set version of Scala that this project was using, I avoided bumping anything more than I needed to get this project to work with Play 2.9 and Scala 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants