<commit_before>/*
 * Copyright 2013 - 2017 Outworkers Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import sbt.Keys._

lazy val Versions = new {
  val scalatest = "3.0.4"
  val cats = "1.1.0"
  val joda = "2.9.7"
  val jodaConvert = "1.8.1"
  val lift = "3.0"
  val twitterUtil = "6.41.0"
  val twitterUtil210 = "6.34.0"
  val scalaz = "7.2.8"
  val scalacheck = "1.13.4"
  val datafactory = "0.8"
  val play = "2.6.0-M4"
  val shapeless = "2.3.2"
  val kindProjector = "0.9.3"
  val paradise = "2.1.0"
  val macroCompat = "1.1.1"

  val scala210 = "2.10.6"
  val scala211 = "2.11.11"
  val scala212 = "2.12.5"
  val scalaAll = Seq(scala210, scala211, scala212)

  val scala = new {
    val all = Seq(scala210, scala211, scala212)
  }

  val catsVersion: String => ModuleID = {
    s => CrossVersion.partialVersion(s) match {
      case Some((_, minor)) if minor >= 11 => "org.typelevel" %% "cats-core" % "1.1.0"
      case _ => "org.typelevel" %% "cats" % "0.9.0"
    }
  }

  val twitterUtilVersion: String => String = {
    s => CrossVersion.partialVersion(s) match {
      case Some((_, minor)) if minor == 12 => twitterUtil
      case _ => twitterUtil210
    }
  }

  val playVersion: String => String = {
    s => CrossVersion.partialVersion(s) match {
      case Some((_, minor)) if minor >= 11 => play
      case _ => "2.4.8"
    }
  }

  val liftVersion: String => String = {
    s => CrossVersion.partialVersion(s) match {
      case Some((_, minor)) if minor >= 11 => lift
      case _ => "3.0-M1"
    }
  }
}

val sharedSettings: Seq[Def.Setting[_]] = Seq(
  organization := "com.outworkers",
  scalaVersion := Versions.scala211,
  crossScalaVersions := Versions.scala.all,
  resolvers ++= Seq(
    "Twitter Repository" at "http://maven.twttr.com",
    Resolver.sonatypeRepo("releases"),
    Resolver.jcenterRepo
  ),
  scalacOptions ++= Seq(
    "-language:postfixOps",
    "-language:higherKinds",
    "-language:implicitConversions",
    "-language:reflectiveCalls",
    "-deprecation",
    "-feature",
    "-unchecked"
  )
) ++ Publishing.effectiveSettings

lazy val baseProjectList: Seq[ProjectReference] = Seq(
  domain,
  lift,
  liftCats,
  parsers,
  parsersCats,
  validatorsCats,
  validators,
  samplers,
  testing,
  testingTwitter,
  macros,
  tags
)

lazy val util = (project in file("."))
  .settings(sharedSettings: _*)
  .settings(
    name := "util",
    moduleName := "util"
  ).aggregate(
  baseProjectList ++ Publishing.jdk8Only(play): _*
)

lazy val domain = (project in file("util-domain"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-domain",
    crossScalaVersions := Versions.scala.all
  )

lazy val parsers = (project in file("util-parsers"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-parsers",
    crossScalaVersions := Versions.scala.all,
    libraryDependencies ++= Seq(
      "commons-validator"       %  "commons-validator"              % "1.4.0",
      "joda-time"               %  "joda-time"                      % Versions.joda,
      "org.joda"                %  "joda-convert"                   % Versions.jodaConvert,
      "org.scalaz"              %% "scalaz-core"                    % Versions.scalaz,
      "org.scalatest"           %% "scalatest"                      % Versions.scalatest % Test
    )
  ).dependsOn(
  domain,
  testing % Test
)

lazy val parsersCats = (project in file("util-parsers-cats"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-parsers-cats",
    crossScalaVersions := Versions.scala.all,
    libraryDependencies ++= Seq(
      "commons-validator"       %  "commons-validator"              % "1.4.0",
      "joda-time"               %  "joda-time"                      % Versions.joda,
      "org.joda"                %  "joda-convert"                   % Versions.jodaConvert,
      Versions.catsVersion(scalaVersion.value),
      "org.scalatest"           %% "scalatest"                      % Versions.scalatest % Test
    )
  ).dependsOn(
  domain,
  testing % Test
)

lazy val tags = (project in file("util-tags"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-tags",
    crossScalaVersions := Versions.scala.all,
    scalacOptions ++= Seq(
      "-language:experimental.macros"
    ),
    libraryDependencies ++= Seq(
      "com.eaio.uuid" % "uuid" % "3.2",
      "org.typelevel" %% "macro-compat" % "1.1.1",
      "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided",
      compilerPlugin("org.scalamacros" % "paradise" % Versions.paradise cross CrossVersion.full),
      "org.scalatest" %% "scalatest" % Versions.scalatest % Test
    )
  ).dependsOn(
  domain,
  macros
)

lazy val samplers = (project in file("util-samplers"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-samplers",
    crossScalaVersions := Versions.scala.all,
    scalacOptions ++= Seq(
      "-language:experimental.macros"
    ),
    libraryDependencies ++= Seq(
      "org.typelevel" %% "macro-compat" % Versions.macroCompat,
      "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided",
      compilerPlugin("org.scalamacros" % "paradise" % Versions.paradise cross CrossVersion.full),
      "org.scalatest" %% "scalatest" % Versions.scalatest % Test,
      "org.scalacheck" %% "scalacheck" % Versions.scalacheck
    )
  ).dependsOn(
  domain,
  macros
)

lazy val testing = (project in file("util-testing"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-testing",
    crossScalaVersions := Versions.scala.all,
    scalacOptions ++= Seq(
      "-language:experimental.macros"
    ),
    libraryDependencies ++= Seq(
      "org.typelevel" %% "macro-compat" % Versions.macroCompat,
      "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided",
      compilerPlugin("org.scalamacros" % "paradise" % Versions.paradise cross CrossVersion.full),
      "org.scalatest" %% "scalatest" % Versions.scalatest,
      "joda-time" % "joda-time" % Versions.joda,
      "org.joda" % "joda-convert" % Versions.jodaConvert,
      "org.scalacheck" %% "scalacheck" % Versions.scalacheck
    )
  ).dependsOn(
  domain,
  tags,
  macros,
  samplers
)

lazy val testingTwitter = (project in file("util-testing-twitter"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-testing-twitter",
    crossScalaVersions := Versions.scala.all,
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % Versions.scalatest,
      "com.twitter" %% "util-core" % Versions.twitterUtilVersion(scalaVersion.value)
    )
  )

lazy val play = (project in file("util-play"))
  .settings(sharedSettings: _*)
  .settings(

    moduleName := "util-play",
    crossScalaVersions := Seq(Versions.scala210, Versions.scala211),
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-ws" % Versions.playVersion(scalaVersion.value)
    ),
    unmanagedSourceDirectories in Compile ++= Seq(
      (sourceDirectory in Compile).value / ("scala-2." + {
        CrossVersion.partialVersion(scalaBinaryVersion.value) match {
          case Some((major, minor)) if minor <= 11 => minor.toString
          case _ => "non-existing"
        }
      }))
  ).dependsOn(
  domain,
  parsersCats,
  testing % Test
)

lazy val lift = (project in file("util-lift"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-lift",
    crossScalaVersions := Seq(Versions.scala210, Versions.scala211),
    unmanagedSourceDirectories in Compile ++= Seq(
      (sourceDirectory in Compile).value / ("scala-2." + {
        CrossVersion.partialVersion(scalaBinaryVersion.value) match {
          case Some((major, minor)) if minor <= 11 => minor.toString
          case _ => "non-existing"
        }
      })),
    libraryDependencies ++= Seq(
      "net.liftweb" %% "lift-webkit" % Versions.liftVersion(scalaVersion.value)
    )
  ).dependsOn(
  parsers,
  testing % Test
)

lazy val liftCats = (project in file("util-lift-cats"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-lift-cats",
    crossScalaVersions := Seq(Versions.scala210, Versions.scala211),
    unmanagedSourceDirectories in Compile ++= Seq(
      (sourceDirectory in Compile).value / ("scala-2." + {
        CrossVersion.partialVersion(scalaBinaryVersion.value) match {
          case Some((major, minor)) if minor <= 11 => minor.toString
          case _ => "non-existing"
        }
      })),
    libraryDependencies ++= Seq(
      "net.liftweb" %% "lift-webkit" % Versions.liftVersion(scalaVersion.value)
    )
  ).dependsOn(
  parsersCats,
  testing % Test
)

lazy val macros = (project in file("util-macros"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-macros",
    crossScalaVersions := Versions.scala.all,
    libraryDependencies ++= Seq(
      compilerPlugin("org.scalamacros" % "paradise" % Versions.paradise cross CrossVersion.full),
      "org.typelevel"  %% "macro-compat" % "1.1.1",
      "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided"
    )
  )

lazy val validatorsCats = (project in file("util-validators-cats"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-validators-cats",
    crossScalaVersions := Versions.scala.all,
    addCompilerPlugin(
      "org.spire-math" % "kind-projector" % Versions.kindProjector cross CrossVersion.binary
    ),
    libraryDependencies ++= Seq(
      "com.chuusai" %% "shapeless" % Versions.shapeless,
      Versions.catsVersion(scalaVersion.value)
    )
  ).dependsOn(
  parsersCats,
  testing % Test
)

lazy val validators = (project in file("util-validators"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-validators",
    crossScalaVersions := Versions.scala.all,
    addCompilerPlugin(
      "org.spire-math" % "kind-projector" % Versions.kindProjector cross CrossVersion.binary
    ),
    libraryDependencies ++= Seq(
      "org.scalaz" %% "scalaz-core" % Versions.scalaz
    )
  ).dependsOn(
  validatorsCats,
  parsers,
  testing % Test
)
<commit_msg>Adding proper compiler flags.<commit_after>/*
 * Copyright 2013 - 2017 Outworkers Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import sbt.Keys._

lazy val Versions = new {
  val scalatest = "3.0.4"
  val cats = "1.1.0"
  val joda = "2.9.7"
  val jodaConvert = "1.8.1"
  val lift = "3.0"
  val twitterUtil = "6.41.0"
  val twitterUtil210 = "6.34.0"
  val scalaz = "7.2.8"
  val scalacheck = "1.13.4"
  val datafactory = "0.8"
  val play = "2.6.0-M4"
  val shapeless = "2.3.2"
  val kindProjector = "0.9.3"
  val paradise = "2.1.0"
  val macroCompat = "1.1.1"

  val scala210 = "2.10.6"
  val scala211 = "2.11.11"
  val scala212 = "2.12.5"
  val scalaAll = Seq(scala210, scala211, scala212)

  val scala = new {
    val all = Seq(scala210, scala211, scala212)
  }

  lazy val ScalacOptions = Seq(
  "-deprecation", // Emit warning and location for usages of deprecated APIs.
  "-encoding",
  "utf-8", // Specify character encoding used by source files.
  "-feature",
  "-explaintypes", // Explain type errors in more detail.
  "-feature", // Emit warning and location for usages of features that should be imported explicitly.
  "-language:reflectiveCalls",
  "-language:postfixOps",
  "-language:existentials", // Existential types (besides wildcard types) can be written and inferred
  "-language:experimental.macros", // Allow macro definition (besides implementation and application)
  "-language:higherKinds", // Allow higher-kinded types
  "-language:implicitConversions", // Allow definition of implicit functions called views
  "-unchecked", // Enable additional warnings where generated code depends on assumptions.
  "-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access.
  //"-Xfatal-warnings", // Fail the compilation if there are any warnings.
  "-Xfuture" // Turn on future language features.
  //"-Yno-adapted-args" // Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver.
)

val XLintOptions = Seq(
  "-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver.
  "-Xlint:by-name-right-associative", // By-name parameter of right associative operator.
  "-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error.
  "-Xlint:delayedinit-select", // Selecting member of DelayedInit.
  "-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element.
  "-Xlint:inaccessible", // Warn about inaccessible types in method signatures.
  "-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id.
  "-Xlint:nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'.
  "-Xlint:nullary-unit", // Warn when nullary methods return Unit.
  "-Xlint:option-implicit", // Option.apply used implicit view.
  "-Xlint:package-object-classes", // Class or object defined in package object.
  "-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds.
  "-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field.
  "-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component.
  "-Xlint:type-parameter-shadow", // A local type parameter shadows a type already in scope.
  "-Xlint:unsound-match" // Pattern match may not be typesafe.
)

val Scala212Options = Seq(
  "-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`.
  "-Ypartial-unification", // Enable partial unification in type constructor inference,
  "-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined.
  "-Ywarn-unused:implicits", // Warn if an implicit parameter is unused.
  "-Ywarn-unused:imports", // Warn if an import selector is not referenced.
  "-Ywarn-unused:locals", // Warn if a local definition is unused.
  "-Ywarn-unused:params", // Warn if a value parameter is unused.
  "-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused.
  "-Ywarn-unused:privates" // Warn if a private member is unused.
) ++ XLintOptions

val YWarnOptions = Seq(
  "-Ywarn-dead-code", // Warn when dead code is identified.
  "-Ywarn-inaccessible", // Warn about inaccessible types in method signatures.
  "-Ywarn-nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'.
  "-Ywarn-nullary-unit", // Warn when nullary methods return Unit.
  "-Ywarn-numeric-widen", // Warn when numerics are widened.
  "-Ywarn-value-discard" // Warn when non-Unit expression results are unused.
)

val scalacOptionsFn: String => Seq[String] = { s =>
  CrossVersion.partialVersion(s) match {
    case Some((_, minor)) if minor >= 12 => ScalacOptions ++ YWarnOptions ++ Scala212Options
    case _ => ScalacOptions ++ YWarnOptions
  }
}

scalacOptions in ThisBuild := (scalacOptionsFn(scalaVersion.value)) 

  val catsVersion: String => ModuleID = {
    s => CrossVersion.partialVersion(s) match {
      case Some((_, minor)) if minor >= 11 => "org.typelevel" %% "cats-core" % "1.1.0"
      case _ => "org.typelevel" %% "cats" % "0.9.0"
    }
  }

  val twitterUtilVersion: String => String = {
    s => CrossVersion.partialVersion(s) match {
      case Some((_, minor)) if minor == 12 => twitterUtil
      case _ => twitterUtil210
    }
  }

  val playVersion: String => String = {
    s => CrossVersion.partialVersion(s) match {
      case Some((_, minor)) if minor >= 11 => play
      case _ => "2.4.8"
    }
  }

  val liftVersion: String => String = {
    s => CrossVersion.partialVersion(s) match {
      case Some((_, minor)) if minor >= 11 => lift
      case _ => "3.0-M1"
    }
  }
}

val sharedSettings: Seq[Def.Setting[_]] = Seq(
  organization := "com.outworkers",
  scalaVersion := Versions.scala211,
  crossScalaVersions := Versions.scala.all,
  resolvers ++= Seq(
    "Twitter Repository" at "http://maven.twttr.com",
    Resolver.sonatypeRepo("releases"),
    Resolver.jcenterRepo
  ),
  scalacOptions ++= Seq(
    "-language:postfixOps",
    "-language:higherKinds",
    "-language:implicitConversions",
    "-language:reflectiveCalls",
    "-deprecation",
    "-feature",
    "-unchecked"
  )
) ++ Publishing.effectiveSettings

lazy val baseProjectList: Seq[ProjectReference] = Seq(
  domain,
  lift,
  liftCats,
  parsers,
  parsersCats,
  validatorsCats,
  validators,
  samplers,
  testing,
  testingTwitter,
  macros,
  tags
)

lazy val util = (project in file("."))
  .settings(sharedSettings: _*)
  .settings(
    name := "util",
    moduleName := "util"
  ).aggregate(
  baseProjectList ++ Publishing.jdk8Only(play): _*
)

lazy val domain = (project in file("util-domain"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-domain",
    crossScalaVersions := Versions.scala.all
  )

lazy val parsers = (project in file("util-parsers"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-parsers",
    crossScalaVersions := Versions.scala.all,
    libraryDependencies ++= Seq(
      "commons-validator"       %  "commons-validator"              % "1.4.0",
      "joda-time"               %  "joda-time"                      % Versions.joda,
      "org.joda"                %  "joda-convert"                   % Versions.jodaConvert,
      "org.scalaz"              %% "scalaz-core"                    % Versions.scalaz,
      "org.scalatest"           %% "scalatest"                      % Versions.scalatest % Test
    )
  ).dependsOn(
  domain,
  testing % Test
)

lazy val parsersCats = (project in file("util-parsers-cats"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-parsers-cats",
    crossScalaVersions := Versions.scala.all,
    libraryDependencies ++= Seq(
      "commons-validator"       %  "commons-validator"              % "1.4.0",
      "joda-time"               %  "joda-time"                      % Versions.joda,
      "org.joda"                %  "joda-convert"                   % Versions.jodaConvert,
      Versions.catsVersion(scalaVersion.value),
      "org.scalatest"           %% "scalatest"                      % Versions.scalatest % Test
    )
  ).dependsOn(
  domain,
  testing % Test
)

lazy val tags = (project in file("util-tags"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-tags",
    crossScalaVersions := Versions.scala.all,
    scalacOptions ++= Seq(
      "-language:experimental.macros"
    ),
    libraryDependencies ++= Seq(
      "com.eaio.uuid" % "uuid" % "3.2",
      "org.typelevel" %% "macro-compat" % "1.1.1",
      "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided",
      compilerPlugin("org.scalamacros" % "paradise" % Versions.paradise cross CrossVersion.full),
      "org.scalatest" %% "scalatest" % Versions.scalatest % Test
    )
  ).dependsOn(
  domain,
  macros
)

lazy val samplers = (project in file("util-samplers"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-samplers",
    crossScalaVersions := Versions.scala.all,
    scalacOptions ++= Seq(
      "-language:experimental.macros"
    ),
    libraryDependencies ++= Seq(
      "org.typelevel" %% "macro-compat" % Versions.macroCompat,
      "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided",
      compilerPlugin("org.scalamacros" % "paradise" % Versions.paradise cross CrossVersion.full),
      "org.scalatest" %% "scalatest" % Versions.scalatest % Test,
      "org.scalacheck" %% "scalacheck" % Versions.scalacheck
    )
  ).dependsOn(
  domain,
  macros
)

lazy val testing = (project in file("util-testing"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-testing",
    crossScalaVersions := Versions.scala.all,
    scalacOptions ++= Seq(
      "-language:experimental.macros"
    ),
    libraryDependencies ++= Seq(
      "org.typelevel" %% "macro-compat" % Versions.macroCompat,
      "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided",
      compilerPlugin("org.scalamacros" % "paradise" % Versions.paradise cross CrossVersion.full),
      "org.scalatest" %% "scalatest" % Versions.scalatest,
      "joda-time" % "joda-time" % Versions.joda,
      "org.joda" % "joda-convert" % Versions.jodaConvert,
      "org.scalacheck" %% "scalacheck" % Versions.scalacheck
    )
  ).dependsOn(
  domain,
  tags,
  macros,
  samplers
)

lazy val testingTwitter = (project in file("util-testing-twitter"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-testing-twitter",
    crossScalaVersions := Versions.scala.all,
    libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % Versions.scalatest,
      "com.twitter" %% "util-core" % Versions.twitterUtilVersion(scalaVersion.value)
    )
  )

lazy val play = (project in file("util-play"))
  .settings(sharedSettings: _*)
  .settings(

    moduleName := "util-play",
    crossScalaVersions := Seq(Versions.scala210, Versions.scala211),
    libraryDependencies ++= Seq(
      "com.typesafe.play" %% "play-ws" % Versions.playVersion(scalaVersion.value)
    ),
    unmanagedSourceDirectories in Compile ++= Seq(
      (sourceDirectory in Compile).value / ("scala-2." + {
        CrossVersion.partialVersion(scalaBinaryVersion.value) match {
          case Some((major, minor)) if minor <= 11 => minor.toString
          case _ => "non-existing"
        }
      }))
  ).dependsOn(
  domain,
  parsersCats,
  testing % Test
)

lazy val lift = (project in file("util-lift"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-lift",
    crossScalaVersions := Seq(Versions.scala210, Versions.scala211),
    unmanagedSourceDirectories in Compile ++= Seq(
      (sourceDirectory in Compile).value / ("scala-2." + {
        CrossVersion.partialVersion(scalaBinaryVersion.value) match {
          case Some((major, minor)) if minor <= 11 => minor.toString
          case _ => "non-existing"
        }
      })),
    libraryDependencies ++= Seq(
      "net.liftweb" %% "lift-webkit" % Versions.liftVersion(scalaVersion.value)
    )
  ).dependsOn(
  parsers,
  testing % Test
)

lazy val liftCats = (project in file("util-lift-cats"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-lift-cats",
    crossScalaVersions := Seq(Versions.scala210, Versions.scala211),
    unmanagedSourceDirectories in Compile ++= Seq(
      (sourceDirectory in Compile).value / ("scala-2." + {
        CrossVersion.partialVersion(scalaBinaryVersion.value) match {
          case Some((major, minor)) if minor <= 11 => minor.toString
          case _ => "non-existing"
        }
      })),
    libraryDependencies ++= Seq(
      "net.liftweb" %% "lift-webkit" % Versions.liftVersion(scalaVersion.value)
    )
  ).dependsOn(
  parsersCats,
  testing % Test
)

lazy val macros = (project in file("util-macros"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-macros",
    crossScalaVersions := Versions.scala.all,
    libraryDependencies ++= Seq(
      compilerPlugin("org.scalamacros" % "paradise" % Versions.paradise cross CrossVersion.full),
      "org.typelevel"  %% "macro-compat" % "1.1.1",
      "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided"
    )
  )

lazy val validatorsCats = (project in file("util-validators-cats"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-validators-cats",
    crossScalaVersions := Versions.scala.all,
    addCompilerPlugin(
      "org.spire-math" % "kind-projector" % Versions.kindProjector cross CrossVersion.binary
    ),
    libraryDependencies ++= Seq(
      "com.chuusai" %% "shapeless" % Versions.shapeless,
      Versions.catsVersion(scalaVersion.value)
    )
  ).dependsOn(
  parsersCats,
  testing % Test
)

lazy val validators = (project in file("util-validators"))
  .settings(sharedSettings: _*)
  .settings(
    moduleName := "util-validators",
    crossScalaVersions := Versions.scala.all,
    addCompilerPlugin(
      "org.spire-math" % "kind-projector" % Versions.kindProjector cross CrossVersion.binary
    ),
    libraryDependencies ++= Seq(
      "org.scalaz" %% "scalaz-core" % Versions.scalaz
    )
  ).dependsOn(
  validatorsCats,
  parsers,
  testing % Test
)

{'fraction_non_alphanumeric': 0.13800761421319796, 'fraction_numerical': 0.013840418781725889, 'mean_word_length': 3.004605367635382, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 58, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3155092', 'n_tokens_mistral': 8662, 'n_tokens_neox': 8187, 'n_words': 1866}