<commit_before>// @feature start commonheader
import java.io.File
import java.security.MessageDigest
import java.util.jar.JarFile

import net.virtualvoid.sbt.graph.{Module, ModuleGraph, ModuleId}
import osgifelix.{ManifestInstructions, OsgiDependency}
import sbt.File

import scala.annotation.tailrec
import scala.collection.immutable.HashSet
import scala.xml.XML
import com.typesafe.sbt.osgi.OsgiKeys._
import org.osgi.framework.Constants
import osgifelix.OsgiFelixPlugin.autoImport._
import sbt.Keys._

//: -------------------------------------------------------------------------------------
//: Copyright © 2017 <NAME> https://github.com/PhilAndrew  All Rights Reserved.
//: Released under the MIT License, refer to the project website for licence information.
//: -------------------------------------------------------------------------------------

osgiSettings

defaultSingleProjectSettings

// ScalaJS builds from Scala code to Javascript code so therefore it does not get involved in the OSGi process.
// Its dependencies are un-related to OSGi.

lazy val \\ = java.io.File.separator

def recursiveListFiles(f: File): Array[File] = {
  if (f.exists()) {
    val these = f.listFiles
    these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles)
  } else Array[File]()
}

def subPackagesOf(path: String): Seq[String] = {
  def subPackagesOfImpl(prefix: String, path: String): Seq[String] = {
    val file = new File(prefix + \\ + path.replace('.','/'))
    if (file.exists()) {
      val allFiles = recursiveListFiles(file)
      val allNonEmptyDirectories = (for (f <- allFiles; if f.getParentFile.isDirectory) yield f.getParentFile).distinct
      val result: Seq[String] = for (f <- allNonEmptyDirectories; if f.isDirectory) yield {
        f.getPath.replace(prefix + \\, "").replace("\\", ".")
      }
      Seq(path) ++ result
    } else Seq()
  }
  val prefixs = Seq("." + \\ + "src" + \\ + "main" + \\ + "scala", "." + \\ + "src" + \\ + "main" + \\ + "java")
  prefixs.flatMap(subPackagesOfImpl(_, path))
}

lazy val JUMPMICRO_DOT = "jumpmicro."
// @feature end commonheader




















// [jumpmicro.shared, jumpmicro.shared.util, Decidable, Prelude, main]

// ScalaJS builds from Scala code to Javascript code so therefore it does not get involved in the OSGi process.
// Its dependencies are un-related to OSGi.

lazy val privatePackages: Seq[String] = subPackagesOf("bridge") ++ subPackagesOf("korolev")

val projectName = "JMCloner"
name := projectName

// This OSGi bundle version
//bundleVersion := "1.0.0"

lazy val thisVersion = "1.0.0"

version := thisVersion

val scalaMajorVersion = "2.11"
val scalaMinorVersion = "8"

scalaVersion := scalaMajorVersion + "." + scalaMinorVersion

resolvers ++= Seq(
  Resolver.sonatypeRepo("releases"),
  Resolver.sonatypeRepo("snapshots")
  )

lazy val exportPackages = Seq()

// Versions of libraries in use

val slf4jVersion = "1.7.22"     // slf4j logging
val camelVersion = "2.18.2"     // http://camel.apache.org/download.html
val akkaVersion = "2.4.16"      // http://akka.io/downloads/
val akkaHttpVersion = "10.0.3"  // Akka Http library
val catsVersion = "0.9.0"       // https://github.com/typelevel/cats
val shapelessVersion = "2.3.2"  // https://github.com/milessabin/shapeless

lazy val karafDepsMustBeJarFiles = Seq(//"org.neo4j.driver/neo4j-java-driver", // org.neo4j.driver/neo4j-java-driver/1.0.5
  "universe/neo4j-ogm-osgi_2.11", // universe/neo4j-ogm-osgi_2.11/1.4.38
  "org.scaldi/scaldi_2.11", // org.scaldi/scaldi_2.11/0.5.8
  "io.jvm.uuid/scala-uuid_2.11",
  "org.http4s/blaze-core_2.11",
  "org.http4s/blaze-http_2.11",
  "org.http4s/http4s-websocket_2.11")

