-
-
Notifications
You must be signed in to change notification settings - Fork 769
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
Convert github-milestone-report.groovy to main.kts #2777
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2777 +/- ##
=========================================
Coverage 80.53% 80.53%
Complexity 2321 2321
=========================================
Files 386 386
Lines 6952 6952
Branches 1260 1260
=========================================
Hits 5599 5599
Misses 725 725
Partials 628 628 Continue to review full report at Codecov.
|
You're on Linux right? I got no problem running it on macos. The problem is related to parsing of cli arguments when running a script. It's described in details here: Kotlin/KEEP#75 (comment) So ideally we should replace the first line with:
(can you try?) That's not really elegant, but will make the script usable on every platform. |
Yes!
This works for me so the kotlin compiler is called. I still get this errors: :: problems summary ::
:::: WARNINGS
module not found: org.jetbrains.kotlinx#kotlinx-cli-jvm;0.2.1
==== central: tried
https://repo1.maven.org/maven2/org/jetbrains/kotlinx/kotlinx-cli-jvm/0.2.1/kotlinx-cli-jvm-0.2.1.pom
-- artifact org.jetbrains.kotlinx#kotlinx-cli-jvm;0.2.1!kotlinx-cli-jvm.jar:
https://repo1.maven.org/maven2/org/jetbrains/kotlinx/kotlinx-cli-jvm/0.2.1/kotlinx-cli-jvm-0.2.1.jar
error: cannot access script base class 'org.jetbrains.kotlin.mainKts.MainKtsScript'. Check your module classpath for missing or conflicting dependencies (github-milestone-report.main.kts:10:1) The last time I tried kotlin scripts (some months ago) they were still kinda slow to execute ~ 2 seconds. I prototyped a kts compile daemon which still had a 200/300ms overhead :( I hope it gets better with the 1.4 release. For bigger scripts I still use Groovy with groovyserv which let scripts start instantly. |
Agree, there is space for improvement on the scripting side. Regarding your issue, seems like is this one |
Thanks for investigating this. Lets leave this PR open then. |
Can you give it another try @arturbosch ? It works fine on my end, both on Linux and MacOS. |
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.
Works! clikt seems to be a cool lib.
I'm converting the
github-milestone-report.groovy
script to usekotlin-main-kts
. That's the officially supported scripting support introduced in 1.3.70.https://github.com/Kotlin/KEEP/blob/master/proposals/scripting-support.md#kotlin-main-kts
For the cli parsing I've used kotlinx.cli, that this is still experimental but given the nature of this script shouldn't be a problem.
The script should just work out of the box, as long as you have
kotlin
installed locally.