Skip to content

Commit

Permalink
Addressed minor pull request review suggestions.
Browse files Browse the repository at this point in the history
Removed some todos, decreased line length and declared variables in a constructor.
  • Loading branch information
SergeyDatskiv committed Nov 28, 2024
1 parent 17827c0 commit 0617c35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ class KotlinTestCompiler(
libPaths: List<String>,
junitLibPaths: List<String>,
kotlinSDKHomeDirectory: String,
javaHomeDirectoryPath: String,
private val javaHomeDirectoryPath: String,
) : TestCompiler(libPaths, junitLibPaths) {
private val logger = KotlinLogging.logger { this::class.java }
private val kotlinc: String
// Direct declaration in constructor requires changes to TestCompiler, so we declare it here.
private val javaHomeDirectoryPath = javaHomeDirectoryPath

// init block to find the kotlinc compiler
init {
Expand All @@ -35,7 +33,6 @@ class KotlinTestCompiler(
* as failed compilation because `kotlinc` will complain about
* `java` command missing in PATH.
*
* TODO(vartiukhov): find a way to locate `java` on Windows
*/
val isCompilerName = if (DataFilesUtil.isWindows()) {
it.name.equals("kotlinc")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ object TestCompilerFactory {
JavaTestCompiler(libraryPaths, junitLibraryPaths, javaSDKHomePath)
}
SupportedLanguage.Kotlin -> {
val javaSDKHomePath = findJavaSDKHomePath(javaHomeDirectory, project) // Kotlinc relies on java to compile kotlin files.
// Kotlinc relies on java to compile kotlin files.
val javaSDKHomePath = findJavaSDKHomePath(javaHomeDirectory, project)
// kotlinc should be under `[kotlinSDKHomeDirectory]/bin/kotlinc`
val kotlinSDKHomeDirectory = KotlinPluginLayout.kotlinc.absolutePath
KotlinTestCompiler(libraryPaths, junitLibraryPaths, kotlinSDKHomeDirectory, javaSDKHomePath)
}
Expand Down

0 comments on commit 0617c35

Please sign in to comment.