<commit_before>package sbtassembly

import sbt._
import Keys._
import scala.io.Source

object AssemblyPlugin extends sbt.AutoPlugin {
  override def requires = plugins.JvmPlugin
  override def trigger = allRequirements

  object autoImport extends AssemblyKeys {
    val Assembly = sbtassembly.Assembly
    val MergeStrategy = sbtassembly.MergeStrategy
    val PathList = sbtassembly.PathList
    val baseAssemblySettings = AssemblyPlugin.baseAssemblySettings
    val ShadeRule = sbtassembly.ShadeRule
  }
  import autoImport.{ Assembly => _, baseAssemblySettings => _, _ }

  val defaultShellScript: Seq[String] = Seq("#!/usr/bin/env sh", """exec java -jar "$0" "$@"""") // "

  override lazy val projectSettings: Seq[Def.Setting[_]] = assemblySettings

  lazy val baseAssemblySettings: Seq[sbt.Def.Setting[_]] = Seq(
    assembly := Assembly.assemblyTask(assembly).value,
    logLevel in assembly := Level.Info,
    assembledMappings in assembly                   := Assembly.assembledMappingsTask(assembly).value,
    assemblyPackageScala                            := Assembly.assemblyTask(assemblyPackageScala).value,
    assembledMappings in assemblyPackageScala       := Assembly.assembledMappingsTask(assemblyPackageScala).value,
    assemblyPackageDependency                       := Assembly.assemblyTask(assemblyPackageDependency).value,
    assembledMappings in assemblyPackageDependency  := Assembly.assembledMappingsTask(assemblyPackageDependency).value,

    // test
    test in assembly := (test in Test).value,
    test in assemblyPackageScala := (test in assembly).value,
    test in assemblyPackageDependency := (test in assembly).value,

    // assemblyOption
    assembleArtifact in packageBin := true,
    assembleArtifact in assemblyPackageScala := true,
    assembleArtifact in assemblyPackageDependency := true,
    assemblyMergeStrategy in assembly := MergeStrategy.defaultMergeStrategy,
    assemblyShadeRules in assembly := Seq(),
    assemblyExcludedJars in assembly := Nil,
    assemblyOption in assembly := {
      val s = streams.value
      AssemblyOption(
        assemblyDirectory  = s.cacheDirectory / "assembly",
        includeBin         = (assembleArtifact in packageBin).value,
        includeScala       = (assembleArtifact in assemblyPackageScala).value,
        includeDependency  = (assembleArtifact in assemblyPackageDependency).value,<commit_msg>Fix defaultShellScript when providing arguments, fixes #240 and fixes #246<commit_after>package sbtassembly

import sbt._
import Keys._
import scala.io.Source

object AssemblyPlugin extends sbt.AutoPlugin {
  override def requires = plugins.JvmPlugin
  override def trigger = allRequirements

  object autoImport extends AssemblyKeys {
    val Assembly = sbtassembly.Assembly
    val MergeStrategy = sbtassembly.MergeStrategy
    val PathList = sbtassembly.PathList
    val baseAssemblySettings = AssemblyPlugin.baseAssemblySettings
    val ShadeRule = sbtassembly.ShadeRule
  }
  import autoImport.{ Assembly => _, baseAssemblySettings => _, _ }

  val defaultShellScript: Seq[String] = Seq("#!/usr/bin/env sh", """exec java -jar "$0" "$@"""" + "\n")

  override lazy val projectSettings: Seq[Def.Setting[_]] = assemblySettings

  lazy val baseAssemblySettings: Seq[sbt.Def.Setting[_]] = Seq(
    assembly := Assembly.assemblyTask(assembly).value,
    logLevel in assembly := Level.Info,
    assembledMappings in assembly                   := Assembly.assembledMappingsTask(assembly).value,
    assemblyPackageScala                            := Assembly.assemblyTask(assemblyPackageScala).value,
    assembledMappings in assemblyPackageScala       := Assembly.assembledMappingsTask(assemblyPackageScala).value,
    assemblyPackageDependency                       := Assembly.assemblyTask(assemblyPackageDependency).value,
    assembledMappings in assemblyPackageDependency  := Assembly.assembledMappingsTask(assemblyPackageDependency).value,

    // test
    test in assembly := (test in Test).value,
    test in assemblyPackageScala := (test in assembly).value,
    test in assemblyPackageDependency := (test in assembly).value,

    // assemblyOption
    assembleArtifact in packageBin := true,
    assembleArtifact in assemblyPackageScala := true,
    assembleArtifact in assemblyPackageDependency := true,
    assemblyMergeStrategy in assembly := MergeStrategy.defaultMergeStrategy,
    assemblyShadeRules in assembly := Seq(),
    assemblyExcludedJars in assembly := Nil,
    assemblyOption in assembly := {
      val s = streams.value
      AssemblyOption(
        assemblyDirectory  = s.cacheDirectory / "assembly",
        includeBin         = (assembleArtifact in packageBin).value,
        includeScala       = (assembleArtifact in assemblyPackageScala).value,
        includeDependency  = (assembleArtifact in assemblyPackageDependency).value,
{'fraction_non_alphanumeric': 0.08166632295318622, 'fraction_numerical': 0.0016498247061249743, 'mean_word_length': 3.8067393458870167, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1683805', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1194, 'n_words': 311}