<commit_before>import sbt._
import Keys._
import ls.Plugin._

import scalariform.formatter.preferences._
import com.typesafe.sbt.SbtScalariform.scalariformSettings
import com.typesafe.sbt.SbtScalariform._

object ScalaCLBuild extends Build {
  // See https://github.com/mdr/scalariform
  ScalariformKeys.preferences := FormattingPreferences()
    .setPreference(MultilineScaladocCommentsStartOnFirstLine, true)
    .setPreference(PreserveDanglingCloseParenthesis, true)
    .setPreference(AlignSingleLineCaseStatements, true)
    .setPreference(DoubleIndentClassDeclaration, true)
    .setPreference(PreserveDanglingCloseParenthesis, false)
    
  lazy val sonatypeSettings = Seq(
    publishMavenStyle := true,
    resolvers += Resolver.sonatypeRepo("snapshots"),
    publishTo <<= version { (v: String) =>
      val nexus = "https://oss.sonatype.org/"
      if (v.trim.endsWith("-SNAPSHOT"))
        Some("snapshots" at nexus + "content/repositories/snapshots")
      else
        Some("releases"  at nexus + "service/local/staging/deploy/maven2")
    })

  lazy val infoSettings = Seq(
    organization := "com.nativelibs4java",
    version := "0.3-SNAPSHOT",
    licenses := Seq("BSD-3-Clause" -> url("http://www.opensource.org/licenses/BSD-3-Clause")),
    homepage := Some(url("https://github.com/ochafik/ScalaCL")),
    pomIncludeRepository := { _ => false },
    pomExtra := (
      <scm>
        <url><EMAIL>:ochafik/ScalaCL.git</url>
        <connection>scm:git:<EMAIL>:ochafik/ScalaCL.git</connection>
      </scm>
      <developers>
        <developer>
          <id>ochafik</id>
          <name><NAME></name>
          <url>http://ochafik.com/</url>
        </developer>
      </developers>
    ),
    (LsKeys.docsUrl in LsKeys.lsync) <<= homepage,
    (LsKeys.tags in LsKeys.lsync) :=
       Seq("opencl", "GPGPU", "macro", "GPU", "JavaCL"),
    (description in LsKeys.lsync) :=
      "OpenCL-powered and macro-powered data structures to store and transform data straight on the graphic card, using an API akin to Scala collections. Scala closures are transformed to OpenCL kernels automagically by macros, during compilation.",
    LsKeys.ghUser := Some("ochafik"),
    LsKeys.ghRepo := Some("ScalaCL"))

	lazy val standardSettings = 
	  Defaults.defaultSettings ++ 
	  scalariformSettings ++ 
	  sonatypeSettings ++
	  infoSettings ++
	  Seq(
      resolvers += "Local Maven Repository" at "file://" + Path.userHome + "/.m2/repository",

      fork := true,

      scalaVersion := "2.10.3",
      scalacOptions ++= Seq(
        "-language:experimental.macros",
        "-encoding", "UTF-8",
        "-optimise",
        "-deprecation",
        "-feature",
        "-Xlog-free-types",
        // "-Ymacro-debug-lite",
        "-unchecked"
      ),
      
      libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _),
      libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-reflect" % _),    
      libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _),
      libraryDependencies ++= Seq(
        "junit" % "junit" % "4.10" % "test",
        "com.novocode" % "junit-interface" % "0.8" % "test"
      )
    )

  def addLocalOrRemoteDependencies(project: Project, dependenciesAndTheirLocalPaths: List[(ModuleID, String, String)]): Project = {
    dependenciesAndTheirLocalPaths match {
      case Nil =>
        project
      case (dependency, dependencyProjectRoot, gitURL) :: rest =>
        addLocalOrRemoteDependencies(
          if (new File(dependencyProjectRoot).exists()) {
            project.dependsOn(ProjectRef(file(dependencyProjectRoot), dependency.name))
          } else {
            println(dependencyProjectRoot + " does not exist. If you want to modify " + dependency.name + ", please clone it with:\n\tgit clone " + gitURL + " " + dependencyProjectRoot + "\n")
            project.copy(
              settings = (project: ProjectDefinition[_]).settings ++ Seq(
                libraryDependencies ++= Seq(dependency)
              )
            )
          },
          rest
        )
    }
  }<commit_msg>Add NO_LOCAL_DEPS=1 to build without dep to local project<commit_after>import sbt._
import Keys._
import ls.Plugin._

