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
}
}
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.