<commit_before>name := "squeryl"

description := "A Scala ORM and DSL for talking with Databases using minimum verbosity and maximum type safety"

organization := "org.squeryl"

version := "0.9.18"

javacOptions := {
  if (scala.util.Properties.isJavaAtLeast("17")) {
    Seq("-source", "1.8", "-target", "1.8")
  } else {
    Seq("-source", "1.6", "-target", "1.6")
  }
}

Test / fork := true

// https://github.com/squeryl/squeryl/issues/340
// TODO remove this workaround
Test / javaOptions ++= {
  if (scala.util.Properties.isJavaAtLeast("11")) {
    Seq("--add-opens=java.base/java.lang=ALL-UNNAMED")
  } else {
    Nil
  }
}

//only release *if* -Drelease=true is passed to JVM
version := {
  val v = version.value
  val release = Option(System.getProperty("release")) == Some("true")
  if(release)
    v
  else {
    val suffix = Option(System.getProperty("suffix"))
    val i = (v.indexOf('-'), v.length) match {
      case (x, l) if x < 0 => l
      case (x, l) if v substring (x+1) matches """\d+""" => l //patch level, not RCx
      case (x, _) => x
    }
    v.substring(0,i) + "-" + (suffix getOrElse "SNAPSHOT")
  }
}

parallelExecution := false

publishMavenStyle := true

val Scala211 = "2.11.12"

scalaVersion := Scala211

crossScalaVersions := Seq("2.12.16", Scala211, "2.10.7", "2.13.8")

Compile / doc / scalacOptions ++= {
  val base = (LocalRootProject / baseDirectory).value.getAbsolutePath
  val hash = sys.process.Process("git rev-parse HEAD").lineStream_!.head
  Seq("-sourcepath", base, "-doc-source-url", "https://github.com/squeryl/squeryl/tree/" + hash + "€{FILE_PATH}.scala")
}

scalacOptions ++= {
  CrossVersion.partialVersion(scalaVersion.value) match {
    case Some((2, v)) if v >= 11 =>
      Seq(
        "-Xsource:3",
      )
    case _ =>
      Nil
  }
}

scalacOptions ++= Seq(
  "-unchecked",
  "-deprecation",
  "-feature",
  "-language:implicitConversions",
  "-language:postfixOps",
  "-language:reflectiveCalls",
  "-language:existentials"
)

scalacOptions ++= {
  CrossVersion.partialVersion(scalaVersion.value) match {
    case Some((2, v)) if v <= 12 =>
      Seq("-Xfuture")
    case _ =>
      Nil
  }
}

val unusedWarnings = Def.setting(
  CrossVersion.partialVersion(scalaVersion.value) match {
    case Some((2, 10)) =>
      Nil
    case Some((2, 11)) =>
      Seq("-Ywarn-unused-import")
    case _ =>
      Seq("-Ywarn-unused:imports")
  }
)

scalacOptions ++= unusedWarnings.value

Seq(Compile, Test).flatMap(c =>
  c / console / scalacOptions --= unusedWarnings.value
)

