@@ -8,6 +8,7 @@ import core.Comments.{ContextDoc, ContextDocstrings}
8
8
import core .Contexts .{Context , ContextBase }
9
9
import core .{MacroClassLoader , Mode , TypeError }
10
10
import dotty .tools .dotc .ast .Positioned
11
+ import dotty .tools .io .File
11
12
import reporting ._
12
13
13
14
import scala .util .control .NonFatal
@@ -70,19 +71,26 @@ class Driver {
70
71
protected def fromTastySetup (fileNames0 : List [String ], ctx0 : Context ): (List [String ], Context ) = {
71
72
if (ctx0.settings.fromTasty.value(ctx0)) {
72
73
// Resolve classpath and class names of tasty files
73
- val (classPaths, classNames) = fileNames0.map { name =>
74
+ val (classPaths, classNames) = fileNames0.flatMap { name =>
74
75
val path = Paths .get(name)
75
- if (! name.endsWith(" .tasty" )) (" " , name)
76
+ if (name.endsWith(" .jar" )) {
77
+ new dotty.tools.io.Jar (File (name)).iterator.collect {
78
+ case e if e.getName.endsWith(" .tasty" ) =>
79
+ (name, e.getName.stripSuffix(" .tasty" ).replace(" /" , " ." ))
80
+ }.toList
81
+ }
82
+ else if (! name.endsWith(" .tasty" ))
83
+ (" " , name) :: Nil
76
84
else if (Files .exists(path)) {
77
85
TastyFileUtil .getClassName(path) match {
78
- case Some (res) => res
86
+ case Some (res) => res:: Nil
79
87
case _ =>
80
88
ctx0.error(s " Could not load classname from $name. " )
81
- (" " , name)
89
+ (" " , name) :: Nil
82
90
}
83
91
} else {
84
92
ctx0.error(s " File $name does not exist. " )
85
- (" " , name)
93
+ (" " , name) :: Nil
86
94
}
87
95
}.unzip
88
96
val ctx1 = ctx0.fresh
0 commit comments