Skip to content

Move files after -sourcepath fix, fix sbt-dotty retrieval of dotty #7806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion community-build/community-projects/utest
Submodule utest updated 45 files
+0 −1 .gitignore
+3 −3 build.sc
+15 −4 mill
+5 −0 readme.md
+7 −0 utest/js/test/src/test/utest/TestUtil.scala
+3 −10 utest/jvm/src-0/utest/PlatformShims.scala
+2 −10 utest/jvm/src-2/utest/PlatformShims.scala
+17 −0 utest/jvm/src/utest/PlatformShims.scala
+0 −12 utest/jvm/test/src-2.12/test/utest/FormatterTests.scala
+16 −0 utest/jvm/test/src/test/utest/TestUtil.scala
+7 −0 utest/native/test/src/test/utest/TestUtil.scala
+2 −95 utest/src-0/utest/Errors.scala
+16 −14 utest/src-0/utest/TestBuilder.scala
+4 −39 utest/src-0/utest/TestSuite.scala
+4 −17 utest/src-0/utest/Tests.scala
+5 −30 utest/src-0/utest/asserts/Asserts.scala
+3 −1 utest/src-0/utest/asserts/Parallel.scala
+13 −12 utest/src-0/utest/asserts/Tracer.scala
+0 −45 utest/src-0/utest/framework/Model.scala
+2 −94 utest/src-2/utest/Errors.scala
+5 −40 utest/src-2/utest/TestSuite.scala
+5 −12 utest/src-2/utest/Tests.scala
+2 −27 utest/src-2/utest/asserts/Asserts.scala
+1 −1 utest/src-2/utest/asserts/Parallel.scala
+0 −83 utest/src-2/utest/package.scala
+96 −0 utest/src/utest/Errors.scala
+39 −0 utest/src/utest/TestSuite.scala
+16 −0 utest/src/utest/Tests.scala
+29 −1 utest/src/utest/asserts/Asserts.scala
+1 −1 utest/src/utest/asserts/Parallel.scala
+1 −1 utest/src/utest/framework/Model.scala
+18 −10 utest/src/utest/package.scala
+2 −270 utest/test/src-0/test/utest/AssertsTests.scala
+0 −17 utest/test/src-0/test/utest/FutureCrashTest.scala
+3 −278 utest/test/src-2/test/utest/AssertsTests.scala
+0 −85 utest/test/src-2/test/utest/BeforeAfterEachFailureTests.scala
+0 −86 utest/test/src-2/test/utest/FrameworkAsyncTests.scala
+0 −298 utest/test/src-2/test/utest/FrameworkTests.scala
+0 −23 utest/test/src-2/test/utest/examples/HelloTests.scala
+314 −0 utest/test/src/test/utest/AssertsTests.scala
+2 −4 utest/test/src/test/utest/BeforeAfterEachFailureTests.scala
+2 −3 utest/test/src/test/utest/FrameworkAsyncTests.scala
+0 −0 utest/test/src/test/utest/FrameworkTests.scala
+2 −2 utest/test/src/test/utest/FutureCrashTest.scala
+0 −0 utest/test/src/test/utest/examples/HelloTests.scala
9 changes: 0 additions & 9 deletions library/src-bootstrapped/scala/quoted/package.scala

This file was deleted.

56 changes: 0 additions & 56 deletions library/src-non-bootstrapped/scala/tasty/reflect/TreeUtils.scala

This file was deleted.

2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ object Build {
// Settings shared between dotty-library and dotty-library-bootstrapped
lazy val dottyLibrarySettings = Seq(
// Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called
scalacOptions in Compile ++= Seq("-sourcepath", (scalaSource in Compile).value.getAbsolutePath),
scalacOptions in Compile ++= Seq("-sourcepath", (sourceDirectories in Compile).value.map(_.getAbsolutePath).distinct.mkString(File.pathSeparator)),
)

lazy val `dotty-library` = project.in(file("library")).asDottyLibrary(NonBootstrapped)
Expand Down
26 changes: 25 additions & 1 deletion sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,15 @@ object DottyPlugin extends AutoPlugin {

/** Create a scalaInstance task that uses Dotty based on `moduleName`. */
def dottyScalaInstanceTask(moduleName: String): Initialize[Task[ScalaInstance]] = Def.task {
val ivyConfig0 = mkIvyConfiguration.value
// When compiling non-bootstrapped projects in the build of Dotty itself,
// dependency resolution might pick a local project which is not what we
// want. We avoid this by dropping the inter-project resolver.
val ivyConfig1 = ivyConfig0.withResolvers(ivyConfig0.resolvers.filter(_.name != "inter-project"))
val updateReport =
fetchArtifactsOf(
scalaOrganization.value %% moduleName % scalaVersion.value,
dependencyResolution.value,
ivy.IvyDependencyResolution(ivyConfig1),
scalaModuleInfo.value,
updateConfiguration.value,
(unresolvedWarningConfiguration in update).value,
Expand All @@ -431,6 +436,25 @@ object DottyPlugin extends AutoPlugin {
)
}

// Copy-pasted from sbt until we upgrade to a version of sbt
// with https://github.com/sbt/sbt/pull/5271 in.
def mkIvyConfiguration: Initialize[Task[InlineIvyConfiguration]] =
Def.task {
val (rs, other) = (fullResolvers.value.toVector, otherResolvers.value.toVector)
val s = streams.value
Classpaths.warnResolversConflict(rs ++: other, s.log)
InlineIvyConfiguration()
.withPaths(ivyPaths.value)
.withResolvers(rs)
.withOtherResolvers(other)
.withModuleConfigurations(moduleConfigurations.value.toVector)
.withLock(Defaults.lock(appConfiguration.value))
.withChecksums((checksums in update).value.toVector)
.withResolutionCacheDir(crossTarget.value / "resolution-cache")
.withUpdateOptions(updateOptions.value)
.withLog(s.log)
}

def makeScalaInstance(
state: State, dottyVersion: String, scalaLibrary: File, dottyLibrary: File, compiler: File, all: Seq[File]
): ScalaInstance = {
Expand Down
5 changes: 0 additions & 5 deletions tests/neg/i6762.check

This file was deleted.

2 changes: 1 addition & 1 deletion tests/neg/i6762.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import scala.quoted.{_, given}

type G[X]
case class Foo[T](x: T)
def f(word: String)(given QuoteContext): Expr[Foo[G[String]]] = '{Foo(${word.toExpr})} // error
def f(word: String)(given QuoteContext): Expr[Foo[G[String]]] = '{Foo(${Expr(word)})} // error // error