kotlin-compiler-server icon indicating copy to clipboard operation
kotlin-compiler-server copied to clipboard

Explicitly set the JVM target

Open sheu opened this issue 2 years ago • 8 comments

sheu avatar Jan 09 '23 23:01 sheu

This is meant to fix #579

sheu avatar Jan 09 '23 23:01 sheu

Hi, @sheu.

Nice fix, thank you! You're right :)

Could you please add a test please?

AlexanderPrendota avatar Jan 16 '23 09:01 AlexanderPrendota

@sheu hi, any updates? :)

AlexanderPrendota avatar Feb 06 '23 10:02 AlexanderPrendota

@sheu hi, any updates? :)

I had a hard time figuring out how best to test it. I will push the testcase today.

sheu avatar Feb 07 '23 07:02 sheu

Finally added the test case but that meant that I had to change my solution to make it testable.

sheu avatar Feb 07 '23 14:02 sheu

Hmm, maybe we can just put some code and run it? like

 @Test
  fun `jvm target 11 test`() {
    run(
      code = "fun main() {\n // put some code here \n}",
      contains = "the result of the code"
    )
  }

AlexanderPrendota avatar Feb 07 '23 18:02 AlexanderPrendota

@sheu hi, let's take your first version to the master?

AlexanderPrendota avatar Mar 20 '23 10:03 AlexanderPrendota

Why do you don't set-up the jvmtoolchain using kotlin.jvmtoolchain(11)? This will fix your problems because Gradle sets the correct attributes and the jdk.

hfhbd avatar Mar 20 '23 11:03 hfhbd