Skip to content

WIP: delegate dotty compiler info to sbt #1528

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

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
563b8ab
Add symbols to Doc AST, needed for `@usecase`
felixmulder Aug 24, 2016
e8c9277
Add `Comments` object instead of `Scanners.Comment` case class
felixmulder Aug 24, 2016
1caf3c3
Typecheck usecases
felixmulder Aug 24, 2016
c99ff83
Add `UsecasePhase` to dottydoc
felixmulder Aug 24, 2016
d26b59d
Fix name clashes because of `@usecase`
felixmulder Aug 25, 2016
32c6bb7
Fix type parameters not getting properly typed
felixmulder Aug 25, 2016
f65e64b
Move typing of usecases to `typedClassDef`
felixmulder Aug 25, 2016
eef3de6
Fix cooking of docstrings
felixmulder Aug 26, 2016
a957770
Move docstring parser to dottydoc miniphase
felixmulder Aug 27, 2016
e1745ec
Move docstring cooking to dotty
felixmulder Aug 27, 2016
10a3970
Typecheck usecases in fresh local scope
felixmulder Sep 4, 2016
28edec9
Make Context#moreProperties strongly typed
odersky Sep 1, 2016
e4e19e0
Implement docbase as property
felixmulder Sep 8, 2016
ed3f56e
Update readme: mark Exhaustivity checks & multiv.eq. as implemented
DarkDimius Aug 29, 2016
8fa5627
Fix #1490: type test of union types via type alias
liufengyun Sep 1, 2016
930ad0c
Implement constraint merging
odersky Aug 26, 2016
c681930
Handle complex context merging cases
odersky Aug 26, 2016
dc2d178
Handle case where expected type of a SeqLiteral has an undetermined e…
odersky Aug 26, 2016
f024197
TyperState refactoring.
odersky Aug 26, 2016
d4de454
Bump dottydoc version for nightly builds
felixmulder Sep 6, 2016
a95ed55
Get property from environment instead of from sysprops
felixmulder Sep 6, 2016
d224d4a
Partially fix #1500: Implicit search breaks at a certain depth
OlivierBlanvillain Sep 9, 2016
0458e3e
Identation/spacing cleanup
OlivierBlanvillain Sep 7, 2016
ad2b6f8
Fix #1335: Generate null checks for extractors
OlivierBlanvillain Sep 7, 2016
1902f29
Add some run tests
odersky Aug 23, 2016
ffd9dbe
Fix test syntax to make it dotty compatible
odersky Aug 23, 2016
34e5563
Add missing check file.
odersky Aug 23, 2016
b1aaac8
Move t1335 test from /pos to /run
OlivierBlanvillain Sep 15, 2016
d298ea3
Allow try expression without catch or finally, issue warning
felixmulder Sep 14, 2016
8c79ce5
Improve error message on empty catch block
felixmulder Sep 14, 2016
4e08bb1
Fix #1468: Add type parameter support for scala.Dynamic
nicolasstucki Aug 24, 2016
0c407df
Fix #1470: Fix dynamic selection in presence of inaccessible members.
nicolasstucki Aug 24, 2016
7a59a78
fixup #1470
nicolasstucki Sep 5, 2016
39cbe09
Fix #1474: Fix applies to applyDynamic.
nicolasstucki Aug 25, 2016
e82e655
Enable scala.Dynamic pending/untried tests.
nicolasstucki Aug 26, 2016
1c9ef82
Reformat code after fixes on scala.Dynamic.
nicolasstucki Sep 4, 2016
43667b4
Fix #1510: Fix error message when abstract member not implemented.
nicolasstucki Sep 14, 2016
504b1f8
Fix #1513: misaligned by name type parameter type bounds
OlivierBlanvillain Sep 15, 2016
5525b0c
Fix corner case w types ALL passed by name & out of order
OlivierBlanvillain Sep 16, 2016
3a03e24
Fix #1457: Three incompatbilities with scalac
odersky Aug 23, 2016
1656850
Accommodate Scala2 name resolution scheme
odersky Aug 26, 2016
3175d4c
Add test file.
odersky Aug 26, 2016
56bd08f
Refactoring of findRef
odersky Sep 16, 2016
3c7053f
Fix #1503 - be careful where to insert an apply.
odersky Sep 17, 2016
73192b6
Address reviewer comments
odersky Sep 18, 2016
2359fb2
delegate dotty compiler info to sbt
MasseGuillaume Sep 20, 2016
2ff7e40
automatically clean sbt cache for the dotty sbt bridge
MasseGuillaume Sep 21, 2016
5ca5cf4
clean the sbt dotty-bridge before publishing
MasseGuillaume Sep 21, 2016
13b124d
cleanBridge is a workaround for sbt#2402
MasseGuillaume Sep 21, 2016
c5f0d06
failing scripted test
MasseGuillaume Sep 21, 2016
1083d69
green tests
MasseGuillaume Sep 21, 2016
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
5 changes: 2 additions & 3 deletions bridge/src/main/scala/xsbt/CompilerInterface.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ class CachedCompilerImpl(args: Array[String], output: Output, resident: Boolean)
private[this] def run(sources: List[File], changes: DependencyChanges, callback: AnalysisCallback,
log: Logger, delegate: Reporter, compileProgress: CompileProgress): Unit = {
debug(log, args.mkString("Calling Dotty compiler with arguments (CompilerInterface):\n\t", "\n\t", ""))
val ctx = (new ContextBase).initialCtx.fresh
.setSbtCallback(callback)
.setReporter(DelegatingReporter(delegate))
val freshContext = (new ContextBase).initialCtx.fresh
val ctx = freshContext.setSbtCallback(callback).setReporter(DelegatingReporter(delegate))
val cl = getClass.getClassLoader.asInstanceOf[URLClassLoader]

val reporter = DottyMain.process(commandArguments(sources.toArray), ctx)
Expand Down
9 changes: 6 additions & 3 deletions bridge/src/main/scala/xsbt/DelegatingReporter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import core.Contexts._

import xsbti.Maybe

private object DelegatingReporter {
object DelegatingReporter {
def apply(delegate: xsbti.Reporter) = new DelegatingReporter(delegate)
}

private final class DelegatingReporter(delegate: xsbti.Reporter) extends Reporter
final class DelegatingReporter(delegate: xsbti.Reporter) extends Reporter
with UniqueMessagePositions
with HideNonSensicalMessages {

Expand All @@ -38,7 +38,10 @@ private final class DelegatingReporter(delegate: xsbti.Reporter) extends Reporte
def pointer(): xsbti.Maybe[Integer] = offset()
def pointerSpace(): xsbti.Maybe[String] = Maybe.just(" " * pos.point)
def sourceFile(): xsbti.Maybe[java.io.File] = maybe(file)
def sourcePath(): xsbti.Maybe[String] = maybe(file.map(_.getPath))
def sourcePath(): xsbti.Maybe[String] = {
println(file)
maybe(file.map(_.getPath))
}
}

delegate.log(position, d.message, severity)
Expand Down
21 changes: 21 additions & 0 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._

object DottyBuild extends Build {

val cleanBridge = TaskKey[Unit]("clean-sbt-bridge", "delete dotty-sbt-bridge cache")

val baseVersion = "0.1"
val isNightly = sys.env.get("NIGHTLYBUILD") == Some("yes")

Expand Down Expand Up @@ -237,6 +239,25 @@ object DottyBuild extends Build {
).
settings(ScriptedPlugin.scriptedSettings: _*).
settings(
cleanBridge := {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment explaining that this is necessary until sbt/sbt#2402 is fixed

println("*** cleanBridge ***")
val dottyBridgeVersion = version.value
val dottyVersion = (version in dotty).value
val classVersion = System.getProperty("java.class.version")
val sbtV = sbtVersion.value
val home = System.getProperty("user.home")
val org = organization.value
val artifact = moduleName.value

IO.delete(file(home) / ".ivy2" / "local" / "ch.epfl.lamp" / artifact)
IO.delete(file(home) / ".ivy2" / "cache" / "org.scala-sbt" / s"$org-$artifact-$dottyBridgeVersion-bin_${dottyVersion}__$classVersion")
IO.delete(file(home) / ".sbt" / "boot" / "scala-2.10.6" / "org.scala-sbt" / "sbt" / sbtV / s"$org-$artifact-$dottyBridgeVersion-bin_${dottyVersion}__$classVersion")
},

ScriptedPlugin.scripted <<= ScriptedPlugin.scripted
.dependsOn(publishLocal) // 2nd
.dependsOn(cleanBridge), // 1st

ScriptedPlugin.scriptedLaunchOpts := Seq("-Xmx1024m"),
ScriptedPlugin.scriptedBufferLog := false
// TODO: Use this instead of manually copying DottyInjectedPlugin.scala
Expand Down