-
Notifications
You must be signed in to change notification settings - Fork 167
build.gradle: add support for Groovy and Kotlin #1962
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
Comments
Lack of Kotlin support is maybe not a bug as it is most likely that only Java was initially targeted. Kotlin support should be changed to a feature request. |
Changes required to the build.gradle file for a Kotlin project: (1) Replace java plugin with kotlin.jvm plugin
(2) Append Kt to mainClass value, i.e. package-name.App becomes package-name.AppKt (3) Put source files in src/main/kotlin and not src/main/java folder (4) An empty settings.gradle file is also required to prevent conflict with top-level settings.gradle file Applied these changes manually, and I could run the Kotlin app with Gradle. |
Minimal code changes were needed to add Kotlin support. Testing the functionality and will submit a pull request later. Tested both a working Java project (to ensure that we do not break Java support) and a working Kotlin project. |
This problem is mentioned in #1944, perhaps we should make this issue a sub-issue of it. |
Groovy supported as well. |
Jbang export gradle support tested with Jbang-enabled Java, Groovy and Kotlin apps generated by the Tulip cli. $ source test_gradle_export.sh File - test_gradle_export.sh
|
Describe the bug
jbang export gradle App.kt
fails to create a build.gradle file that can build and run the JBang Kotlin app.JBang version
0.125.0
The text was updated successfully, but these errors were encountered: