Cleanup code: JavacWrapper

This commit is contained in:
Mikhail Glukhikh
2019-09-10 16:28:36 +03:00
parent 2bec60a3dd
commit f6ff580852
@@ -167,8 +167,10 @@ class JavacWrapper(
if (javaFilesNumber == 0) return true if (javaFilesNumber == 0) return true
fileManager.setClassPathForCompilation(outDir) fileManager.setClassPathForCompilation(outDir)
context.get(Log.outKey)?.println("Compiling $javaFilesNumber Java source files" + context.get(Log.outKey)?.println(
" to [${fileManager.getLocation(StandardLocation.CLASS_OUTPUT)?.firstOrNull()?.path}]") "Compiling $javaFilesNumber Java source files" +
" to [${fileManager.getLocation(StandardLocation.CLASS_OUTPUT)?.firstOrNull()?.path}]"
)
compile(fileObjects) compile(fileObjects)
errorCount() == 0 errorCount() == 0
} }
@@ -274,8 +276,7 @@ class JavacWrapper(
javaFileObject.toUri().let { uri -> javaFileObject.toUri().let { uri ->
if (uri.scheme == "jar") { if (uri.scheme == "jar") {
jarFileSystem.findFileByPath(uri.schemeSpecificPart.substring("file:".length)) jarFileSystem.findFileByPath(uri.schemeSpecificPart.substring("file:".length))
} } else {
else {
localFileSystem.findFileByPath(uri.schemeSpecificPart) localFileSystem.findFileByPath(uri.schemeSpecificPart)
} }
} }
@@ -283,8 +284,7 @@ class JavacWrapper(
fun hasKotlinPackage(fqName: FqName) = fun hasKotlinPackage(fqName: FqName) =
if (kotlinClassifiersCache.hasPackage(fqName)) { if (kotlinClassifiersCache.hasPackage(fqName)) {
fqName fqName
} } else {
else {
null null
} }