<commit_before>import java.io.File

import Dependencies._
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
import com.typesafe.tools.mima.core.ProblemFilters
import com.typesafe.tools.mima.core._
import sbtassembly.AssemblyPlugin.autoImport._
import sbtassembly.MergeStrategy
import scalariform.formatter.preferences._

//---------------------------------------------------------------
// Shading and Project Settings
//---------------------------------------------------------------

val scala212 = "2.12.10"
val scala213 = "2.13.1"

resolvers ++= DefaultOptions.resolvers(snapshot = true)
resolvers in ThisBuild += Resolver.sonatypeRepo("public")
resolvers in ThisBuild += Resolver.bintrayRepo("akka", "snapshots")

val javacSettings = Seq(
  "-source", "1.8",
  "-target", "1.8",
  "-Xlint:deprecation",
  "-Xlint:unchecked"
)

def scalacOpts: Seq[String] = Seq(
  "-target:jvm-1.8",
  "-deprecation",
  "-encoding", "UTF-8",
  "-feature",
  "-unchecked",

  "-Ywarn-unused:imports",
  "-Xlint:nullary-unit",

  "-Xlint",
  "-Ywarn-dead-code",
)

ThisBuild / mimaFailOnNoPrevious := false

lazy val mimaSettings = mimaDefaultSettings ++ Seq(
  mimaPreviousArtifacts := {
    val VersionPattern = """^(\d+).(\d+).(\d+)(-.*)?""".r
    val previousVersions = version.value match {
      case VersionPattern("2", "0", "5", _) if scalaBinaryVersion.value == "2.13" => Set.empty // added 2.13.0 support in 2.0.5-SNAPSHOT.
      case VersionPattern(epoch, major, minor, _) => (0 until minor.toInt).map(v => s"$epoch.$major.$v")
      case _ => sys.error(s"Cannot find previous versions for ${version.value}")
    }

    previousVersions.toSet.map(previousVersion => organization.value %% name.value % previousVersion)
  },
  mimaBinaryIssueFilters ++= Seq(
    ProblemFilters.exclude[MissingTypesProblem]("play.api.libs.ws.ahc.AhcWSClientConfig$"),
    ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.libs.ws.ahc.AhcWSClientConfig.apply"),
    ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.libs.ws.ahc.AhcWSClientConfig.copy"),
    ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.libs.ws.ahc.AhcWSClientConfig.this"),
    ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.libs.ws.ahc.DefaultStreamedAsyncHandler.this"),
  )
)

lazy val commonSettings = Def.settings(
  organization := "com.typesafe.play",
  scalaVersion := scala213,
  crossScalaVersions := Seq(scala213, scala212),
  scalacOptions ++= scalacOpts,
  scalacOptions in (Compile, doc) ++= Seq(
    "-Xfatal-warnings",

    // Work around 2.12 bug which prevents javadoc in nested java classes from compiling.
    "-no-java-comments",
  ),
  pomExtra := (
    <url>https://github.com/playframework/play-ws</url>
      <licenses>
        <license>
          <name>Apache License, Version 2.0</name>
          <url>http://www.apache.org/licenses/LICENSE-2.0</url>
          <distribution>repo</distribution>
        </license>
      </licenses>
      <scm>
        <url>https://github.com/playframework/play-ws</url>
        <connection>scm:git:git@github.com/playframework/play-ws.git</connection>
      </scm>
      <developers>
        <developer><commit_msg>Configure mima previous version to 2.1.0 (#421)<commit_after>import java.io.File

import Dependencies._
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
import com.typesafe.tools.mima.core.ProblemFilters
import com.typesafe.tools.mima.core._
import sbtassembly.AssemblyPlugin.autoImport._
import sbtassembly.MergeStrategy
import scalariform.formatter.preferences._

//---------------------------------------------------------------
// Shading and Project Settings
//---------------------------------------------------------------

val scala212 = "2.12.10"
val scala213 = "2.13.1"

resolvers ++= DefaultOptions.resolvers(snapshot = true)
resolvers in ThisBuild += Resolver.sonatypeRepo("public")
resolvers in ThisBuild += Resolver.bintrayRepo("akka", "snapshots")

val javacSettings = Seq(
  "-source", "1.8",
  "-target", "1.8",
  "-Xlint:deprecation",
  "-Xlint:unchecked"
)

def scalacOpts: Seq[String] = Seq(
  "-target:jvm-1.8",
  "-deprecation",
  "-encoding", "UTF-8",
  "-feature",
  "-unchecked",

  "-Ywarn-unused:imports",
  "-Xlint:nullary-unit",

  "-Xlint",
  "-Ywarn-dead-code",
)

// Binary compatibility is this version
val previousVersions: Set[String] = Set("2.1.0")

ThisBuild / mimaFailOnNoPrevious := false

lazy val mimaSettings = mimaDefaultSettings ++ Seq(
  mimaPreviousArtifacts := previousVersions.map(pv => organization.value %% name.value % pv)
)

lazy val commonSettings = Def.settings(
  organization := "com.typesafe.play",
  scalaVersion := scala213,
  crossScalaVersions := Seq(scala213, scala212),
  scalacOptions ++= scalacOpts,
  scalacOptions in (Compile, doc) ++= Seq(
    "-Xfatal-warnings",

    // Work around 2.12 bug which prevents javadoc in nested java classes from compiling.
    "-no-java-comments",
  ),
  pomExtra := (
    <url>https://github.com/playframework/play-ws</url>
      <licenses>
        <license>
          <name>Apache License, Version 2.0</name>
          <url>http://www.apache.org/licenses/LICENSE-2.0</url>
          <distribution>repo</distribution>
        </license>
      </licenses>
      <scm>
        <url>https://github.com/playframework/play-ws</url>
        <connection>scm:git:git@github.com/playframework/play-ws.git</connection>
      </scm>
      <developers>
        <developer>
{'fraction_non_alphanumeric': 0.1895378000716589, 'fraction_numerical': 0.017735578645646722, 'mean_word_length': 3.1478454680534917, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 49, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '552182', 'n_tokens_mistral': 1895, 'n_tokens_neox': 1815, 'n_words': 310}