// Dependencies
// All dependencies take the form of OsgiDependency due to the fact that we need to declare not only
// the SBT dependency such as "com.lihaoyi" %% "scalatags" % "0.6.1" but we also need to specify what
// bundle name we are going to import AND/OR what packages we are going to import.
// The name parameter is not used, only for documentation purposes.
// When should I use Import-Package and when should I use Require-Bundle?
// http://stackoverflow.com/questions/1865819/when-should-i-use-import-package-and-when-should-i-use-require-bundle
lazy val OsgiDependencies = Seq[OsgiDependency](

  OsgiDependency("Better files",
    Seq("com.github.pathikrit" %% "better-files" % "2.17.1"),
    Seq(),<commit_msg>Fix to make it work in Karaf<commit_after>// @feature start commonheader
import java.io.File
import java.security.MessageDigest
import java.util.jar.JarFile

import net.virtualvoid.sbt.graph.{Module, ModuleGraph, ModuleId}
import osgifelix.{ManifestInstructions, OsgiDependency}
import sbt.File

import scala.annotation.tailrec
import scala.collection.immutable.HashSet
import scala.xml.XML
import com.typesafe.sbt.osgi.OsgiKeys._
import org.osgi.framework.Constants
import osgifelix.OsgiFelixPlugin.autoImport._
import sbt.Keys._

//: -------------------------------------------------------------------------------------
//: Copyright © 2017 <NAME> https://github.com/PhilAndrew  All Rights Reserved.
//: Released under the MIT License, refer to the project website for licence information.
//: -------------------------------------------------------------------------------------

osgiSettings

defaultSingleProjectSettings

// ScalaJS builds from Scala code to Javascript code so therefore it does not get involved in the OSGi process.
// Its dependencies are un-related to OSGi.

lazy val \\ = java.io.File.separator

def recursiveListFiles(f: File): Array[File] = {
  if (f.exists()) {
    val these = f.listFiles
    these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles)
  } else Array[File]()
}

def subPackagesOf(path: String): Seq[String] = {
  def subPackagesOfImpl(prefix: String, path: String): Seq[String] = {
    val file = new File(prefix + \\ + path.replace('.','/'))
    if (file.exists()) {
      val allFiles = recursiveListFiles(file)
      val allNonEmptyDirectories = (for (f <- allFiles; if f.getParentFile.isDirectory) yield f.getParentFile).distinct
      val result: Seq[String] = for (f <- allNonEmptyDirectories; if f.isDirectory) yield {
        f.getPath.replace(prefix + \\, "").replace("\\", ".")
      }
      Seq(path) ++ result
    } else Seq()
  }
  val prefixs = Seq("." + \\ + "src" + \\ + "main" + \\ + "scala", "." + \\ + "src" + \\ + "main" + \\ + "java")
  prefixs.flatMap(subPackagesOfImpl(_, path))
}

lazy val JUMPMICRO_DOT = "jumpmicro."
// @feature end commonheader




















// [jumpmicro.shared, jumpmicro.shared.util, Decidable, Prelude, main]

// ScalaJS builds from Scala code to Javascript code so therefore it does not get involved in the OSGi process.
// Its dependencies are un-related to OSGi.

lazy val privatePackages: Seq[String] = subPackagesOf("bridge") ++ subPackagesOf("korolev")

val projectName = "JMCloner"
name := projectName

// This OSGi bundle version
//bundleVersion := "1.0.0"

lazy val thisVersion = "1.0.0"

version := thisVersion

val scalaMajorVersion = "2.11"
val scalaMinorVersion = "8"

scalaVersion := scalaMajorVersion + "." + scalaMinorVersion

resolvers ++= Seq(
  Resolver.sonatypeRepo("releases"),
  Resolver.sonatypeRepo("snapshots")
  )

lazy val exportPackages = Seq()

// Versions of libraries in use

val slf4jVersion = "1.7.22"     // slf4j logging
val camelVersion = "2.18.2"     // http://camel.apache.org/download.html
val akkaVersion = "2.4.16"      // http://akka.io/downloads/
val akkaHttpVersion = "10.0.3"  // Akka Http library
val catsVersion = "0.9.0"       // https://github.com/typelevel/cats
val shapelessVersion = "2.3.2"  // https://github.com/milessabin/shapeless

lazy val karafDepsMustBeJarFiles = Seq(//"org.neo4j.driver/neo4j-java-driver", // org.neo4j.driver/neo4j-java-driver/1.0.5
  "universe/neo4j-ogm-osgi_2.11", // universe/neo4j-ogm-osgi_2.11/1.4.38
  "org.scaldi/scaldi_2.11", // org.scaldi/scaldi_2.11/0.5.8
  "io.jvm.uuid/scala-uuid_2.11",
  "org.http4s/blaze-core_2.11",
  "org.http4s/blaze-http_2.11",
  "org.http4s/http4s-websocket_2.11",
  "com.github.pathikrit/better-files_2.11")

// Dependencies
// All dependencies take the form of OsgiDependency due to the fact that we need to declare not only
// the SBT dependency such as "com.lihaoyi" %% "scalatags" % "0.6.1" but we also need to specify what
// bundle name we are going to import AND/OR what packages we are going to import.
// The name parameter is not used, only for documentation purposes.
// When should I use Import-Package and when should I use Require-Bundle?
// http://stackoverflow.com/questions/1865819/when-should-i-use-import-package-and-when-should-i-use-require-bundle
lazy val OsgiDependencies = Seq[OsgiDependency](

  OsgiDependency("Better files",
    Seq("com.github.pathikrit" %% "better-files" % "2.17.1"),
    Seq(),
{'fraction_non_alphanumeric': 0.17234741252406297, 'fraction_numerical': 0.02208130449552712, 'mean_word_length': 3.064427059364933, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2311336', 'n_tokens_mistral': 3085, 'n_tokens_neox': 2908, 'n_words': 716}