import scalariform.formatter.preferences._
import com.typesafe.sbt.SbtScalariform.scalariformSettings
import com.typesafe.sbt.SbtScalariform._

object ScalaCLBuild extends Build {
  // See https://github.com/mdr/scalariform
  ScalariformKeys.preferences := FormattingPreferences()
    .setPreference(MultilineScaladocCommentsStartOnFirstLine, true)
    .setPreference(PreserveDanglingCloseParenthesis, true)
    .setPreference(AlignSingleLineCaseStatements, true)
    .setPreference(DoubleIndentClassDeclaration, true)
    .setPreference(PreserveDanglingCloseParenthesis, false)
    
  lazy val sonatypeSettings = Seq(
    publishMavenStyle := true,
    resolvers += Resolver.sonatypeRepo("snapshots"),
    publishTo <<= version { (v: String) =>
      val nexus = "https://oss.sonatype.org/"
      if (v.trim.endsWith("-SNAPSHOT"))
        Some("snapshots" at nexus + "content/repositories/snapshots")
      else
        Some("releases"  at nexus + "service/local/staging/deploy/maven2")
    })

  lazy val infoSettings = Seq(
    organization := "com.nativelibs4java",
    version := "0.3-SNAPSHOT",
    licenses := Seq("BSD-3-Clause" -> url("http://www.opensource.org/licenses/BSD-3-Clause")),
    homepage := Some(url("https://github.com/ochafik/ScalaCL")),
    pomIncludeRepository := { _ => false },
    pomExtra := (
      <scm>
        <url><EMAIL>:ochafik/ScalaCL.git</url>
        <connection>scm:git:<EMAIL>:ochafik/ScalaCL.git</connection>
      </scm>
      <developers>
        <developer>
          <id>ochafik</id>
          <name><NAME></name>
          <url>http://ochafik.com/</url>
        </developer>
      </developers>
    ),
    (LsKeys.docsUrl in LsKeys.lsync) <<= homepage,
    (LsKeys.tags in LsKeys.lsync) :=
       Seq("opencl", "GPGPU", "macro", "GPU", "JavaCL"),
    (description in LsKeys.lsync) :=
      "OpenCL-powered and macro-powered data structures to store and transform data straight on the graphic card, using an API akin to Scala collections. Scala closures are transformed to OpenCL kernels automagically by macros, during compilation.",
    LsKeys.ghUser := Some("ochafik"),
    LsKeys.ghRepo := Some("ScalaCL"))

	lazy val standardSettings = 
	  Defaults.defaultSettings ++ 
	  scalariformSettings ++ 
	  sonatypeSettings ++
	  infoSettings ++
	  Seq(
      resolvers += "Local Maven Repository" at "file://" + Path.userHome + "/.m2/repository",

      fork := true,

      scalaVersion := "2.10.3",
      scalacOptions ++= Seq(
        "-language:experimental.macros",
        "-encoding", "UTF-8",
        "-optimise",
        "-deprecation",
        "-feature",
        "-Xlog-free-types",
        // "-Ymacro-debug-lite",
        "-unchecked"
      ),
      
      libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _),
      libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-reflect" % _),    
      libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _),
      libraryDependencies ++= Seq(
        "junit" % "junit" % "4.10" % "test",
        "com.novocode" % "junit-interface" % "0.8" % "test"
      )
    )

  def addLocalOrRemoteDependencies(project: Project, dependenciesAndTheirLocalPaths: List[(ModuleID, String, String)]): Project = {
    dependenciesAndTheirLocalPaths match {
      case Nil =>
        project
      case (dependency, dependencyProjectRoot, gitURL) :: rest =>
        addLocalOrRemoteDependencies(
          if (new File(dependencyProjectRoot).exists() && "1" != System.getenv("NO_LOCAL_DEPS")) {
            project.dependsOn(ProjectRef(file(dependencyProjectRoot), dependency.name))
          } else {
            println(dependencyProjectRoot + " does not exist. If you want to modify " + dependency.name + ", please clone it with:\n\tgit clone " + gitURL + " " + dependencyProjectRoot + "\n")
            project.copy(
              settings = (project: ProjectDefinition[_]).settings ++ Seq(
                libraryDependencies ++= Seq(dependency)
              )
            )
          },
          rest
        )
    }
  }
{'fraction_non_alphanumeric': 0.13642400096583363, 'fraction_numerical': 0.004346251358203549, 'mean_word_length': 2.874649204864359, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 51, 'https://': 6, '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': '2197769', 'n_tokens_mistral': 2635, 'n_tokens_neox': 2505, 'n_words': 484}