<commit_before>val disableDocs =
  sys.props("nodocs") == "true" ||
    // on jdk 11 https://github.com/scala/scala-java8-compat/issues/160, seems to fail the build (not on 8)
    !sys.props("java.version").startsWith("1.")

lazy val JavaDoc = config("genjavadoc") extend Compile

def jwrite(dir: java.io.File, pck: String = "scala/compat/java8")(name: String, content: String) = {
  val f = dir / pck / s"${name}.java"
  IO.write(f, content)
  f
}

def osgiExport(scalaVersion: String, version: String) = {
  (CrossVersion.partialVersion(scalaVersion) match {
    case Some((2, 11)) => Seq(s"scala.runtime.java8.*;version=${version}")
    case _ => Nil
  }) ++ Seq(s"scala.compat.java8.*;version=${version}")
}

ThisBuild / versionScheme := Some("early-semver")
ThisBuild / versionPolicyIntention := Compatibility.BinaryAndSourceCompatible

lazy val commonSettings = Seq(
  scalacOptions ++= Seq("-feature", "-deprecation", "-unchecked"),

  Compile / unmanagedSourceDirectories ++= {
    (Compile / unmanagedSourceDirectories).value.flatMap { dir =>
      CrossVersion.partialVersion(scalaVersion.value) match {
        case Some((2, 11)) => Seq(file(dir.getPath ++ "-2.13-"), file(dir.getPath ++ "-2.11"))
        case Some((2, 12)) => Seq(file(dir.getPath ++ "-2.13-"))
        case _             => Seq(file(dir.getPath ++ "-2.13+"))
      }
    }
  },

  Test / unmanagedSourceDirectories ++= {
    (Test / unmanagedSourceDirectories).value.flatMap { dir =>
      CrossVersion.partialVersion(scalaVersion.value) match {
        case Some((2, 11)) => Seq(file(dir.getPath ++ "-2.13-"), file(dir.getPath ++ "-2.11"))
        case Some((2, 12)) => Seq(file(dir.getPath ++ "-2.13-"))
        case _             => Seq(file(dir.getPath ++ "-2.13+"))
      }
    }
  },
)

lazy val fnGen = (project in file("fnGen"))
  .settings(commonSettings)
  .settings(
    crossScalaVersions := Seq("2.12.13"),
    scalaVersion := crossScalaVersions.value.head,
    run / fork := true,  // Needed if you run this project directly
    libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
    libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value
  )
<commit_msg>remove redundant code in build.sbt<commit_after>val disableDocs =
  sys.props("nodocs") == "true" ||
    // on jdk 11 https://github.com/scala/scala-java8-compat/issues/160, seems to fail the build (not on 8)
    !sys.props("java.version").startsWith("1.")

lazy val JavaDoc = config("genjavadoc") extend Compile

def jwrite(dir: java.io.File, pck: String = "scala/compat/java8")(name: String, content: String) = {
  val f = dir / pck / s"${name}.java"
  IO.write(f, content)
  f
}

def osgiExport(scalaVersion: String, version: String) = {
  (CrossVersion.partialVersion(scalaVersion) match {
    case Some((2, 11)) => Seq(s"scala.runtime.java8.*;version=${version}")
    case _ => Nil
  }) ++ Seq(s"scala.compat.java8.*;version=${version}")
}

ThisBuild / versionScheme := Some("early-semver")
ThisBuild / versionPolicyIntention := Compatibility.BinaryAndSourceCompatible

lazy val commonSettings = Seq(
  Compile / unmanagedSourceDirectories ++= {
    (Compile / unmanagedSourceDirectories).value.flatMap { dir =>
      CrossVersion.partialVersion(scalaVersion.value) match {
        case Some((2, 11)) => Seq(file(dir.getPath ++ "-2.13-"), file(dir.getPath ++ "-2.11"))
        case Some((2, 12)) => Seq(file(dir.getPath ++ "-2.13-"))
        case _             => Seq(file(dir.getPath ++ "-2.13+"))
      }
    }
  },
  Test / unmanagedSourceDirectories ++= {
    (Test / unmanagedSourceDirectories).value.flatMap { dir =>
      CrossVersion.partialVersion(scalaVersion.value) match {
        case Some((2, 11)) => Seq(file(dir.getPath ++ "-2.13-"), file(dir.getPath ++ "-2.11"))
        case Some((2, 12)) => Seq(file(dir.getPath ++ "-2.13-"))
        case _             => Seq(file(dir.getPath ++ "-2.13+"))
      }
    }
  },
)

lazy val fnGen = (project in file("fnGen"))
  .settings(commonSettings)
  .settings(
    crossScalaVersions := Seq("2.12.13"),
    scalaVersion := crossScalaVersions.value.head,
    run / fork := true,  // Needed if you run this project directly
    libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
    libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value
  )

{'fraction_non_alphanumeric': 0.17576870123910052, 'fraction_numerical': 0.025240936209270308, 'mean_word_length': 3.3941532258064515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '37932', 'n_tokens_mistral': 1549, 'n_tokens_neox': 1455, 'n_words': 284}