File tree 6 files changed +19
-4
lines changed
sbt-test/sbt-dotty/scala3doc-empty-test
src/dotty/tools/sbtplugin
6 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ object Build {
56
56
val referenceVersion = " 3.0.0-M3"
57
57
58
58
val baseVersion = " 3.0.0-RC1"
59
- val baseSbtDottyVersion = " 0.5.0 "
59
+ val baseSbtDottyVersion = " 0.5.1 "
60
60
61
61
// Versions used by the vscode extension to create a new project
62
62
// This should be the latest published releases.
Original file line number Diff line number Diff line change
1
+ scalaVersion := sys.props(" plugin.scalaVersion" )
Original file line number Diff line number Diff line change
1
+ addSbtPlugin(" ch.epfl.lamp" % " sbt-dotty" % sys.props(" plugin.version" ))
Original file line number Diff line number Diff line change
1
+ package hello
2
+ /** Hello, world! */
3
+ object Hello {
4
+ def main (args : Array [String ]): Unit = {
5
+ val dotty : Int | String = " dotty"
6
+ println(s " Hello $dotty! " )
7
+ }
8
+ }
Original file line number Diff line number Diff line change
1
+ > doc
2
+ > test:doc
3
+
Original file line number Diff line number Diff line change @@ -444,14 +444,16 @@ object DottyPlugin extends AutoPlugin {
444
444
445
445
private val docSettings = inTask(doc)(Seq (
446
446
tastyFiles := {
447
- val _ = compile.value // Ensure that everything is compiled, so TASTy is available.
447
+ val sources = compile.value // Ensure that everything is compiled, so TASTy is available.
448
448
// sbt is too smart and do not start doc task if there are no *.scala files defined
449
449
file(" ___fake___.scala" ) +:
450
450
(classDirectory.value ** " *.tasty" ).get.map(_.getAbsoluteFile)
451
451
},
452
452
sources := Def .taskDyn[Seq [File ]] {
453
- if (isDotty.value && useScala3doc.value) Def .task { tastyFiles.value }
454
- else Def .task { sources.value }
453
+ val originalSources = sources.value
454
+ if (isDotty.value && useScala3doc.value && originalSources.nonEmpty)
455
+ Def .task { tastyFiles.value }
456
+ else Def .task { originalSources }
455
457
}.value,
456
458
scalacOptions ++= {
457
459
if (isDotty.value) {
You can’t perform that action at this time.
0 commit comments