licenses := Seq("Apache 2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))

homepage := Some(url("https://squeryl.org"))

pomExtra := (<scm>
               <url><EMAIL>:squeryl/squeryl.git</url>
               <connection>scm:git:git@github.<EMAIL>:squeryl/squeryl.git</connection>
             </scm>
             <developers>
               <developer>
                 <id>max-l</id>
                 <name><NAME></name>
                 <url>https://github.com/max-l</url>
               </developer>
               <developer>
                 <id>davewhittaker</id>
                 <name><NAME></name>
                 <url>https://github.com/davewhittaker</url>
               </developer>
             </developers>)

publishTo := sonatypePublishToBundle.value

Test / publishArtifact := false

pomIncludeRepository := { _ => false }

libraryDependencies ++= Seq(
  "cglib" % "cglib-nodep" % "3.3.0",
  "com.h2database" % "h2" % "1.4.200" % "provided",
  "mysql" % "mysql-connector-java" % "8.0.30" % "provided",
  "org.postgresql" % "postgresql" % "42.5.0" % "provided",
  "net.sourceforge.jtds" % "jtds" % "1.3.1" % "provided",
  "org.apache.derby" % "derby" % "10.11.1.1" % "provided",
  "org.xerial" % "sqlite-jdbc" % "3.39.2.1" % "test",
  "org.json4s" %% "json4s-scalap" % "3.6.12",
)

libraryDependencies ++= {
  Seq("org.scalatest" %% "scalatest" % "3.2.13" % "test")
}

libraryDependencies ++= {
  CrossVersion.partialVersion(scalaVersion.value) match {
    case Some((2, 11)) =>
      Seq("org.scala-lang.modules" %% "scala-xml" % "1.3.0")
    case Some((2, scalaMajor)) if scalaMajor >= 12 =>
      Seq("org.scala-lang.modules" %% "scala-xml" % "2.1.0")
    case _ =>
      Nil
  }
}
<commit_msg>Update sqlite-jdbc to 3.39.3.0<commit_after>name := "squeryl"

description := "A Scala ORM and DSL for talking with Databases using minimum verbosity and maximum type safety"

organization := "org.squeryl"

version := "0.9.18"

javacOptions := {
  if (scala.util.Properties.isJavaAtLeast("17")) {
    Seq("-source", "1.8", "-target", "1.8")
  } else {
    Seq("-source", "1.6", "-target", "1.6")
  }
}

Test / fork := true

// https://github.com/squeryl/squeryl/issues/340
// TODO remove this workaround
Test / javaOptions ++= {
  if (scala.util.Properties.isJavaAtLeast("11")) {
    Seq("--add-opens=java.base/java.lang=ALL-UNNAMED")
  } else {
    Nil
  }
}

//only release *if* -Drelease=true is passed to JVM
version := {
  val v = version.value
  val release = Option(System.getProperty("release")) == Some("true")
  if(release)
    v
  else {
    val suffix = Option(System.getProperty("suffix"))
    val i = (v.indexOf('-'), v.length) match {
      case (x, l) if x < 0 => l
      case (x, l) if v substring (x+1) matches """\d+""" => l //patch level, not RCx
      case (x, _) => x
    }
    v.substring(0,i) + "-" + (suffix getOrElse "SNAPSHOT")
  }
}

parallelExecution := false

publishMavenStyle := true

val Scala211 = "2.11.12"

scalaVersion := Scala211

crossScalaVersions := Seq("2.12.16", Scala211, "2.10.7", "2.13.8")

Compile / doc / scalacOptions ++= {
  val base = (LocalRootProject / baseDirectory).value.getAbsolutePath
  val hash = sys.process.Process("git rev-parse HEAD").lineStream_!.head
  Seq("-sourcepath", base, "-doc-source-url", "https://github.com/squeryl/squeryl/tree/" + hash + "€{FILE_PATH}.scala")
}

scalacOptions ++= {
  CrossVersion.partialVersion(scalaVersion.value) match {
    case Some((2, v)) if v >= 11 =>
      Seq(
        "-Xsource:3",
      )
    case _ =>
      Nil
  }
}

scalacOptions ++= Seq(
  "-unchecked",
  "-deprecation",
  "-feature",
  "-language:implicitConversions",
  "-language:postfixOps",
  "-language:reflectiveCalls",
  "-language:existentials"
)

scalacOptions ++= {
  CrossVersion.partialVersion(scalaVersion.value) match {
    case Some((2, v)) if v <= 12 =>
      Seq("-Xfuture")
    case _ =>
      Nil
  }
}

val unusedWarnings = Def.setting(
  CrossVersion.partialVersion(scalaVersion.value) match {
    case Some((2, 10)) =>
      Nil
    case Some((2, 11)) =>
      Seq("-Ywarn-unused-import")
    case _ =>
      Seq("-Ywarn-unused:imports")
  }
)

scalacOptions ++= unusedWarnings.value

Seq(Compile, Test).flatMap(c =>
  c / console / scalacOptions --= unusedWarnings.value
)

licenses := Seq("Apache 2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))

homepage := Some(url("https://squeryl.org"))

pomExtra := (<scm>
               <url>git@github.com:squeryl/squeryl.git</url>
               <connection>scm:git:git@github.com:squeryl/squeryl.git</connection>
             </scm>
             <developers>
               <developer>
                 <id>max-l</id>
                 <name><NAME></name>
                 <url>https://github.com/max-l</url>
               </developer>
               <developer>
                 <id>davewhittaker</id>
                 <name><NAME></name>
                 <url>https://github.com/davewhittaker</url>
               </developer>
             </developers>)

publishTo := sonatypePublishToBundle.value

Test / publishArtifact := false

pomIncludeRepository := { _ => false }

libraryDependencies ++= Seq(
  "cglib" % "cglib-nodep" % "3.3.0",
  "com.h2database" % "h2" % "1.4.200" % "provided",
  "mysql" % "mysql-connector-java" % "8.0.30" % "provided",
  "org.postgresql" % "postgresql" % "42.5.0" % "provided",
  "net.sourceforge.jtds" % "jtds" % "1.3.1" % "provided",
  "org.apache.derby" % "derby" % "10.11.1.1" % "provided",
  "org.xerial" % "sqlite-jdbc" % "3.39.3.0" % "test",
  "org.json4s" %% "json4s-scalap" % "3.6.12",
)

libraryDependencies ++= {
  Seq("org.scalatest" %% "scalatest" % "3.2.13" % "test")
}

libraryDependencies ++= {
  CrossVersion.partialVersion(scalaVersion.value) match {
    case Some((2, 11)) =>
      Seq("org.scala-lang.modules" %% "scala-xml" % "1.3.0")
    case Some((2, scalaMajor)) if scalaMajor >= 12 =>
      Seq("org.scala-lang.modules" %% "scala-xml" % "2.1.0")
    case _ =>
      Nil
  }
}

{'fraction_non_alphanumeric': 0.18799812470698546, 'fraction_numerical': 0.028481012658227847, 'mean_word_length': 2.7474747474747474, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 93, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 7, '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': '37927', 'n_tokens_mistral': 3282, 'n_tokens_neox': 3103, 'n_words': 565}