<commit_before>import de.tototec.sbuild._
import de.tototec.sbuild.TargetRefs._
import de.tototec.sbuild.ant._

import org.apache.tools.ant.taskdefs._

import scala.tools.ant._

@classpath("http://repo1.maven.org/maven2/org/apache/ant/ant/1.8.3/ant-1.8.3.jar",
  "http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.9.1/scala-library-2.9.1.jar",
  "http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.9.1/scala-compiler-2.9.1.jar")
class SBuild(implicit P: Project) {

  SchemeHandler("mvn", new MvnSchemeHandler(".sbuild/mvn",
    Seq("http://repo1.maven.org/maven1", "file:///home/lefou/.m2/repository-tototec")))

  val version = "0.0.1-SNAPSHOT"
  val jar = "target/de.tototec.sbuild-" + version + ".jar"

  Target("phony:all") dependsOn jar

  val clean = Target("phony:clean") exec {
    new Delete() {
      setProject(AntProject())
      setDir(Path("target"))
    }.execute
  }

  val compileCp = "mvn:org.scala-lang:scala-library:2.9.1" /
    "mvn:org.scala-lang:scala-compiler:2.9.1" /
    "mvn:de.tototec:de.tototec.cmdoption:0.1.0" /
    "mvn:org.apache.ant:ant:1.8.3"

  def scalac(sourceDir: String, targetDir: String, cp: org.apache.tools.ant.types.Path) {
    new Mkdir() {
      setProject(AntProject())
      setDir(Path(targetDir))
    }.execute

    // we want to use FastScala, but after it compiles successfully, it bails out with an internal error
    new Scalac() {
      setProject(AntProject())
      setSrcdir(AntPath(sourceDir))
      setDestdir(Path(targetDir))
      setTarget("jvm-1.5")
      setEncoding("UTF-8")
      setDeprecation("on")
      setUnchecked("on")
      // setLogging("verbose")
      setClasspath(cp)
      setForce(true)
    }.execute
  }

  Target("phony:compile") dependsOn compileCp exec {
    scalac(sourceDir = "src/main/scala", targetDir = "target/classes", cp = AntPath(compileCp))
  }

  val testCp = compileCp / "mvn:org.testng:testng:6.4" / jar

  Target("phony:testCompile") dependsOn testCp exec {
    scalac(sourceDir = "src/main/scala", targetDir = "target/test-classes", cp = AntPath(testCp))
  }

  Target(jar) dependsOn "compile" exec {<commit_msg>Added a comment, why force flag is set.<commit_after>import de.tototec.sbuild._
import de.tototec.sbuild.TargetRefs._
import de.tototec.sbuild.ant._

import org.apache.tools.ant.taskdefs._

import scala.tools.ant._

@classpath("http://repo1.maven.org/maven2/org/apache/ant/ant/1.8.3/ant-1.8.3.jar",
  "http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.9.1/scala-library-2.9.1.jar",
  "http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.9.1/scala-compiler-2.9.1.jar")
class SBuild(implicit P: Project) {

  SchemeHandler("mvn", new MvnSchemeHandler(".sbuild/mvn",
    Seq("http://repo1.maven.org/maven1", "file:///home/lefou/.m2/repository-tototec")))

  val version = "0.0.1-SNAPSHOT"
  val jar = "target/de.tototec.sbuild-" + version + ".jar"

  Target("phony:all") dependsOn jar

  val clean = Target("phony:clean") exec {
    new Delete() {
      setProject(AntProject())
      setDir(Path("target"))
    }.execute
  }

  val compileCp = "mvn:org.scala-lang:scala-library:2.9.1" /
    "mvn:org.scala-lang:scala-compiler:2.9.1" /
    "mvn:de.tototec:de.tototec.cmdoption:0.1.0" /
    "mvn:org.apache.ant:ant:1.8.3"

  def scalac(sourceDir: String, targetDir: String, cp: org.apache.tools.ant.types.Path) {
    new Mkdir() {
      setProject(AntProject())
      setDir(Path(targetDir))
    }.execute

    // we want to use FastScala, but after it compiles successfully, it bails out with an internal error
    new Scalac() {
      setProject(AntProject())
      setSrcdir(AntPath(sourceDir))
      setDestdir(Path(targetDir))
      setTarget("jvm-1.5")
      setEncoding("UTF-8")
      setDeprecation("on")
      setUnchecked("on")
      // setLogging("verbose")
      setClasspath(cp)
      // this is necessary, because the scala ant tasks outsmarts itself 
      // when more than one scala class is defined in the same .scala file
      setForce(true)
    }.execute
  }

  Target("phony:compile") dependsOn compileCp exec {
    scalac(sourceDir = "src/main/scala", targetDir = "target/classes", cp = AntPath(compileCp))
  }

  val testCp = compileCp / "mvn:org.testng:testng:6.4" / jar

  Target("phony:testCompile") dependsOn testCp exec {
    scalac(sourceDir = "src/main/scala", targetDir = "target/test-classes", cp = AntPath(testCp))
  }

  Target(jar) dependsOn "compile" exec {
{'fraction_non_alphanumeric': 0.16235664492916574, 'fraction_numerical': 0.021137845738700246, 'mean_word_length': 3.3952569169960474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '642201', 'n_tokens_mistral': 1722, 'n_tokens_neox': 1631, 'n_words': 268}