mirror of https://github.com/sbt/sbt.git
Start hiding internal types
This commit is contained in:
parent
420679df10
commit
785270faf0
|
|
@ -218,42 +218,6 @@ trait Import {
|
|||
type UpperBound = sbt.internal.util.complete.UpperBound
|
||||
}
|
||||
|
||||
// sbt.internal.util.appmacro
|
||||
object appmacro {
|
||||
import scala.reflect._
|
||||
import macros._
|
||||
|
||||
type BuilderResult[C <: Context with Singleton] = sbt.internal.util.appmacro.BuilderResult[C]
|
||||
val ContextUtil = sbt.internal.util.appmacro.ContextUtil
|
||||
type ContextUtil[C <: Context] = sbt.internal.util.appmacro.ContextUtil[C]
|
||||
type Convert = sbt.internal.util.appmacro.Convert
|
||||
val Converted = sbt.internal.util.appmacro.Converted
|
||||
type Converted[C <: Context with Singleton] = sbt.internal.util.appmacro.Converted[C]
|
||||
val Instance = sbt.internal.util.appmacro.Instance
|
||||
type Instance = sbt.internal.util.appmacro.Instance
|
||||
val KListBuilder = sbt.internal.util.appmacro.KListBuilder
|
||||
val MixedBuilder = sbt.internal.util.appmacro.MixedBuilder
|
||||
type MonadInstance = sbt.internal.util.appmacro.MonadInstance
|
||||
type TupleBuilder = sbt.internal.util.appmacro.TupleBuilder
|
||||
val TupleNBuilder = sbt.internal.util.appmacro.TupleNBuilder
|
||||
}
|
||||
|
||||
// sbt.internal.util.logic
|
||||
object logic {
|
||||
val Atom = sbt.internal.util.logic.Atom
|
||||
type Atom = sbt.internal.util.logic.Atom
|
||||
val Clause = sbt.internal.util.logic.Clause
|
||||
type Clause = sbt.internal.util.logic.Clause
|
||||
val Clauses = sbt.internal.util.logic.Clauses
|
||||
type Clauses = sbt.internal.util.logic.Clauses
|
||||
val Formula = sbt.internal.util.logic.Formula
|
||||
type Formula = sbt.internal.util.logic.Formula
|
||||
type Literal = sbt.internal.util.logic.Literal
|
||||
val Logic = sbt.internal.util.logic.Logic
|
||||
val Negated = sbt.internal.util.logic.Negated
|
||||
type Negated = sbt.internal.util.logic.Negated
|
||||
}
|
||||
|
||||
// sbt.librarymanagement
|
||||
val Artifact = sbt.librarymanagement.Artifact
|
||||
type Artifact = sbt.librarymanagement.Artifact
|
||||
|
|
@ -341,104 +305,9 @@ trait Import {
|
|||
type VersionNumber = sbt.librarymanagement.VersionNumber
|
||||
type VersionNumberCompatibility = sbt.librarymanagement.VersionNumberCompatibility
|
||||
|
||||
// sbt.internal.librarymanagement
|
||||
type ArtifactFilter = sbt.internal.librarymanagement.ArtifactFilter
|
||||
val ComponentManager = sbt.internal.librarymanagement.ComponentManager
|
||||
type ComponentManager = sbt.internal.librarymanagement.ComponentManager
|
||||
type ConfigurationFilter = sbt.internal.librarymanagement.ConfigurationFilter
|
||||
val ConfigurationReportLite = sbt.internal.librarymanagement.ConfigurationReportLite
|
||||
type ConfigurationReportLite = sbt.internal.librarymanagement.ConfigurationReportLite
|
||||
val ConvertResolver = sbt.internal.librarymanagement.ConvertResolver
|
||||
val CustomPomParser = sbt.internal.librarymanagement.CustomPomParser
|
||||
type CustomPomParser = sbt.internal.librarymanagement.CustomPomParser
|
||||
val CustomXmlParser = sbt.internal.librarymanagement.CustomXmlParser
|
||||
type DeliverConfiguration = sbt.internal.librarymanagement.DeliverConfiguration
|
||||
val DependencyFilter = sbt.internal.librarymanagement.DependencyFilter
|
||||
type DependencyFilter = sbt.internal.librarymanagement.DependencyFilter
|
||||
type DependencyFilterExtra = sbt.internal.librarymanagement.DependencyFilterExtra
|
||||
val ExternalIvyConfiguration = sbt.internal.librarymanagement.ExternalIvyConfiguration
|
||||
type ExternalIvyConfiguration = sbt.internal.librarymanagement.ExternalIvyConfiguration
|
||||
val GetClassifiersConfiguration = sbt.internal.librarymanagement.GetClassifiersConfiguration
|
||||
type GetClassifiersConfiguration = sbt.internal.librarymanagement.GetClassifiersConfiguration
|
||||
val GetClassifiersModule = sbt.internal.librarymanagement.GetClassifiersModule
|
||||
type GetClassifiersModule = sbt.internal.librarymanagement.GetClassifiersModule
|
||||
val IfMissing = sbt.internal.librarymanagement.IfMissing
|
||||
type IfMissing = sbt.internal.librarymanagement.IfMissing
|
||||
type ModuleSettings = sbt.internal.librarymanagement.ModuleSettings
|
||||
val InlineConfiguration = sbt.internal.librarymanagement.InlineConfiguration
|
||||
type InlineConfiguration = sbt.internal.librarymanagement.InlineConfiguration
|
||||
type InlineIvyConfiguration = sbt.internal.librarymanagement.InlineIvyConfiguration
|
||||
type InvalidComponent = sbt.internal.librarymanagement.InvalidComponent
|
||||
val IvyActions = sbt.internal.librarymanagement.IvyActions
|
||||
type IvyCache = sbt.internal.librarymanagement.IvyCache
|
||||
val IvyConfiguration = sbt.internal.librarymanagement.IvyConfiguration
|
||||
type IvyConfiguration = sbt.internal.librarymanagement.IvyConfiguration
|
||||
val IvyFileConfiguration = sbt.internal.librarymanagement.IvyFileConfiguration
|
||||
type IvyFileConfiguration = sbt.internal.librarymanagement.IvyFileConfiguration
|
||||
type IvyPaths = sbt.internal.librarymanagement.IvyPaths
|
||||
val IvyRetrieve = sbt.internal.librarymanagement.IvyRetrieve
|
||||
val IvySbt = sbt.internal.librarymanagement.IvySbt
|
||||
type IvySbt = sbt.internal.librarymanagement.IvySbt
|
||||
val IvyUtil = sbt.internal.librarymanagement.IvyUtil
|
||||
val JsonUtil = sbt.internal.librarymanagement.JsonUtil
|
||||
val LogicalClock = sbt.internal.librarymanagement.LogicalClock
|
||||
type LogicalClock = sbt.internal.librarymanagement.LogicalClock
|
||||
val MakePom = sbt.internal.librarymanagement.MakePom
|
||||
type MakePom = sbt.internal.librarymanagement.MakePom
|
||||
val MakePomConfiguration = sbt.internal.librarymanagement.MakePomConfiguration
|
||||
type MakePomConfiguration = sbt.internal.librarymanagement.MakePomConfiguration
|
||||
type ModuleFilter = sbt.internal.librarymanagement.ModuleFilter
|
||||
type NotInCache = sbt.internal.librarymanagement.NotInCache
|
||||
val PomConfiguration = sbt.internal.librarymanagement.PomConfiguration
|
||||
type PomConfiguration = sbt.internal.librarymanagement.PomConfiguration
|
||||
val ProjectResolver = sbt.internal.librarymanagement.ProjectResolver
|
||||
type ProjectResolver = sbt.internal.librarymanagement.ProjectResolver
|
||||
type PublishConfiguration = sbt.internal.librarymanagement.PublishConfiguration
|
||||
val ResolutionCache = sbt.internal.librarymanagement.ResolutionCache
|
||||
type ResolutionCache = sbt.internal.librarymanagement.ResolutionCache
|
||||
type ResolveException = sbt.internal.librarymanagement.ResolveException
|
||||
type ResolverAdapter = sbt.internal.librarymanagement.ResolverAdapter
|
||||
type RetrieveConfiguration = sbt.internal.librarymanagement.RetrieveConfiguration
|
||||
val SbtExclusionRule = sbt.internal.librarymanagement.SbtExclusionRule
|
||||
type SbtExclusionRule = sbt.internal.librarymanagement.SbtExclusionRule
|
||||
val StringUtilities = sbt.internal.librarymanagement.StringUtilities
|
||||
val UnresolvedWarning = sbt.internal.librarymanagement.UnresolvedWarning
|
||||
type UnresolvedWarning = sbt.internal.librarymanagement.UnresolvedWarning
|
||||
val UnresolvedWarningConfiguration = sbt.internal.librarymanagement.UnresolvedWarningConfiguration
|
||||
type UnresolvedWarningConfiguration = sbt.internal.librarymanagement.UnresolvedWarningConfiguration
|
||||
type UpdateConfiguration = sbt.internal.librarymanagement.UpdateConfiguration
|
||||
val UpdateLogging = sbt.internal.librarymanagement.UpdateLogging
|
||||
val UpdateReportLite = sbt.internal.librarymanagement.UpdateReportLite
|
||||
type UpdateReportLite = sbt.internal.librarymanagement.UpdateReportLite
|
||||
|
||||
// sbt.internal.inc.classpath
|
||||
object classpath {
|
||||
type CachedClassLoader = sbt.internal.inc.classpath.CachedClassLoader
|
||||
type ClassFilter = sbt.internal.inc.classpath.ClassFilter
|
||||
type ClassLoaderCache = sbt.internal.inc.classpath.ClassLoaderCache
|
||||
type ClasspathFilter = sbt.internal.inc.classpath.ClasspathFilter
|
||||
val ClasspathUtilities = sbt.internal.inc.classpath.ClasspathUtilities
|
||||
type DifferentLoaders = sbt.internal.inc.classpath.DifferentLoaders
|
||||
type DualEnumeration[T] = sbt.internal.inc.classpath.DualEnumeration[T]
|
||||
type DualLoader = sbt.internal.inc.classpath.DualLoader
|
||||
type ExcludePackagesFilter = sbt.internal.inc.classpath.ExcludePackagesFilter
|
||||
type FilteredLoader = sbt.internal.inc.classpath.FilteredLoader
|
||||
type FixedResources = sbt.internal.inc.classpath.FixedResources
|
||||
type IncludePackagesFilter = sbt.internal.inc.classpath.IncludePackagesFilter
|
||||
type LoaderBase = sbt.internal.inc.classpath.LoaderBase
|
||||
type NativeCopyConfig = sbt.internal.inc.classpath.NativeCopyConfig
|
||||
type NativeCopyLoader = sbt.internal.inc.classpath.NativeCopyLoader
|
||||
type NullLoader = sbt.internal.inc.classpath.NullLoader
|
||||
type PackageFilter = sbt.internal.inc.classpath.PackageFilter
|
||||
type RawResources = sbt.internal.inc.classpath.RawResources
|
||||
val RawURL = sbt.internal.inc.classpath.RawURL
|
||||
type SelfFirstLoader = sbt.internal.inc.classpath.SelfFirstLoader
|
||||
}
|
||||
// sbt.internal.librarymanagement
|
||||
type IvyPaths = sbt.internal.librarymanagement.IvyPaths
|
||||
|
||||
type IncOptions = xsbti.compile.IncOptions
|
||||
type Analysis = sbt.internal.inc.Analysis
|
||||
val Analysis = sbt.internal.inc.Analysis
|
||||
val ClassfileManager = sbt.internal.inc.ClassfileManager
|
||||
type ScalaInstance = sbt.internal.inc.ScalaInstance
|
||||
val ScalaInstance = sbt.internal.inc.ScalaInstance
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
|
||||
logLevel := Level.Debug
|
||||
|
||||
incOptions ~= { _.withApiDebug(true) }
|
||||
|
||||
TaskKey[Unit]("show-apis") <<= (compile in Compile, scalaSource in Compile, javaSource in Compile) map { case (a: sbt.internal.inc.Analysis, scalaSrc: java.io.File, javaSrc: java.io.File) =>
|
||||
TaskKey[Unit]("show-apis") <<= (compile in Compile, scalaSource in Compile, javaSource in Compile) map { case (a: Analysis, scalaSrc: java.io.File, javaSrc: java.io.File) =>
|
||||
val aApi = a.apis.internalAPI("test.A").api.classApi
|
||||
val jApi = a.apis.internalAPI("test.J").api.classApi
|
||||
import xsbt.api.DefaultShowAPI
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
|
||||
// checks number of compilation iterations performed since last `clean` run
|
||||
InputKey[Unit]("check-number-of-compiler-iterations") <<= inputTask { (argTask: TaskKey[Seq[String]]) =>
|
||||
(argTask, compile in Compile) map { case (args: Seq[String], a: sbt.internal.inc.Analysis) =>
|
||||
(argTask, compile in Compile) map { case (args: Seq[String], a: Analysis) =>
|
||||
assert(args.size == 1)
|
||||
val expectedIterationsNumber = args(0).toInt
|
||||
val allCompilationsSize = a.compilations.allCompilations.size
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
|
||||
TaskKey[Unit]("verify-binary-deps") <<= (compile in Compile, classDirectory in Compile, baseDirectory) map {
|
||||
case (a: sbt.internal.inc.Analysis, classDir: java.io.File, base: java.io.File) =>
|
||||
case (a: Analysis, classDir: java.io.File, base: java.io.File) =>
|
||||
val nestedPkgClass = classDir / "test/nested.class"
|
||||
val fooSrc = base / "src/main/scala/test/nested/Foo.scala"
|
||||
assert(!a.relations.binaryDeps(fooSrc).contains(nestedPkgClass), a.relations.toString)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
|
||||
logLevel := Level.Debug
|
||||
|
||||
// dumps analysis into target/analysis-dump.txt file
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
|
||||
InputKey[Unit]("check-number-of-compiler-iterations") <<= inputTask { (argTask: TaskKey[Seq[String]]) =>
|
||||
(argTask, compile in Compile) map { case (args: Seq[String], a: Analysis) =>
|
||||
assert(args.size == 1)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import scala.xml.{ Node, _ }
|
||||
import scala.xml.Utility.trim
|
||||
import sbt.internal.librarymanagement.{ IvySbt, MakePomConfiguration, MakePom }
|
||||
|
||||
lazy val check = taskKey[Unit]("check")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import sbt.internal.inc.classpath.ClasspathUtilities
|
||||
|
||||
lazy val scalaOverride = taskKey[Unit]("Check that the proper version of Scala is on the classpath.")
|
||||
|
||||
lazy val root = (project in file(".")).
|
||||
|
|
@ -12,7 +14,7 @@ def check(className: String): Def.Initialize[Task[Unit]] = fullClasspath in Comp
|
|||
val existing = cp.files.filter(_.getName contains "scala-library")
|
||||
println("Full classpath: " + cp.mkString("\n\t", "\n\t", ""))
|
||||
println("scala-library.jar: " + existing.mkString("\n\t", "\n\t", ""))
|
||||
val loader = classpath.ClasspathUtilities.toLoader(existing)
|
||||
val loader = ClasspathUtilities.toLoader(existing)
|
||||
Class.forName(className, false, loader)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import classpath.ClasspathUtilities
|
||||
import sbt.internal.inc.classpath.ClasspathUtilities
|
||||
|
||||
lazy val root = (project in file(".")).
|
||||
settings(
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import sbt.internal.inc.ScalaInstance
|
||||
|
||||
scalaInstance := ScalaInstance(scalaVersion.value, appConfiguration.value.provider.scalaProvider)
|
||||
|
||||
scalaVersion := "invalid"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import sbt.internal.inc.classpath.ClasspathUtilities
|
||||
|
||||
lazy val superRoot = (project in file("super")).
|
||||
dependsOn(rootRef)
|
||||
|
||||
|
|
@ -22,7 +24,7 @@ def checkTask = (fullClasspath in (rootRef, Compile), fullClasspath in (rootRef,
|
|||
|
||||
def check0(cp: Seq[Attributed[File]], label: String, shouldSucceed: Boolean): Unit =
|
||||
{
|
||||
val loader = classpath.ClasspathUtilities.toLoader(cp.files)
|
||||
val loader = ClasspathUtilities.toLoader(cp.files)
|
||||
println("Checking " + label)
|
||||
val err = try { Class.forName("org.example.ProvidedTest", false, loader); None }
|
||||
catch { case e: Exception => Some(e) }
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
|
||||
InputKey[Unit]("check-number-of-compiler-iterations") <<= inputTask { (argTask: TaskKey[Seq[String]]) =>
|
||||
(argTask, compile in Compile) map { case (args: Seq[String], a: Analysis) =>
|
||||
assert(args.size == 1)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
import complete.DefaultParsers._
|
||||
|
||||
val checkIterations = inputKey[Unit]("Verifies the accumlated number of iterations of incremental compilation.")
|
||||
|
||||
checkIterations := {
|
||||
val expected: Int = (Space ~> NatBasic).parsed
|
||||
val actual: Int = (compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }
|
||||
assert(expected == actual, s"Expected $expected compilations, got $actual")
|
||||
val expected: Int = (Space ~> NatBasic).parsed
|
||||
val actual: Int = (compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }
|
||||
assert(expected == actual, s"Expected $expected compilations, got $actual")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
import complete.DefaultParsers._
|
||||
|
||||
val checkIterations = inputKey[Unit]("Verifies the accumlated number of iterations of incremental compilation.")
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
name := "test"
|
||||
|
||||
TaskKey[Unit]("check-same") <<= compile in Configurations.Compile map { case analysis: Analysis =>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
import complete.DefaultParsers._
|
||||
|
||||
val checkIterations = inputKey[Unit]("Verifies the accumlated number of iterations of incremental compilation.")
|
||||
|
||||
checkIterations := {
|
||||
val expected: Int = (Space ~> NatBasic).parsed
|
||||
val actual: Int = (compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }
|
||||
assert(expected == actual, s"Expected $expected compilations, got $actual")
|
||||
val expected: Int = (Space ~> NatBasic).parsed
|
||||
val actual: Int = (compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }
|
||||
assert(expected == actual, s"Expected $expected compilations, got $actual")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
import complete.DefaultParsers._
|
||||
|
||||
val checkIterations = inputKey[Unit]("Verifies the accumlated number of iterations of incremental compilation.")
|
||||
|
||||
checkIterations := {
|
||||
val expected: Int = (Space ~> NatBasic).parsed
|
||||
val actual: Int = (compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }
|
||||
assert(expected == actual, s"Expected $expected compilations, got $actual")
|
||||
val expected: Int = (Space ~> NatBasic).parsed
|
||||
val actual: Int = (compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }
|
||||
assert(expected == actual, s"Expected $expected compilations, got $actual")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
import complete.DefaultParsers._
|
||||
|
||||
crossTarget in Compile := target.value
|
||||
|
|
@ -5,8 +6,7 @@ crossTarget in Compile := target.value
|
|||
val checkIterations = inputKey[Unit]("Verifies the accumlated number of iterations of incremental compilation.")
|
||||
|
||||
checkIterations := {
|
||||
val expected: Int = (Space ~> NatBasic).parsed
|
||||
val actual: Int = (compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }
|
||||
assert(expected == actual, s"Expected $expected compilations, got $actual")
|
||||
val expected: Int = (Space ~> NatBasic).parsed
|
||||
val actual: Int = (compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }
|
||||
assert(expected == actual, s"Expected $expected compilations, got $actual")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,20 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
|
||||
/* Performs checks related to compilations:
|
||||
* a) checks in which compilation given set of files was recompiled
|
||||
* b) checks overall number of compilations performed
|
||||
*/
|
||||
TaskKey[Unit]("check-compilations") := {
|
||||
val analysis = (compile in Compile).value
|
||||
val analysis = (compile in Compile).value match { case a: Analysis => a }
|
||||
val srcDir = (scalaSource in Compile).value
|
||||
def relative(f: java.io.File): java.io.File = f.relativeTo(srcDir) getOrElse f
|
||||
def findFile(className: String): File = {
|
||||
relative(analysis.relations.definesClass(className).head)
|
||||
}
|
||||
val allCompilations = analysis.compilations.allCompilations
|
||||
val recompiledFiles: Seq[Set[java.io.File]] = allCompilations map { c =>
|
||||
val recompiledFiles = analysis.apis.internal.collect {
|
||||
case (file, api) if api.compilation.startTime == c.startTime => relative(file)
|
||||
case (cn, api) if api.compilation.startTime == c.startTime => findFile(cn)
|
||||
}
|
||||
recompiledFiles.toSet
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
logLevel := Level.Debug
|
||||
import sbt.internal.inc.Analysis
|
||||
|
||||
incOptions := incOptions.value.withNameHashing(true)
|
||||
logLevel := Level.Debug
|
||||
|
||||
// disable sbt's heauristic which recompiles everything in case
|
||||
// some fraction (e.g. 50%) of files is scheduled to be recompiled
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import sbt.internal.inc.ScalaInstance
|
||||
|
||||
lazy val OtherScala = config("other-scala").hide
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue