<commit_before>/*
 * sbt
 * Copyright 2011 - 2018, Lightbend, Inc.
 * Copyright 2008 - 2010, <NAME>
 * Licensed under Apache License 2.0 (see LICENSE)
 */

package sbt
package internal

import java.io.File
import java.net.{ URL, URLClassLoader }

import sbt.ClassLoaderLayeringStrategy._
import sbt.Keys._
import sbt.SlashSyntax0._
import sbt.internal.inc.ScalaInstance
import sbt.internal.inc.classpath.ClasspathUtilities
import sbt.internal.util.Attributed
import sbt.internal.util.Attributed.data
import sbt.io.IO
import sbt.librarymanagement.Configurations.{ Runtime, Test }

import scala.annotation.tailrec

private[sbt] object ClassLoaders {
  private[this] val interfaceLoader = classOf[sbt.testing.Framework].getClassLoader
  /*
   * Get the class loader for a test task. The configuration could be IntegrationTest or Test.
   */
  private[sbt] def testTask: Def.Initialize[Task[ClassLoader]] = Def.task {
    val si = scalaInstance.value
    val rawCP = data(fullClasspath.value)
    val fullCP = if (si.isManagedVersion) rawCP else si.allJars.toSeq ++ rawCP
    val exclude = dependencyJars(exportedProducts).value.toSet ++ si.allJars
    buildLayers(
      strategy = classLoaderLayeringStrategy.value,
      si = si,
      fullCP = fullCP,
      rawRuntimeDependencies =
        dependencyJars(Runtime / dependencyClasspath).value.filterNot(exclude),
      allDependencies = dependencyJars(dependencyClasspath).value.filterNot(exclude),
      globalCache = (Scope.GlobalScope / classLoaderCache).value,
      runtimeCache = (Runtime / classLoaderCache).value,
      testCache = (Test / classLoaderCache).value,
      resources = ClasspathUtilities.createClasspathResources(fullCP, si),
      tmp = IO.createUniqueDirectory(taskTemporaryDirectory.value),
      scope = resolvedScoped.value.scope
    )
  }<commit_msg>don't include si.allJars into the test classpath<commit_after>/*
 * sbt
 * Copyright 2011 - 2018, Lightbend, Inc.
 * Copyright 2008 - 2010, <NAME>
 * Licensed under Apache License 2.0 (see LICENSE)
 */

package sbt
package internal

import java.io.File
import java.net.{ URL, URLClassLoader }

import sbt.ClassLoaderLayeringStrategy._
import sbt.Keys._
import sbt.SlashSyntax0._
import sbt.internal.inc.ScalaInstance
import sbt.internal.inc.classpath.ClasspathUtilities
import sbt.internal.util.Attributed
import sbt.internal.util.Attributed.data
import sbt.io.IO
import sbt.librarymanagement.Configurations.{ Runtime, Test }

import scala.annotation.tailrec

private[sbt] object ClassLoaders {
  private[this] val interfaceLoader = classOf[sbt.testing.Framework].getClassLoader
  /*
   * Get the class loader for a test task. The configuration could be IntegrationTest or Test.
   */
  private[sbt] def testTask: Def.Initialize[Task[ClassLoader]] = Def.task {
    val si = scalaInstance.value
    val rawCP = data(fullClasspath.value)
    val fullCP = if (si.isManagedVersion) rawCP else List(si.libraryJar) ++ rawCP
    val exclude = dependencyJars(exportedProducts).value.toSet ++ Set(si.libraryJar)
    buildLayers(
      strategy = classLoaderLayeringStrategy.value,
      si = si,
      fullCP = fullCP,
      rawRuntimeDependencies =
        dependencyJars(Runtime / dependencyClasspath).value.filterNot(exclude),
      allDependencies = dependencyJars(dependencyClasspath).value.filterNot(exclude),
      globalCache = (Scope.GlobalScope / classLoaderCache).value,
      runtimeCache = (Runtime / classLoaderCache).value,
      testCache = (Test / classLoaderCache).value,
      resources = ClasspathUtilities.createClasspathResources(fullCP, si),
      tmp = IO.createUniqueDirectory(taskTemporaryDirectory.value),
      scope = resolvedScoped.value.scope
    )
  }
{'fraction_non_alphanumeric': 0.0937331172339276, 'fraction_numerical': 0.010264721772015126, 'mean_word_length': 4.164574616457462, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4549702', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1086, 'n_words': 252}