<commit_before>/*
 * Copyright 2012 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.io.File
import sbt._
import sbt.Keys._
import sbtrelease.ReleasePlugin._
import scala._
import scala.Some
import xerial.sbt.Pack._

object XerialBuild extends Build {

  val SCALA_VERSION = "2.10.0"


  def releaseResolver(v: String): Resolver = {
    val profile = System.getProperty("xerial.profile", "default")
    profile match {
      case "default" => {
        val nexus = "https://oss.sonatype.org/"
        if (v.trim.endsWith("SNAPSHOT"))
          "snapshots" at nexus + "content/repositories/snapshots"
        else
          "releases" at nexus + "service/local/staging/deploy/maven2"
      }
      case p => {
        sys.error("unknown xerial.profile:%s".format(p))
      }
    }
  }

  lazy val buildSettings = Defaults.defaultSettings ++ Unidoc.settings ++ releaseSettings ++ Seq[Setting[_]](
    organization := "org.xerial",
    organizationName := "Xerial Project",
    organizationHomepage := Some(new URL("http://xerial.org/")),
    description := "Xerial: Data Management Utiilities",
    scalaVersion := SCALA_VERSION,
    publishMavenStyle := true,
    publishArtifact in Test := false,
    publishTo <<= version { (v) => Some(releaseResolver(v)) },
    pomIncludeRepository := {
      _ => false
    },
    parallelExecution := true,
    parallelExecution in Test := false,
    crossPaths := false,
    scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked", "-target:jvm-1.6", "-feature"),
    pomExtra := {
      <url>http://xerial.org/</url>
      <licenses>
        <license>
          <name>Apache 2</name>
          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
      </licenses>
        <scm>
          <connection>scm:git:github.com/xerial/xerial.git</connection>
          <developerConnection>scm:git:git@github.com:xerial/xerial.git</developerConnection>
          <url>github.com/xerial/xerial.git</url>
        </scm>
        <properties>
          <scala.version>
            {SCALA_VERSION}
          </scala.version>
          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        </properties>
        <developers>
          <developer>
            <id>leo</id>
            <name><NAME></name>
            <url>http://xerial.org/leo</url>
          </developer>
        </developers>
    }
  )


  import Dependencies._

  private val dependentScope = "test->test;compile->compile"

  // Project modules
  lazy val root = Project(
    id = "xerial",
    base = file("."),
    settings = buildSettings ++ packSettings ++ Seq(
      packExclude := Seq("root"),
      packMain := Map("xerial" -> "xerial.lens.cui.Main"),
      publish := {},
      publishLocal := {}
    )
  ) aggregate(core, lens, compress, macroLib)

  lazy val core = Project(
    id = "xerial-core",
    base = file("xerial-core"),
    settings = buildSettings ++ Seq(
      description := "Xerial core utiltiles",
      libraryDependencies ++= testLib
    )
  )

  lazy val lens = Project(
    id = "xerial-lens",
    base = file("xerial-lens"),
    settings = buildSettings ++ Seq(
      description := "Object mapping utiltiles",
      libraryDependencies ++= testLib ++ lensLib
    )
  ) dependsOn (core % dependentScope)

  lazy val compress = Project(
    id = "xerial-compress",
    base = file("xerial-compress"),
    settings = buildSettings ++ Seq(
      description := "Compression libraries",
      libraryDependencies ++= testLib ++ Seq(
        "org.xerial.snappy" % "snappy-java" % "1.0.5-M3"
      )
    )
  ) dependsOn (core % dependentScope)

  lazy val macroLib = Project(
    id = "xerial-macro",
    base = file("xerial-macro"),
    settings = buildSettings ++ Seq(
      description := "macro libraries for Xerial projects",
      libraryDependencies += "org.scala-lang" % "scala-reflect" % SCALA_VERSION
    )
  ) dependsOn (core % dependentScope)


  object Dependencies {
    val testLib = Seq(
      "org.scalatest" %% "scalatest" % "2.0.M5b" % "test"
    )

    val lensLib = Seq(
      "org.javassist" % "javassist" % "3.15.0-GA",
      "org.scala-lang" % "scalap" % SCALA_VERSION,<commit_msg>to scala 2.10.1<commit_after>/*
 * Copyright 2012 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.io.File
import sbt._
import sbt.Keys._
import sbtrelease.ReleasePlugin._
import scala._
import scala.Some
import xerial.sbt.Pack._

object XerialBuild extends Build {

  val SCALA_VERSION = "2.10.1"


  def releaseResolver(v: String): Resolver = {
    val profile = System.getProperty("xerial.profile", "default")
    profile match {
      case "default" => {
        val nexus = "https://oss.sonatype.org/"
        if (v.trim.endsWith("SNAPSHOT"))
          "snapshots" at nexus + "content/repositories/snapshots"
        else
          "releases" at nexus + "service/local/staging/deploy/maven2"
      }
      case p => {
        sys.error("unknown xerial.profile:%s".format(p))
      }
    }
  }

  lazy val buildSettings = Defaults.defaultSettings ++ Unidoc.settings ++ releaseSettings ++ Seq[Setting[_]](
    organization := "org.xerial",
    organizationName := "Xerial Project",
    organizationHomepage := Some(new URL("http://xerial.org/")),
    description := "Xerial: Data Management Utiilities",
    scalaVersion := SCALA_VERSION,
    publishMavenStyle := true,
    publishArtifact in Test := false,
    publishTo <<= version { (v) => Some(releaseResolver(v)) },
    pomIncludeRepository := {
      _ => false
    },
    parallelExecution := true,
    parallelExecution in Test := false,
    crossPaths := false,
    scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked", "-target:jvm-1.6", "-feature"),
    pomExtra := {
      <url>http://xerial.org/</url>
      <licenses>
        <license>
          <name>Apache 2</name>
          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
      </licenses>
        <scm>
          <connection>scm:git:github.com/xerial/xerial.git</connection>
          <developerConnection>scm:git:git@github.com:xerial/xerial.git</developerConnection>
          <url>github.com/xerial/xerial.git</url>
        </scm>
        <properties>
          <scala.version>
            {SCALA_VERSION}
          </scala.version>
          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        </properties>
        <developers>
          <developer>
            <id>leo</id>
            <name><NAME></name>
            <url>http://xerial.org/leo</url>
          </developer>
        </developers>
    }
  )


  import Dependencies._

  private val dependentScope = "test->test;compile->compile"

  // Project modules
  lazy val root = Project(
    id = "xerial",
    base = file("."),
    settings = buildSettings ++ packSettings ++ Seq(
      packExclude := Seq("root"),
      packMain := Map("xerial" -> "xerial.lens.cui.Main"),
      publish := {},
      publishLocal := {}
    )
  ) aggregate(core, lens, compress, macroLib)

  lazy val core = Project(
    id = "xerial-core",
    base = file("xerial-core"),
    settings = buildSettings ++ Seq(
      description := "Xerial core utiltiles",
      libraryDependencies ++= testLib
    )
  )

  lazy val lens = Project(
    id = "xerial-lens",
    base = file("xerial-lens"),
    settings = buildSettings ++ Seq(
      description := "Object mapping utiltiles",
      libraryDependencies ++= testLib ++ lensLib
    )
  ) dependsOn (core % dependentScope)

  lazy val compress = Project(
    id = "xerial-compress",
    base = file("xerial-compress"),
    settings = buildSettings ++ Seq(
      description := "Compression libraries",
      libraryDependencies ++= testLib ++ Seq(
        "org.xerial.snappy" % "snappy-java" % "1.0.5-M3"
      )
    )
  ) dependsOn (core % dependentScope)

  lazy val macroLib = Project(
    id = "xerial-macro",
    base = file("xerial-macro"),
    settings = buildSettings ++ Seq(
      description := "macro libraries for Xerial projects",
      libraryDependencies += "org.scala-lang" % "scala-reflect" % SCALA_VERSION
    )
  ) dependsOn (core % dependentScope)


  object Dependencies {
    val testLib = Seq(
      "org.scalatest" % "scalatest_2.10" % "2.0.M5b" % "test"
    )

    val lensLib = Seq(
      "org.javassist" % "javassist" % "3.15.0-GA",
      "org.scala-lang" % "scalap" % SCALA_VERSION,
{'fraction_non_alphanumeric': 0.1378945138741792, 'fraction_numerical': 0.007307773776742216, 'mean_word_length': 2.682917316692668, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 89, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '87831', 'n_tokens_mistral': 2984, 'n_tokens_neox': 2895, 'n_words': 687}