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

If possible, simplify the build #616

Open
afsalthaj opened this issue Sep 12, 2021 · 0 comments
Open

If possible, simplify the build #616

afsalthaj opened this issue Sep 12, 2021 · 0 comments

Comments

@afsalthaj
Copy link
Collaborator

For instance, refer to the below snippet that talks about scala versions in the library.

 private val versions: Map[String, String] = {
    import org.snakeyaml.engine.v2.api.{Load, LoadSettings}

    import java.util.{List => JList, Map => JMap}
    import scala.jdk.CollectionConverters._

    val doc  = new Load(LoadSettings.builder().build())
      .loadFromReader(scala.io.Source.fromFile(".github/workflows/ci.yml").bufferedReader())
    val yaml = doc.asInstanceOf[JMap[String, JMap[String, JMap[String, JMap[String, JMap[String, JList[String]]]]]]]
    val list = yaml.get("jobs").get("test").get("strategy").get("matrix").get("scala").asScala
    list.map(v => (v.split('.').take(2).mkString("."), v)).toMap
  }
  val Scala211: String   = versions("2.11")
  val Scala212: String   = versions("2.12")
  val Scala213: String   = versions("2.13")

To set a scala version, do we need this loop ? I understand this ensures consistency with CI. But I would personally question this approach.

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

No branches or pull requests

1 participant