ktfmt
ktfmt copied to clipboard
Consider providing a binary jar
chmod +x ktfmt-0.50-jar-with-dependencies.jar
./ktfmt-0.50-jar-with-dependencies.jar
zsh: exec format error: ./ktfmt-0.50-jar-with-dependencies.jar
We can't execute this jar directly now, I did something to ktlint like:
https://github.com/pinterest/ktlint/blob/c7083ada451ff0d72a3edb2b3a9d485ee3f0cf96/ktlint-cli/build.gradle.kts#L84-L104
or
https://github.com/Goooler/StringResExporter/blob/5ccfe8ae50aedb10523d3f05ae701a6653ea8763/build.gradle.kts#L74-L94
so that jars can be executed directly.
I'm unfamiliar with Maven, but I would be willing to send a PR if I can do...
Interesting proposition. Are there any tradeoffs from doing this? Would we still be able to do java -jar ktfmt-0.50-jar-with-dependencies.jar? Might be useful in case you want to run ktfmt with a java version other than the "standard" in your machine, or if you don't have java in your path (my_java -jar ktfmt.jar)
Yeah, you can run it like a normal jar with java -jar. Actually, it still depends on your local JDK, but you can execute it like binary applications like the others on Unix.
Sounds good to me then! @Goooler feel free to submit a PR since from our end this is unlikely to get prioritized any time soon.
It would be easier to do this if we could migrate the core project build to Gradle, is there any plan to migrate?
No plans on our side, but I don't see a reason not to do that other than the work required for it and extensive testing to make sure nothing breaks/regresses.
It would actually be a really nice change since other parts of this project are on Gradle already. This is just not something that is currently on the roadmap.
May I file a new issue and try to send a PR?
If you are feeling like it, feel free to send a PR, I'll gladly take that in 😃
Closing the issue as this is not something we'll actively work on and it's also not on our roadmap. Again we'd be happy to take a PR for it