-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java path for kotlin tests compilation on Windows machines #412
base: development
Are you sure you want to change the base?
Java path for kotlin tests compilation on Windows machines #412
Conversation
src/main/kotlin/org/jetbrains/research/testspark/tools/factories/TestCompilerFactory.kt
Show resolved
Hide resolved
Probably closes #320 |
core/src/main/kotlin/org/jetbrains/research/testspark/core/test/kotlin/KotlinTestCompiler.kt
Show resolved
Hide resolved
Kotlin compilation modulo this issue works on my Windows now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with minor suggestions. There is a question about the Java home path param in the Kotlin compiler.
I checked both Java and Kotlin test generation on Mac. Both work as expected.
core/src/main/kotlin/org/jetbrains/research/testspark/core/test/kotlin/KotlinTestCompiler.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/jetbrains/research/testspark/tools/factories/TestCompilerFactory.kt
Outdated
Show resolved
Hide resolved
Removed some todos, decreased line length and declared variables in a constructor.
|
This will create a revert commit, are we okay with that?
Do I need to manually check that issue 320 is also fixed? Because Iurii mentioned that it "probably closes" the issue. Thanks! |
Oh! I think we can do it better: when you start git rebase, type # rebase's todo list opened via `rebase --edit-todo`
[some other commits above]
- 0fab360 Merge branch 'development' into SergeyDatskiv/bugfix/410-javac-path-...
+ break (at the end)
Yeah, I think it requires a manual check. E.g., assign |
In this merge request we are closing an issue where Windows users who did not have java in their PATH variable could not run the generated kotlin tests because
kotlinc
requires Java to be in the path variable.Description of changes made
To address this issue, I added the same Java Path, which is used by the
JavaTestCompiler
to theKotlinTestCompiler
class. This required changing theTestCompilerFacotry
to find the Java path and pass it toKotlinTestCompiler
. I decided to remove dedicated functions for creating Kotlin and Java test compilers because I thought that now they are more similar than different. Instead, I added a private function for finding the Java home path.The
KotlinTestCompiler
now gets ajavaHomeDirectoryPath
which is not directly assigned in the constructor because that would require changing theTestCompiler
class. I thought thatTestCompiler
class should not be dedicated to the Java / Kotlin language, hence I did not change it.The Java path is set only if we detect that the system is a Windows machine. It is set through a chain of commands via command prompt.
Other notes
Why is merge request needed
Closes #410