2
2
package sbt .internal .inc .bloop .internal
3
3
4
4
import java .nio .file .Files
5
- import java .nio .file .Path
6
5
import java .util .Optional
7
6
8
7
import scala .concurrent .Promise
@@ -15,7 +14,6 @@ import bloop.tracing.BraveTracer
15
14
import monix .eval .Task
16
15
import sbt .internal .inc .AnalyzingCompiler
17
16
import sbt .internal .inc .CompileConfiguration
18
- import sbt .internal .inc .CompilerArguments
19
17
import sbt .internal .inc .JavaInterfaceUtil .EnrichOption
20
18
import sbt .internal .inc .MixedAnalyzingCompiler
21
19
import sbt .internal .inc .PlainVirtualFileConverter
@@ -48,7 +46,6 @@ final class BloopHighLevelCompiler(
48
46
) {
49
47
private [this ] final val setup = config.currentSetup
50
48
private [this ] final val classpath : Seq [VirtualFile ] = config.classpath
51
- private [this ] final val classpathNio : Seq [Path ] = classpath.map(PlainVirtualFileConverter .converter.toPath)
52
49
53
50
private [this ] val JavaCompleted : Promise [Unit ] = Promise .successful(())
54
51
@@ -67,8 +64,7 @@ final class BloopHighLevelCompiler(
67
64
changes : DependencyChanges ,
68
65
callback : AnalysisCallback ,
69
66
classfileManager : ClassFileManager ,
70
- cancelPromise : Promise [Unit ],
71
- classpathOptions : ClasspathOptions
67
+ cancelPromise : Promise [Unit ]
72
68
): Task [Unit ] = {
73
69
def timed [T ](label : String )(t : => T ): T = {
74
70
tracer.trace(label) { _ =>
@@ -111,32 +107,25 @@ final class BloopHighLevelCompiler(
111
107
}
112
108
}
113
109
114
- def compilerArgs : CompilerArguments = {
110
+ def compileSources (
111
+ sources : Seq [VirtualFile ],
112
+ scalacOptions : Array [String ],
113
+ callback : AnalysisCallback
114
+ ): Unit = {
115
115
import sbt .internal .inc .CompileFailed
116
116
if (scalac.scalaInstance.compilerJars().isEmpty) {
117
117
throw new CompileFailed (new Array (0 ), s " Expected Scala compiler jar in Scala instance containing ${scalac.scalaInstance.allJars().mkString(" , " )}" , new Array (0 ))
118
118
}
119
-
120
119
if (scalac.scalaInstance.libraryJars().isEmpty) {
121
120
throw new CompileFailed (new Array (0 ), s " Expected Scala library jar in Scala instance containing ${scalac.scalaInstance.allJars().mkString(" , " )}" , new Array (0 ))
122
121
}
123
-
124
- new CompilerArguments (scalac.scalaInstance, classpathOptions)
125
- }
126
-
127
- def compileSources (
128
- sources : Seq [VirtualFile ],
129
- scalacOptions : Array [String ],
130
- callback : AnalysisCallback
131
- ): Unit = {
132
122
try {
133
- val args = compilerArgs.makeArguments(Nil , classpathNio, scalacOptions)
134
123
scalac.compile(
135
124
sources.toArray,
136
125
classpath.toArray,
137
126
PlainVirtualFileConverter .converter,
138
127
changes,
139
- args.toArray ,
128
+ scalacOptions ,
140
129
setup.output,
141
130
callback,
142
131
config.reporter,
@@ -158,7 +147,6 @@ final class BloopHighLevelCompiler(
158
147
159
148
def compileSequentially : Task [Unit ] = Task {
160
149
val scalacOptions = setup.options.scalacOptions
161
- val args = compilerArgs.makeArguments(Nil , classpathNio, scalacOptions)
162
150
timed(" scalac" ) {
163
151
compileSources(sources, scalacOptions, callback)
164
152
}
0 commit comments