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

[POC] Use Unroll plugin for binary compatibility #113

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 14 additions & 10 deletions build.sc
Expand Up @@ -8,7 +8,7 @@ import com.github.lolgab.mill.mima._

val scala212 = "2.12.17"
val scala213 = "2.13.10"
val scala3 = "3.1.3"
val scala3 = "3.3.1"
Copy link
Member

Choose a reason for hiding this comment

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

Is this intentional? We drop support for older Scala 3 version, which might be Ok, but should be done in a new 0.x bump.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a compiler plugin, so will need separate implementations for each Scala version I think.

It's possible to support 3.1.3, but the initial proof of concept is only against 3.3.1. Will have to decide whether or not to drop 3.1.3 before merging this, but I'd be in favor just to support the 3.3.x LTS versions


val osLib = "0.9.3"
val acyclic = "0.3.11"
Expand Down Expand Up @@ -51,19 +51,23 @@ trait MainArgsPublishModule
super.scalacOptions() ++
Option.when(!isScala3(scalaVersion()))("-P:acyclic:force")

def scalacPluginIvyDeps =
def scalacPluginIvyDeps = T{
super.scalacPluginIvyDeps() ++
Option.when(!isScala3(scalaVersion()))(ivy"com.lihaoyi:::acyclic:${acyclic}")
Agg(ivy"com.lihaoyi::unroll-plugin:0.1.12") ++
Option.when(!isScala3(scalaVersion()))(ivy"com.lihaoyi:::acyclic:${acyclic}")
}

def compileIvyDeps =
super.compileIvyDeps() ++
Agg.when(!isScala3(crossScalaVersion))(
ivy"com.lihaoyi:::acyclic:${acyclic}",
ivy"org.scala-lang:scala-reflect:$crossScalaVersion"
)
Agg.when(!isScala3(crossScalaVersion))(
ivy"com.lihaoyi:::acyclic:${acyclic}",
ivy"org.scala-lang:scala-reflect:$crossScalaVersion",

)

def ivyDeps = Agg(
ivy"org.scala-lang.modules::scala-collection-compat::2.8.1"
ivy"com.lihaoyi::unroll-annotation:0.1.12",
ivy"org.scala-lang.modules::scala-collection-compat::2.8.1",
)
}

Expand All @@ -83,13 +87,13 @@ object mainargs extends Module {

object js extends Cross[JSMainArgsModule](scalaVersions)
trait JSMainArgsModule extends MainArgsPublishModule with ScalaJSModule {
def scalaJSVersion = "1.10.1"
def scalaJSVersion = "1.13.1"
object test extends ScalaJSTests with CommonTestModule
}

object native extends Cross[NativeMainArgsModule](scalaVersions)
trait NativeMainArgsModule extends MainArgsPublishModule with ScalaNativeModule {
def scalaNativeVersion = "0.4.7"
def scalaNativeVersion = "0.4.14"
object test extends ScalaNativeTests with CommonTestModule
}
}
Expand Down