Skip to content

Add support for -2.13+ source directories #248

Description

@armanbilge

Another one from Cats, but oft-repeated. Have to think about where to put it, since it requires knowing about the cross project plugin to be effective.

def scalaVersionSpecificFolders(srcName: String, srcBaseDir: java.io.File, scalaVersion: String) = {
  def extraDirs(suffix: String) =
    List(CrossType.Pure, CrossType.Full)
      .flatMap(_.sharedSrcDir(srcBaseDir, srcName).toList.map(f => file(f.getPath + suffix)))
  CrossVersion.partialVersion(scalaVersion) match {
    case Some((2, y))     => if (y >= 13) extraDirs("-2.13+") else Nil
    case Some((0 | 3, _)) => extraDirs("-2.13+")
    case _                => Nil
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions