<commit_before>organization in ThisBuild := "de.tuda.stg"
crossScalaVersions in ThisBuild := Seq("2.12.1", "2.11.8")
scalaVersion in ThisBuild := crossScalaVersions.value.head

version in ThisBuild := "0.20.0-SNAPSHOT"

testOptions in Test in ThisBuild += Tests.Argument("-oICN")

incOptions in ThisBuild := (incOptions in ThisBuild).value.withLogRecompileOnMacro(false)

parallelExecution in Test in ThisBuild := true

licenses in ThisBuild += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))

// set the prompt (for this build) to include the project id.
shellPrompt in ThisBuild := { state => Project.extract(state).currentRef.project + "> " }

lazy val rescalaAggregate = project.in(file(".")).aggregate(rescalaJVM,
  rescalaJS, microbench, reswing, examples, examplesReswing, caseStudyEditor,
  caseStudyRSSEvents, caseStudyRSSReactive, caseStudyRSSSimple, rescalatags,
  datastructures, universe, reactiveStreams, documentation, meta, pipelining,
  stm, testsJVM, testsJS, fullmv, caseStudyShapes, caseStudyMill)
  .settings(
    publish := {},
    publishLocal := {})


lazy val rescala = crossProject.in(file("Main"))
  .disablePlugins(JmhPlugin)
  .settings(
    name := "rescala",
    resolvers += Resolver.bintrayRepo("pweisenburger", "maven"),
    libraryDependencies += "de.tuda.stg" %% "retypecheck" % "0.1.0",
    libraryDependencies += scalaVersion("org.scala-lang" % "scala-reflect" % _).value,
    scalatestDependency,

    sourceGenerators in Compile += Def.task {
      val file = (sourceManaged in Compile).value / "rescala" / "reactives" / "GeneratedSignalLift.scala"
      val definitions = (1 to 22).map{ i =>
        val params = 1 to i map ("n" + _)
        val types = 1 to i map ("A" + _)
        val signals = params zip types map {case (p, t) => s"$p: Stateful[$t, S]"}
        def sep(l: Seq[String]) = l.mkString(", ")
        val getValues = params map (_ + ".get(t)")
        s"""  def lift[${sep(types)}, B, S <: Struct](${sep(signals)})(fun: (${sep(types)}) => B)(implicit maybe: TurnSource[S]): Signal[B, S] = {
           |    static(${sep(params)})(t => fun(${sep(getValues)}))
           |  }
           |""".stripMargin
      }
      IO.write(file,
      s"""package rescala.reactives
         |
         |import rescala.reactives._
         |import rescala.graph._
         |import rescala.engines._
         |
         |trait GeneratedSignalLift {
         |self: Signals.type =>
         |${definitions.mkString("\n")}
         |}
         |""".stripMargin)
      Seq(file)
    }.taskValue,
    initialCommands in console :=
      s"""import rescala._
       """.stripMargin
  )
  .jvmSettings().jsSettings(scalaJSUseRhino in Global := true)

lazy val rescalaJVM = rescala.jvm

lazy val rescalaJS = rescala.js

lazy val tests = crossProject.in(file("Tests"))
  .disablePlugins(JmhPlugin)
  .settings(
    name := "rescala-tests",
    scalatestDependency)
  .settings(
    publish := {},
    publishLocal := {}
  )
  .dependsOn(rescala)
  .jvmSettings().jsSettings(scalaJSUseRhino in Global := true)

lazy val testsJVM = tests.jvm.dependsOn(stm, pipelining)<commit_msg>fix import package name in generator<commit_after>organization in ThisBuild := "de.tuda.stg"
crossScalaVersions in ThisBuild := Seq("2.12.1", "2.11.8")
scalaVersion in ThisBuild := crossScalaVersions.value.head

version in ThisBuild := "0.20.0-SNAPSHOT"

testOptions in Test in ThisBuild += Tests.Argument("-oICN")

incOptions in ThisBuild := (incOptions in ThisBuild).value.withLogRecompileOnMacro(false)

parallelExecution in Test in ThisBuild := true

licenses in ThisBuild += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))

// set the prompt (for this build) to include the project id.
shellPrompt in ThisBuild := { state => Project.extract(state).currentRef.project + "> " }

lazy val rescalaAggregate = project.in(file(".")).aggregate(rescalaJVM,
  rescalaJS, microbench, reswing, examples, examplesReswing, caseStudyEditor,
  caseStudyRSSEvents, caseStudyRSSReactive, caseStudyRSSSimple, rescalatags,
  datastructures, universe, reactiveStreams, documentation, meta, pipelining,
  stm, testsJVM, testsJS, fullmv, caseStudyShapes, caseStudyMill)
  .settings(
    publish := {},
    publishLocal := {})


lazy val rescala = crossProject.in(file("Main"))
  .disablePlugins(JmhPlugin)
  .settings(
    name := "rescala",
    resolvers += Resolver.bintrayRepo("pweisenburger", "maven"),
    libraryDependencies += "de.tuda.stg" %% "retypecheck" % "0.1.0",
    libraryDependencies += scalaVersion("org.scala-lang" % "scala-reflect" % _).value,
    scalatestDependency,

    sourceGenerators in Compile += Def.task {
      val file = (sourceManaged in Compile).value / "rescala" / "reactives" / "GeneratedSignalLift.scala"
      val definitions = (1 to 22).map{ i =>
        val params = 1 to i map ("n" + _)
        val types = 1 to i map ("A" + _)
        val signals = params zip types map {case (p, t) => s"$p: Stateful[$t, S]"}
        def sep(l: Seq[String]) = l.mkString(", ")
        val getValues = params map (_ + ".get(t)")
        s"""  def lift[${sep(types)}, B, S <: Struct](${sep(signals)})(fun: (${sep(types)}) => B)(implicit maybe: TurnSource[S]): Signal[B, S] = {
           |    static(${sep(params)})(t => fun(${sep(getValues)}))
           |  }
           |""".stripMargin
      }
      IO.write(file,
      s"""package rescala.reactives
         |
         |import rescala.reactives._
         |import rescala.graph._
         |import rescala.engine._
         |
         |trait GeneratedSignalLift {
         |self: Signals.type =>
         |${definitions.mkString("\n")}
         |}
         |""".stripMargin)
      Seq(file)
    }.taskValue,
    initialCommands in console :=
      s"""import rescala._
       """.stripMargin
  )
  .jvmSettings().jsSettings(scalaJSUseRhino in Global := true)

lazy val rescalaJVM = rescala.jvm

lazy val rescalaJS = rescala.js

lazy val tests = crossProject.in(file("Tests"))
  .disablePlugins(JmhPlugin)
  .settings(
    name := "rescala-tests",
    scalatestDependency)
  .settings(
    publish := {},
    publishLocal := {}
  )
  .dependsOn(rescala)
  .jvmSettings().jsSettings(scalaJSUseRhino in Global := true)

lazy val testsJVM = tests.jvm.dependsOn(stm, pipelining)
{'fraction_non_alphanumeric': 0.1480891719745223, 'fraction_numerical': 0.007643312101910828, 'mean_word_length': 3.3497229916897506, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, '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': '1710573', 'n_tokens_mistral': 2179, 'n_tokens_neox': 2085, 'n_words': 464}