<commit_before>import sbt._
import Keys._

object ActiveRecordBuild extends Build {
  val _version = "0.3.1"
  val isRelease = System.getProperty("release") == "true"

  def specs2(scope: String) = Def.setting {
    val v = "2.4.2"
    "org.specs2" %% "specs2" % v % scope
  }

  def play20(app: String, scope: String) = Def.setting {
    val v = if (scalaBinaryVersion.value == "2.11") "2.3.0" else "2.2.0"
    "com.typesafe.play" %% app % v % scope
  }

  val compilerSettings = Seq(
    javacOptions ++= Seq("-source", "1.6", "-target", "1.6"),
    scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-language:implicitConversions"),
    scalacOptions in Compile in doc ++= {
      val base = baseDirectory.value
      Seq("-sourcepath", base.getAbsolutePath, "-doc-source-url",
        "https://github.com/aselab/scala-activerecord/tree/master/%s€{FILE_PATH}.scala".format(base.getName),
        "-diagrams")
    },
    compileOrder in Compile := CompileOrder.JavaThenScala
  )

  val defaultResolvers = Seq(
    Resolver.sonatypeRepo("snapshots"),
    Classpaths.typesafeReleases
  )

  val defaultSettings = super.settings ++ Seq(
    version := (if (isRelease) _version else _version + "-SNAPSHOT"),
    organization := "com.github.aselab",
    scalaVersion := "2.11.2",
    crossScalaVersions := Seq("2.11.2", "2.10.4"),
    resolvers ++= defaultResolvers,
    libraryDependencies ++= Seq(
      specs2("test").value,
      "org.mockito" % "mockito-all" % "1.9.5" % "test",
      "com.h2database" % "h2" % "1.4.180" % "test",
      "ch.qos.logback" % "logback-classic" % "1.1.2" % "test",
      "junit" % "junit" % "4.11" % "test",
      "org.json4s" %% "json4s-native" % "3.2.10"
    ),
    testOptions in Test ++= Option(System.getProperty("ci")).map(_ => Tests.Argument("junitxml", "console")).toSeq,
    parallelExecution in Test := false,
    publishTo := {
      val nexus = "https://oss.sonatype.org/"
      if (version.value.trim.endsWith("SNAPSHOT"))
        Some("snapshots" at nexus + "content/repositories/snapshots")
      else
        Some("releases"  at nexus + "service/local/staging/deploy/maven2")
    },
    publishMavenStyle := true,
    publishArtifact in Test := false,
    pomIncludeRepository := { _ => false },
    pomExtra := pomXml,
    shellPrompt := {
      (state: State) => Project.extract(state).currentProject.id + "> "
    },
    updateOptions := updateOptions.value.withConsolidatedResolution(true)
  ) ++ compilerSettings ++ org.scalastyle.sbt.ScalastylePlugin.Settings

  val pluginSettings = defaultSettings ++ ScriptedPlugin.scriptedSettings ++
    Seq(
      scalaVersion := "2.10.4",
      sbtPlugin := true,
      crossScalaVersions := Seq("2.10.4"),
      ScriptedPlugin.scriptedBufferLog := false,
      ScriptedPlugin.scriptedLaunchOpts += "-Dversion=" + version.value,
      watchSources ++= ScriptedPlugin.sbtTestDirectory.value.***.get<commit_msg>bump library versions<commit_after>import sbt._
import Keys._

object ActiveRecordBuild extends Build {
  val _version = "0.3.1"
  val isRelease = System.getProperty("release") == "true"

  def specs2(scope: String, name: String = "core") = Def.setting {
    val v = if (scalaBinaryVersion.value == "2.11") "2.4.6" else "2.4.5"
    "org.specs2" %% s"specs2-${name}" % v % scope
  }

  def play20(app: String, scope: String) = Def.setting {
    val v = if (scalaBinaryVersion.value == "2.11") "2.3.0" else "2.2.0"
    "com.typesafe.play" %% app % v % scope
  }

  val compilerSettings = Seq(
    javacOptions ++= Seq("-source", "1.6", "-target", "1.6"),
    scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-language:implicitConversions"),
    scalacOptions in Compile in doc ++= {
      val base = baseDirectory.value
      Seq("-sourcepath", base.getAbsolutePath, "-doc-source-url",
        "https://github.com/aselab/scala-activerecord/tree/master/%s€{FILE_PATH}.scala".format(base.getName),
        "-diagrams")
    },
    compileOrder in Compile := CompileOrder.JavaThenScala
  )

  val defaultResolvers = Seq(
    Resolver.sonatypeRepo("snapshots"),
    Classpaths.typesafeReleases
  )

  val defaultSettings = super.settings ++ Seq(
    version := (if (isRelease) _version else _version + "-SNAPSHOT"),
    organization := "com.github.aselab",
    scalaVersion := "2.11.2",
    crossScalaVersions := Seq("2.11.2", "2.10.4"),
    resolvers ++= defaultResolvers,
    libraryDependencies ++= Seq(
      specs2("test").value,
      specs2("test", "mock").value,
      "org.mockito" % "mockito-all" % "1.9.5" % "test",
      "com.h2database" % "h2" % "1.4.181" % "test",
      "ch.qos.logback" % "logback-classic" % "1.1.2" % "test",
      "junit" % "junit" % "4.11" % "test",
      "org.json4s" %% "json4s-native" % "3.2.10"
    ),
    testOptions in Test ++= Option(System.getProperty("ci")).map(_ => Tests.Argument("junitxml", "console")).toSeq,
    parallelExecution in Test := false,
    publishTo := {
      val nexus = "https://oss.sonatype.org/"
      if (version.value.trim.endsWith("SNAPSHOT"))
        Some("snapshots" at nexus + "content/repositories/snapshots")
      else
        Some("releases"  at nexus + "service/local/staging/deploy/maven2")
    },
    publishMavenStyle := true,
    publishArtifact in Test := false,
    pomIncludeRepository := { _ => false },
    pomExtra := pomXml,
    shellPrompt := {
      (state: State) => Project.extract(state).currentProject.id + "> "
    },
    ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }
  ) ++ compilerSettings ++ org.scalastyle.sbt.ScalastylePlugin.Settings

  val pluginSettings = defaultSettings ++ ScriptedPlugin.scriptedSettings ++
    Seq(
      scalaVersion := "2.10.4",
      sbtPlugin := true,
      crossScalaVersions := Seq("2.10.4"),
      ScriptedPlugin.scriptedBufferLog := false,
      ScriptedPlugin.scriptedLaunchOpts += "-Dversion=" + version.value,
      watchSources ++= ScriptedPlugin.sbtTestDirectory.value.***.get
{'fraction_non_alphanumeric': 0.16890305266689032, 'fraction_numerical': 0.023985239852398525, 'mean_word_length': 3.2623302358827733, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6570008', 'n_tokens_mistral': 2104, 'n_tokens_neox': 2030, 'n_words': 378}