JavacWrapper: perform makeOutputDirectoryClasses hack only in non-APT mode

For some reason, working without APT requires this call in JavacWrapper.
From the other hand, working without APT does not require
Kotlin class files to be in javac classpath.
This commit is contained in:
Mikhail Glukhikh
2019-10-03 11:58:48 +03:00
parent 64380670c5
commit 89a582b694
@@ -102,6 +102,8 @@ class JavacWrapper(
override fun parseFiles(files: Iterable<JavaFileObject>?) = compilationUnits override fun parseFiles(files: Iterable<JavaFileObject>?) = compilationUnits
} }
private val aptOn = arguments == null || "-proc:none" !in arguments
private val fileManager = context[JavaFileManager::class.java] as JavacFileManager private val fileManager = context[JavaFileManager::class.java] as JavacFileManager
init { init {
@@ -168,7 +170,9 @@ class JavacWrapper(
if (javaFilesNumber == 0) return true if (javaFilesNumber == 0) return true
setClassPathForCompilation(outDir) setClassPathForCompilation(outDir)
makeOutputDirectoryClassesVisible() if (!aptOn) {
makeOutputDirectoryClassesVisible()
}
val outputPath = val outputPath =
// Includes a hack with 'takeIf' for CLI test, to have stable string here (independent from random test directory) // Includes a hack with 'takeIf' for CLI test, to have stable string here (independent from random test directory)