@@ -668,24 +668,32 @@ class KotlinCompilation {
668668 4. Run javac with Java sources and the compiled Kotlin classes
669669 */
670670
671- // step 1 and 2: generate stubs and run annotation processors
672- try {
673- val exitCode = stubsAndApt()
674- if (exitCode != ExitCode .OK ) {
675- val messages = internalMessageBuffer.readUtf8()
676- searchSystemOutForKnownErrors(messages)
677- return Result (exitCode, classesDir, messages)
671+ /* Work around for warning that sometimes happens:
672+ "Failed to initialize native filesystem for Windows
673+ java.lang.RuntimeException: Could not find installation home path.
674+ Please make sure bin/idea.properties is present in the installation directory"
675+ See: https://github.com/arturbosch/detekt/issues/630
676+ */
677+ withSystemProperty(" idea.use.native.fs.for.win" , " false" ) {
678+ // step 1 and 2: generate stubs and run annotation processors
679+ try {
680+ val exitCode = stubsAndApt()
681+ if (exitCode != ExitCode .OK ) {
682+ val messages = internalMessageBuffer.readUtf8()
683+ searchSystemOutForKnownErrors(messages)
684+ return Result (exitCode, classesDir, messages)
685+ }
686+ } finally {
687+ KaptComponentRegistrar .threadLocalParameters.remove()
678688 }
679- } finally {
680- KaptComponentRegistrar .threadLocalParameters.remove()
681- }
682689
683- // step 3: compile Kotlin files
684- compileKotlin().let { exitCode ->
685- if (exitCode != ExitCode .OK ) {
686- val messages = internalMessageBuffer.readUtf8()
687- searchSystemOutForKnownErrors(messages)
688- return Result (exitCode, classesDir, messages)
690+ // step 3: compile Kotlin files
691+ compileKotlin().let { exitCode ->
692+ if (exitCode != ExitCode .OK ) {
693+ val messages = internalMessageBuffer.readUtf8()
694+ searchSystemOutForKnownErrors(messages)
695+ return Result (exitCode, classesDir, messages)
696+ }
689697 }
690698 }
691699
@@ -790,4 +798,3 @@ private fun getHostClasspaths(): List<File> {
790798
791799 return (classpaths + modules).distinctBy(File ::getAbsolutePath)
792800}
793-
0 commit comments