<commit_before>import sbt.Keys.{scalaVersion, unmanagedSourceDirectories}
import sbt._

import scala.xml.{Elem, NodeSeq}

object ScalaWebTestBuild {
  def playJsonDependency(scope: Option[String])(scalaVersion: String): Seq[ModuleID] = scalaVersion match {
    case "2.11.8" => scope match {
      case None => Seq("com.typesafe.play" % "play-json_2.11" % "2.5.9")
      case Some(s) => Seq("com.typesafe.play" % "play-json_2.11" % "2.5.9" % s)
    }
    case "2.12.1" => scope match {
      case None => Seq("com.typesafe.play" % "play-json_2.12" % "2.6.0-M4")
      case Some(s) => Seq("com.typesafe.play" % "play-json_2.12" % "2.6.0-M4" % s)
    }
    case _ => Seq()
  }

  def crossVersionSharedSources(configurations: Seq[Configuration]): Seq[Setting[_]] =
    configurations.map { sc =>
      (unmanagedSourceDirectories in sc) ++= {
        (unmanagedSourceDirectories in sc).value.map { dir: File =>
          CrossVersion.partialVersion(scalaVersion.value) match {
            case Some((2, y)) if y == 10 => new File(dir.getPath + "_2.10")
            case Some((2, y)) if y >= 11 => new File(dir.getPath + "_2.11+")
          }
        }
      }
    }

  def bomDependencies(versions: Map[String, String])(scalaVersion: String): Elem = {
    val scalaMajorVersion = scalaVersion.substring(0, "2.XX".length)
    val dependencies = <dependencyManagement>
      <dependencyManagementDependencies>
        <dependency>
          <groupId>org.scalawebtest</groupId>
          <artifactId>scalawebtest-core_{scalaMajorVersion}</artifactId>
          <version>{versions("scalaWebTest")}</version>
        </dependency>
        <dependency>
          <groupId>org.scalatest</groupId>
          <artifactId>scalatest_{scalaMajorVersion}</artifactId>
          <version>{versions("scalaTest")}</version>
        </dependency>
        <dependency>
          <groupId>org.seleniumhq.selenium</groupId>
          <artifactId>selenium-java</artifactId>
          <version>{versions("selenium")}</version>
        </dependency>
        <dependency>
          <groupId>org.seleniumhq.selenium</groupId>
          <artifactId>htmlunit-driver</artifactId>
          <version>{versions("htmlUnit")}</version>
        </dependency>
      </dependencyManagementDependencies>
    </dependencyManagement>
    dependencies
  }

  def scalaWebTestPomExtra: NodeSeq = {
    <url>http://www.scalatest.org</url>
      <licenses>
        <license>
          <name>The Apache Software License, Version 2.0</name>
          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
      </licenses>
      <scm>
        <url><EMAIL>@github.com/unic/ScalaWebTest.git</url>
        <connection>scm:git:<EMAIL>@github.com/unic/ScalaWebTest.git</connection>
      </scm>
      <developers>
        <developer>
          <id>DaniRey</id>
          <name><NAME></name>
          <email><EMAIL></email>
          <organization>Unic AG</organization>
          <organizationUrl>http://www.unic.com</organizationUrl>
        </developer><commit_msg>fixed wrong URL in pom extra<commit_after>import sbt.Keys.{scalaVersion, unmanagedSourceDirectories}
import sbt._

import scala.xml.{Elem, NodeSeq}

object ScalaWebTestBuild {
  def playJsonDependency(scope: Option[String])(scalaVersion: String): Seq[ModuleID] = scalaVersion match {
    case "2.11.8" => scope match {
      case None => Seq("com.typesafe.play" % "play-json_2.11" % "2.5.9")
      case Some(s) => Seq("com.typesafe.play" % "play-json_2.11" % "2.5.9" % s)
    }
    case "2.12.1" => scope match {
      case None => Seq("com.typesafe.play" % "play-json_2.12" % "2.6.0-M4")
      case Some(s) => Seq("com.typesafe.play" % "play-json_2.12" % "2.6.0-M4" % s)
    }
    case _ => Seq()
  }

  def crossVersionSharedSources(configurations: Seq[Configuration]): Seq[Setting[_]] =
    configurations.map { sc =>
      (unmanagedSourceDirectories in sc) ++= {
        (unmanagedSourceDirectories in sc).value.map { dir: File =>
          CrossVersion.partialVersion(scalaVersion.value) match {
            case Some((2, y)) if y == 10 => new File(dir.getPath + "_2.10")
            case Some((2, y)) if y >= 11 => new File(dir.getPath + "_2.11+")
          }
        }
      }
    }

  def bomDependencies(versions: Map[String, String])(scalaVersion: String): Elem = {
    val scalaMajorVersion = scalaVersion.substring(0, "2.XX".length)
    val dependencies = <dependencyManagement>
      <dependencyManagementDependencies>
        <dependency>
          <groupId>org.scalawebtest</groupId>
          <artifactId>scalawebtest-core_{scalaMajorVersion}</artifactId>
          <version>{versions("scalaWebTest")}</version>
        </dependency>
        <dependency>
          <groupId>org.scalatest</groupId>
          <artifactId>scalatest_{scalaMajorVersion}</artifactId>
          <version>{versions("scalaTest")}</version>
        </dependency>
        <dependency>
          <groupId>org.seleniumhq.selenium</groupId>
          <artifactId>selenium-java</artifactId>
          <version>{versions("selenium")}</version>
        </dependency>
        <dependency>
          <groupId>org.seleniumhq.selenium</groupId>
          <artifactId>htmlunit-driver</artifactId>
          <version>{versions("htmlUnit")}</version>
        </dependency>
      </dependencyManagementDependencies>
    </dependencyManagement>
    dependencies
  }

  def scalaWebTestPomExtra: NodeSeq = {
      <url>http://www.scalawebtest.org</url>
      <licenses>
        <license>
          <name>The Apache Software License, Version 2.0</name>
          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
      </licenses>
      <scm>
        <url>git@github.com/unic/ScalaWebTest.git</url>
        <connection>scm:git:git@github.com/unic/ScalaWebTest.git</connection>
      </scm>
      <developers>
        <developer>
          <id>DaniRey</id>
          <name><NAME></name>
          <email><EMAIL></email>
          <organization>Unic AG</organization>
          <organizationUrl>http://www.unic.com</organizationUrl>
        </developer>
{'fraction_non_alphanumeric': 0.15265922521339462, 'fraction_numerical': 0.017071569271175313, 'mean_word_length': 2.7107186358099877, 'pattern_counts': {'":': 0, '<': 139, '<?xml version=': 0, '>': 163, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 2}, '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': '1761142', 'n_tokens_mistral': 2069, 'n_tokens_neox': 1907, 'n_words': 300}