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

Cross-build with Scala 3 #3527

Merged
merged 12 commits into from
Jan 7, 2025
Merged

Cross-build with Scala 3 #3527

merged 12 commits into from
Jan 7, 2025

Conversation

fthomas
Copy link
Member

@fthomas fthomas commented Jan 7, 2025

No description provided.

fthomas added 12 commits January 7, 2025 08:27
... since it is not available for Scala 3
This fixes warnings like
```
 -- [E175] Potential Issue Warning: modules/core/src/main/scala/org/scalasteward/core/client/ClientConfiguration.scala:52:31
 52 |          builder.sslParameters(params)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |       discarded non-Unit value of type java.net.http.HttpClient#Builder
```
This fixes warnings like
```
 -- Warning: modules/core/src/main/scala/org/scalasteward/core/nurture/UpdateInfoUrlFinder.scala:92:17
 92 |      customUrls(CustomReleaseNotes, possibleReleaseNotesFilenames) ++
    |                 ^^^^^^^^^^^^^^^^^^
    |The method `apply` is inserted. The auto insertion will be deprecated, please write `org.scalasteward.core.nurture.UpdateInfoUrl.CustomReleaseNotes.apply` explicitly.
```
... to fix these errors
```
 -- [E008] Not Found Error: modules/core/src/main/scala/org/scalasteward/core/repoconfig/PullRequestFrequency.scala:33:43
 33 |      case CronExpr(expr) => expr.datePart.allOf(now.toLocalDateTime)
    |                             ^^^^^^^^^^^^^^^^^^^
    |value allOf is not a member of cron4s.expr.DateCronExpr, but could be made available as an extension method.

 -- [E008] Not Found Error: modules/core/src/main/scala/org/scalasteward/core/repoconfig/PullRequestFrequency.scala:41:34
 41 |      case CronExpr(expr) => expr.next(lastCreated.toLocalDateTime).map(Timestamp.fromLocalDateTime)
    |                             ^^^^^^^^^
    |value next is not a member of cron4s.CronExpr, but could be made available as an extension method.
```
This fixes
```
 -- [E198] Unused Symbol Warning: modules/core/src/main/scala/org/scalasteward/core/repoconfig/UpdatesConfig.scala:29:54
 29 |import org.scalasteward.core.repoconfig.UpdatesConfig.defaultLimit
    |                                                      ^^^^^^^^^^^^
    |                                                      unused import
```
... to fix
```
 -- [E008] Not Found Error: modules/core/src/test/scala/org/scalasteward/core/BuiltinConfigFilesTest.scala:37:9
 35 |      val migrations = artifactMigrationsLoader
 36 |        .loadAll(ArtifactCfg(List(), disableDefaults = false))
 37 |        .runA(initialState)
    |                       ^
    |value runA is not a member of org.scalasteward.core.mock.MockEff[
    |  List[org.scalasteward.core.update.artifact.ArtifactChange]], but could be made available as an extension method.
    |
    |The following import might fix the problem:
    |
    |  import org.scalasteward.core.mock.MockEffOps
```
This fixes
```
 -- [E178] Type Error: modules/core/src/test/scala/org/scalasteward/core/util/uriTest.scala:11:6
 11 |      uri.withUserInfo.replace(UserInfo("user", Some("pass")))(url).toString,
    |      ^^^
    |      missing argument list for method uri in trait LiteralsSyntax
    |
    |        inline def uri(ctx: StringContext)(args: Any*): org.http4s.Uri
    |
    | longer explanation available when compiling with `-explain`
```
which was caused by the ambiguous `uri` reference.
Adding Scala 3 to `doc/crossScalaVersions` results in the following
error
```
sbt:scala-steward> doc/mdoc
[error] Modules were resolved with conflicting cross-version suffixes in ProjectRef(uri("."), "docs"):
[error]    org.scala-lang.modules:scala-collection-compat _3, _2.13
[error]    com.github.plokhotnyuk.jsoniter-scala:jsoniter-scala-core _3, _2.13
```
which I believe is due to using `for3Use2_13` for Coursier. I therefore
kept the `doc` project Scala 2-only and added the `-tasty-reader`
scalac option to prevent this error
```
sbt:scala-steward> doc/mdoc
[info] running mdoc.SbtMain
error: error while loading Cli, Missing dependency 'Add -Ytasty-reader to scalac options to parse the TASTy in modules/core/.jvm/target/scala-3.3.4/classes/org/scalasteward/core/application/Cli.tasty', required by modules/core/.jvm/target/scala-3.3.4/classes/org/scalasteward/core/application/Cli.tasty
[error] java.lang.RuntimeException: mdoc failed
```
@fthomas fthomas added this to the 0.32.2 milestone Jan 7, 2025
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.78%. Comparing base (a35f3dc) to head (4bf0b66).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3527      +/-   ##
==========================================
+ Coverage   89.73%   89.78%   +0.04%     
==========================================
  Files         171      171              
  Lines        3537     4983    +1446     
  Branches      330      504     +174     
==========================================
+ Hits         3174     4474    +1300     
- Misses        363      509     +146     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fthomas fthomas mentioned this pull request Jan 7, 2025
Copy link
Contributor

@exoego exoego left a comment

Choose a reason for hiding this comment

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

Finally!!
Great job!!

Copy link
Member

@alejandrohdezma alejandrohdezma left a comment

Choose a reason for hiding this comment

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

👏🏼 👏🏼 👏🏼 🥳

Copy link
Member

@mzuehlke mzuehlke left a comment

Choose a reason for hiding this comment

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

Well done 🚀

@fthomas
Copy link
Member Author

fthomas commented Jan 7, 2025

Thanks guys!

@fthomas fthomas merged commit eb87eff into main Jan 7, 2025
19 checks passed
@fthomas fthomas deleted the topic/scala-3 branch January 7, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants