Skip to content

Commit

Permalink
Fix the case that all compilation errors lead to the plugin error
Browse files Browse the repository at this point in the history
  • Loading branch information
pderakhshanfar committed Oct 17, 2024
1 parent fef1054 commit 346ea52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class JavaTestCompiler(
logger.info { "Exit code: '${executionResult.exitCode}'; Execution message: '${executionResult.executionMessage}'" }

val classFilePath = path.replace(".java", ".class")
if (!File(classFilePath).exists()) {
if (executionResult.exitCode == 0 && !File(classFilePath).exists()) {
throw ClassFileNotFoundException("Expected class file at $classFilePath after the compilation of file $path, but it does not exist.")
}
return executionResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class KotlinTestCompiler(
logger.info { "Exit code: '${executionResult.exitCode}'; Execution message: '${executionResult.executionMessage}'" }

val classFilePath = path.removeSuffix(".kt") + ".class"
if (!File(classFilePath).exists()) {
if (executionResult.exitCode == 0 && !File(classFilePath).exists()) {
throw ClassFileNotFoundException("Expected class file at $classFilePath after the compilation of file $path, but it does not exist.")
}
return executionResult
Expand Down

0 comments on commit 346ea52

Please sign in to comment.