@@ -668,24 +668,32 @@ class KotlinCompilation {
668
668
4. Run javac with Java sources and the compiled Kotlin classes
669
669
*/
670
670
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()
678
688
}
679
- } finally {
680
- KaptComponentRegistrar .threadLocalParameters.remove()
681
- }
682
689
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
+ }
689
697
}
690
698
}
691
699
@@ -790,4 +798,3 @@ private fun getHostClasspaths(): List<File> {
790
798
791
799
return (classpaths + modules).distinctBy(File ::getAbsolutePath)
792
800
}
793
-
0 commit comments