Skip to content

Commit f62dab7

Browse files
committed
Move some stuff around
1 parent e2d6378 commit f62dab7

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/main/kotlin/com/tschuchort/compiletesting/KotlinCompilation.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,6 @@ class KotlinCompilation {
410410

411411
/** Performs the 1st and 2nd compilation step to generate stubs and run annotation processors */
412412
private fun stubsAndApt(sourceFiles: List<File>): ExitCode {
413-
pluginClasspaths.forEach { filepath ->
414-
if (!filepath.exists()) {
415-
error("Plugin $filepath not found")
416-
return ExitCode.INTERNAL_ERROR
417-
}
418-
}
419-
420413
if(annotationProcessors.isEmpty()) {
421414
log("No services were given. Not running kapt steps.")
422415
return ExitCode.OK
@@ -682,6 +675,13 @@ class KotlinCompilation {
682675
// write given sources to working directory
683676
val sourceFiles = sources.map { it.writeIfNeeded(sourcesDir) }
684677

678+
pluginClasspaths.forEach { filepath ->
679+
if (!filepath.exists()) {
680+
error("Plugin $filepath not found")
681+
return Result(ExitCode.INTERNAL_ERROR, classesDir, "")
682+
}
683+
}
684+
685685
/*
686686
There are 4 steps to the compilation process:
687687
1. Generate stubs (using kotlinc with kapt plugin which does no further compilation)

src/test/kotlin/com/tschuchort/compiletesting/KotlinCompilationTests.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,9 @@ class KotlinCompilationTests {
633633
}.compile()
634634

635635
assertThat(result.exitCode).isEqualTo(ExitCode.OK)
636-
assertThat(result.messages).contains("provided plugin org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationComponentRegistrar")
636+
assertThat(result.messages).contains(
637+
"provided plugin org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationComponentRegistrar"
638+
)
637639
}
638640

639641
@Test

0 commit comments

Comments
 (0)