File tree Expand file tree Collapse file tree 5 files changed +18
-3
lines changed
sbt-test/sbt-dotty/scala3doc-empty-test
src/dotty/tools/sbtplugin Expand file tree Collapse file tree 5 files changed +18
-3
lines changed 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