<commit_before>/*
 * Copyright 2015-2016 The Developers Team.
 *
 * 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 com.github.oheger.sbt.spifly.SbtSpiFly
import com.github.oheger.sbt.spifly.SbtSpiFly.autoImport._
import com.typesafe.sbt.osgi.SbtOsgi.autoImport._
import com.typesafe.sbt.osgi.{OsgiKeys, SbtOsgi}
import de.heikoseeberger.sbtheader.HeaderPlugin
import de.heikoseeberger.sbtheader.license.Apache2_0
import sbt.Keys._
import sbt._

object Build extends Build {
  /** Definition of versions. */
  lazy val AkkaVersion = "2.4.8"
  lazy val OsgiVersion = "5.0.0"

  /** The copyright dates. */
  val CopyRight = "2015-2016"

  lazy val akkaDependencies = Seq(
    "com.typesafe.akka" %% "akka-actor" % AkkaVersion,
    "com.typesafe.akka" %% "akka-testkit" % AkkaVersion,
    "com.typesafe.akka" %% "akka-remote" % AkkaVersion,
    "com.typesafe.akka" %% "akka-stream" % AkkaVersion
  )

  lazy val testDependencies = Seq(
    "org.scalatest" %% "scalatest" % "2.1.6" % "test",
    "junit" % "junit" % "4.12" % "test",
    "org.mockito" % "mockito-core" % "1.9.5" % "test"
  )

  lazy val jguiraffeDependencies = Seq(
    "net.sf.jguiraffe" % "jguiraffe-java-fx" % "1.3.1" exclude
      ("commons-discovery", "commons-discovery") exclude("jdom", "jdom"),
    "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4"
  )

  lazy val osgiDependencies = Seq(
    "org.osgi" % "org.osgi.core" % OsgiVersion % "provided",
    "org.osgi" % "org.osgi.compendium" % OsgiVersion % "provided"
  )

  lazy val logDependencies = Seq(
    "org.slf4j" % "slf4j-api" % "1.7.10",
    "org.slf4j" % "slf4j-simple" % "1.7.10" % "test"
  )

  val defaultSettings = Seq(
    version := "1.0-SNAPSHOT",
    scalaVersion := "2.11.8",
    libraryDependencies ++= akkaDependencies,
    libraryDependencies ++= testDependencies,
    libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.0.3",
    HeaderPlugin.autoImport.headers := Map(
      "scala" -> Apache2_0(CopyRight, "The Developers Team."),
      "conf" -> Apache2_0(CopyRight, "The Developers Team.", "#")
    )
  )

  lazy val root = Project(id = "LineDJ",
    base = file("."))
    .settings(defaultSettings: _*)
    .settings(
      name := "linedj-parent"
    ) aggregate(shared, server, actorSystem, client, mediaBrowser, playlistEditor, reorderMedium,
      reorderRandomSongs, reorderAlbum, reorderArtist, playerEngine, radioPlayer,
      mp3PlaybackContextFactory, mediaIfcActors, mediaIfcRemote, mediaIfcEmbedded,
      mediaIfcDisabled)

  /**
    * A project with shared code which needs to be available on both client
    * and server.
    */
  lazy val shared = Project(id = "shared",
    base = file("shared"))
    .enablePlugins(SbtOsgi)
    .settings(defaultSettings: _*)
    .settings(osgiSettings: _*)
    .settings(
      name := "linedj-shared",
      OsgiKeys.exportPackage := Seq("de.oliver_heger.linedj.*")
    )

  /**
    * The server project. This contains code to manage the library with
    * artists, albums, and songs.
    */
  lazy val server = Project(id = "server",
    base = file("server"))
    .enablePlugins(SbtOsgi)
    .settings(defaultSettings: _*)
    .settings(osgiSettings: _*)
    .settings(
      name := "linedj-server",
      libraryDependencies ++= logDependencies,
      libraryDependencies += "commons-configuration" % "commons-configuration" % "1.10",
      OsgiKeys.exportPackage := Seq("de.oliver_heger.linedj.archive.*")
    ) dependsOn (shared % "compile->compile;test->test")

  /**
    * Project for the client platform. This project contains code shared by
    * all visual client applications.
    */
  lazy val client = Project(id = "client",
    base = file("client"))
    .enablePlugins(SbtOsgi)
    .settings(defaultSettings: _*)
    .settings(osgiSettings: _*)
    .settings(
      name := "linedj-client",
      resolvers += Resolver.mavenLocal,
      libraryDependencies ++= jguiraffeDependencies,
      libraryDependencies ++= osgiDependencies,
      OsgiKeys.exportPackage := Seq("de.oliver_heger.linedj.client.*"),
      OsgiKeys.additionalHeaders :=
        Map("Service-Component" -> "OSGI-INF/managementapp_component.xml")
    ) dependsOn (shared % "compile->compile;test->test")

  /**
    * A project providing the client-side actor system. This project uses the
    * akka OSGi-integration to setup an actor system and making it available as
    * OSGi service. It can then be used by all client applications.
    */
  lazy val actorSystem = Project(id = "actorSystem", base = file("actorSystem"))
    .enablePlugins(SbtOsgi)
    .settings(defaultSettings: _*)
    .settings(osgiSettings: _*)
    .settings(
      name := "linedj-actorSystem",
      libraryDependencies ++= osgiDependencies,
      libraryDependencies += "com.typesafe.akka" %% "akka-osgi" % AkkaVersion,
      OsgiKeys.privatePackage := Seq("de.oliver_heger.linedj.actorsystem"),
      OsgiKeys.bundleActivator := Some("de.oliver_heger.linedj.actorsystem.Activator")
    ) dependsOn shared

  /**
    * Project for the media browser client application. This application allows
    * browsing through the media stored in the music library.
    */
  lazy val mediaBrowser = Project(id = "browser",
    base = file("browser"))
    .enablePlugins(SbtOsgi)
    .settings(defaultSettings: _*)
    .settings(osgiSettings: _*)
    .settings(
      name := "linedj-browser",
      resolvers += Resolver.mavenLocal,
      libraryDependencies ++= jguiraffeDependencies,
      libraryDependencies ++= osgiDependencies,
      OsgiKeys.privatePackage := Seq(
        "de.oliver_heger.linedj.browser.*"
      ),
      OsgiKeys.importPackage := Seq(
        "de.oliver_heger.linedj.client.bus",<commit_msg>Created a new project to start the media archive.<commit_after>/*
 * Copyright 2015-2016 The Developers Team.
 *
 * 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 com.github.oheger.sbt.spifly.SbtSpiFly
import com.github.oheger.sbt.spifly.SbtSpiFly.autoImport._
import com.typesafe.sbt.osgi.SbtOsgi.autoImport._
import com.typesafe.sbt.osgi.{OsgiKeys, SbtOsgi}
import de.heikoseeberger.sbtheader.HeaderPlugin
import de.heikoseeberger.sbtheader.license.Apache2_0
import sbt.Keys._
import sbt._

object Build extends Build {
  /** Definition of versions. */
  lazy val AkkaVersion = "2.4.8"
  lazy val OsgiVersion = "5.0.0"

  /** The copyright dates. */
  val CopyRight = "2015-2016"

  lazy val akkaDependencies = Seq(
    "com.typesafe.akka" %% "akka-actor" % AkkaVersion,
    "com.typesafe.akka" %% "akka-testkit" % AkkaVersion,
    "com.typesafe.akka" %% "akka-remote" % AkkaVersion,
    "com.typesafe.akka" %% "akka-stream" % AkkaVersion
  )

  lazy val testDependencies = Seq(
    "org.scalatest" %% "scalatest" % "2.1.6" % "test",
    "junit" % "junit" % "4.12" % "test",
    "org.mockito" % "mockito-core" % "1.9.5" % "test"
  )

  lazy val jguiraffeDependencies = Seq(
    "net.sf.jguiraffe" % "jguiraffe-java-fx" % "1.3.1" exclude
      ("commons-discovery", "commons-discovery") exclude("jdom", "jdom"),
    "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4"
  )

  lazy val osgiDependencies = Seq(
    "org.osgi" % "org.osgi.core" % OsgiVersion % "provided",
    "org.osgi" % "org.osgi.compendium" % OsgiVersion % "provided"
  )

  lazy val logDependencies = Seq(
    "org.slf4j" % "slf4j-api" % "1.7.10",
    "org.slf4j" % "slf4j-simple" % "1.7.10" % "test"
  )

  val defaultSettings = Seq(
    version := "1.0-SNAPSHOT",
    scalaVersion := "2.11.8",
    libraryDependencies ++= akkaDependencies,
    libraryDependencies ++= testDependencies,
    libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.0.3",
    HeaderPlugin.autoImport.headers := Map(
      "scala" -> Apache2_0(CopyRight, "The Developers Team."),
      "conf" -> Apache2_0(CopyRight, "The Developers Team.", "#")
    )
  )

  lazy val root = Project(id = "LineDJ",
    base = file("."))
    .settings(defaultSettings: _*)
    .settings(
      name := "linedj-parent"
    ) aggregate(shared, server, actorSystem, client, mediaBrowser, playlistEditor, reorderMedium,
      reorderRandomSongs, reorderAlbum, reorderArtist, playerEngine, radioPlayer,
      mp3PlaybackContextFactory, mediaIfcActors, mediaIfcRemote, mediaIfcEmbedded,
      mediaIfcDisabled, archiveStartup)

  /**
    * A project with shared code which needs to be available on both client
    * and server.
    */
  lazy val shared = Project(id = "shared",
    base = file("shared"))
    .enablePlugins(SbtOsgi)
    .settings(defaultSettings: _*)
    .settings(osgiSettings: _*)
    .settings(
      name := "linedj-shared",
      OsgiKeys.exportPackage := Seq("de.oliver_heger.linedj.*")
    )

  /**
    * The server project. This contains code to manage the library with
    * artists, albums, and songs.
    */
  lazy val server = Project(id = "server",
    base = file("server"))
    .enablePlugins(SbtOsgi)
    .settings(defaultSettings: _*)
    .settings(osgiSettings: _*)
    .settings(
      name := "linedj-server",
      libraryDependencies ++= logDependencies,
      libraryDependencies += "commons-configuration" % "commons-configuration" % "1.10",
      OsgiKeys.exportPackage := Seq("de.oliver_heger.linedj.archive.*")
    ) dependsOn (shared % "compile->compile;test->test")

  /**
    * Project for the client platform. This project contains code shared by
    * all visual client applications.
    */
  lazy val client = Project(id = "client",
    base = file("client"))
    .enablePlugins(SbtOsgi)
    .settings(defaultSettings: _*)
    .settings(osgiSettings: _*)
    .settings(
      name := "linedj-client",
      resolvers += Resolver.mavenLocal,
      libraryDependencies ++= jguiraffeDependencies,
      libraryDependencies ++= osgiDependencies,
      OsgiKeys.exportPackage := Seq("de.oliver_heger.linedj.client.*"),
      OsgiKeys.additionalHeaders :=
        Map("Service-Component" -> "OSGI-INF/managementapp_component.xml")
    ) dependsOn (shared % "compile->compile;test->test")

  /**
    * A project providing the client-side actor system. This project uses the
    * akka OSGi-integration to setup an actor system and making it available as
    * OSGi service. It can then be used by all client applications.
    */
  lazy val actorSystem = Project(id = "actorSystem", base = file("actorSystem"))
    .enablePlugins(SbtOsgi)
    .settings(defaultSettings: _*)
    .settings(osgiSettings: _*)
    .settings(
      name := "linedj-actorSystem",
      libraryDependencies ++= osgiDependencies,
      libraryDependencies += "com.typesafe.akka" %% "akka-osgi" % AkkaVersion,
      OsgiKeys.privatePackage := Seq("de.oliver_heger.linedj.actorsystem"),
      OsgiKeys.bundleActivator := Some("de.oliver_heger.linedj.actorsystem.Activator")
    ) dependsOn shared

  /**
    * A project which is responsible for starting up the media archive in an
    * OSGi environment. (The archive project itself should be independent on
    * OSGi; therefore, there is a separate project for the startup of the
    * archive in OSGi.)
    */
  lazy val archiveStartup = Project(id = "archiveStartup",
    base = file("archiveStartup"))
    .enablePlugins(SbtOsgi)
    .settings(defaultSettings: _*)
    .settings(osgiSettings: _*)
    .settings(
      name := "linedj-archiveStartup",
      libraryDependencies ++= osgiDependencies,
      OsgiKeys.privatePackage := Seq("de.oliver_heger.linedj.archivestart.*"),
      OsgiKeys.additionalHeaders :=
        Map("Service-Component" -> "OSGI-INF/*.xml")
    ) dependsOn (client, server)

  /**
    * Project for the media browser client application. This application allows
    * browsing through the media stored in the music library.
    */
  lazy val mediaBrowser = Project(id = "browser",
    base = file("browser"))
    .enablePlugins(SbtOsgi)
    .settings(defaultSettings: _*)
    .settings(osgiSettings: _*)
    .settings(
      name := "linedj-browser",
      resolvers += Resolver.mavenLocal,
      libraryDependencies ++= jguiraffeDependencies,
      libraryDependencies ++= osgiDependencies,
      OsgiKeys.privatePackage := Seq(
        "de.oliver_heger.linedj.browser.*"
      ),
      OsgiKeys.importPackage := Seq(
        "de.oliver_heger.linedj.client.bus",
{'fraction_non_alphanumeric': 0.13074018126888218, 'fraction_numerical': 0.010876132930513595, 'mean_word_length': 3.364205669083718, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 5}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2598797', 'n_tokens_mistral': 4458, 'n_tokens_neox': 4228, 'n_words': 991}