Skip to content
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

Integrate existing Kotlin support to Buildship and let people try it out #222

Closed
5 tasks
donat opened this issue Feb 4, 2017 · 33 comments
Closed
5 tasks

Comments

@donat
Copy link
Contributor

donat commented Feb 4, 2017

Issue by donat
Friday Jan 13, 2017 at 10:35 GMT


Motivation

Proposed Change

Code review

  • Does the change work?
  • Is the change sufficiently tested?
  • Is the public API modification handled appropriately?
  • Is it sufficiently documented?
  • Is it implemented well?

See also the full checklist.

@donat
Copy link
Contributor Author

donat commented Feb 4, 2017

Comment by donat
Friday Jan 27, 2017 at 14:16 GMT


Here's how to try it:

  1. Download Eclipse Neon
  2. Install the Kotlin Eclipse plugins. Select Help > Install New Software from the Eclipse menu and use the following update site: https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_EclipsePlugin/1079489:id/
  3. Install the Buildship snapshot from this update site: https://builds.gradle.org/repository/download/Tooling_Master_Eclipse_Experimental_Eclipse46withKotlinSupport/3153932:id/update-site The credentials are guest/guest
  4. Import the samples from the gradle-script-kotlin library.

What to expect:

  • Syntax highlighting, error markers, navigation, refactoring, code completion works.
  • Kotlin model accessed synchronously, therefore the UI hang a lot.
  • Javadoc hover doesn't work.

@donat donat added this to the Buildship 2.1 milestone Feb 4, 2017
@donat
Copy link
Contributor Author

donat commented Feb 4, 2017

Comment by donat
Friday Jan 27, 2017 at 14:21 GMT


PR for the review: #202

@donat
Copy link
Contributor Author

donat commented Feb 4, 2017

Comment by oehme
Monday Jan 30, 2017 at 17:36 GMT


I gave it a first spin. I could open a Kotlin script and write some very basic stuff, yay :) However, there seem to be a lot of problems atm (or maybe my install is broken somehow):

  • it doesn't use the specified Gradle version, but a hardcoded one
  • loading the model seems pretty slow for such small projects
  • loading the model every time I open a file is making the slowness worse
  • I get lots of error markers in multi-kotlin-project-config-injection example
    • Unresolved reference: KotlinCompile
    • Expression 'plugins' of type 'PluginContainer!' cannot be invoked as a function. The function 'invoke()' is not found
    • cannot access class java.lang.Object, check your module path
    • and many more, I can do a screenshare if needed
  • auto completion is generally very slow
  • navigation to source doesn't work
  • no outline view

I didn't get further than that, since the general slowness and the many error markers make it hard to write something.

@donat
Copy link
Contributor Author

donat commented Feb 4, 2017

Comment by donat
Tuesday Jan 31, 2017 at 09:53 GMT


Thanks for sparing time for the evaluation. No, it's not broken, it's just a prototype :)

@donat donat changed the title Integrate existing Kotlin support to Buildship and let internal people try it out Integrate existing Kotlin support to Buildship and let people try it out May 15, 2017
@donat
Copy link
Contributor Author

donat commented May 31, 2017

The Kotlin build script support is now functional (e.g. loads the correct classpath). It's time to give it another spin and see what's missing/not working.

@Golvanig
Copy link

Golvanig commented Jun 8, 2017

Hello,
Thanks for all this effort. If I can help by doing some tests...
We'll be happy (and interested to).

@donat
Copy link
Contributor Author

donat commented Jun 8, 2017

Hi @Golvanig, Thanks for the offer! The timing is rather good as a blocking issue in the Kotlin tooling was resolved recently.

If you want to try the Kotlin build script support, the steps above are still up-to-date.
Please note, that the language support we extend is provided by JetBrains and it is still in the pre-1.0 stage.

If you have any feedback or need some help with the setup, feel free to ping us here.

@donat donat modified the milestones: Buildship 2.2 - Kotlin support, Buildship 2.1 - Build scan support Jun 8, 2017
@Golvanig
Copy link

Golvanig commented Jun 9, 2017

Hello,

I just tried with a new clean neon.3 instance (J2EE package)
and installed the 2 plugins as described,
Imported my kotlin project (with build.gradle.kts)

OK: -- "kt" files are opened as usual
KO: -- kts can't be opened , and get an empty 'editing view' with no name
I got this issue:
"Problems occurred when invoking code from plug-in: "org.eclipse.e4.ui.workbench.swt". (detailed under)
The run with build.gradle.kts is though operational (I just have very very basic features in) through buildship or gradle command line.
Kr,


java.lang.AbstractMethodError: org.eclipse.buildship.kotlin.GradleKotlinScriptTemplateProvider.getTemplateClasspath(Ljava/util/Map;)Ljava/lang/Iterable;
at org.jetbrains.kotlin.core.model.ScriptTemplateProviderEPKt.makeScriptDefsFromEclipseTemplatesProviders(scriptTemplateProviderEP.kt:40)
...
Exception.txt

cf attachment

@Golvanig
Copy link

Golvanig commented Jun 9, 2017

And
the icon of the kts files are still displayed with the ? question mark.
I get this error message, I think related to:

An internal error occurred during: "Compute launch button tooltip".
org.eclipse.buildship.kotlin.GradleKotlinScriptTemplateProvider.getTemplateClasspath(Ljava/util/Map;)Ljava/lang/Iterable;

@donat
Copy link
Contributor Author

donat commented Jun 12, 2017

I think I found the problem. Buildship is using an experimental interface from Kotlin-Eclipse which hasn't been merged into the main branch. To make it work, you should install Kotlin-Eclipse from the following update site: https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_EclipsePlugin/1079489:id/

I'll adjust the link in my post above.

@Golvanig
Copy link

Golvanig commented Jun 27, 2017

Hello,
Thanks for the new update site.
I reloaded the new Kotlin_EclipsePlugin and I can now open the kts files.
But ...
I do not see any improvement in the syntax highlighting, the error markers, ...
for instance in
"import groovy.lang.GroovyObject"

  • import is bold
  • and "groovy" is red underlined with Unresolved reference

@calvertdw
Copy link

calvertdw commented Jul 23, 2017

I'm getting the same results on your branch as I am the latest release candidate.

image

Gradle 4.1-rc-1
Buildship 2.1.1
Kotlin-Eclipse 0.8.2

println gets linked but the editor doesn't seem to know about KotlinBuildScript.kt

Running Gradle tasks works fine!

@oehme oehme unassigned breskeby and oehme Aug 9, 2017
@donat donat modified the milestones: Buildship 2.2, Buildship 3.0 Oct 9, 2017
@calvertdw
Copy link

Is this project dead? Our users are flocking to IntelliJ. Should I wait on buildship to move all of our build scripts to Kotlin, or is this never gonna happen?

@oehme
Copy link
Contributor

oehme commented Dec 5, 2017

We're still alive, but there is not much that Buildship actually does - all the work happens in the Kotlin Eclipse plugin. @donat gave me a nice demo some time ago which worked properly, so I'm not sure if something got broken again or if there is some difference in your setup. @donat does it still work for you?

@donat
Copy link
Contributor Author

donat commented Dec 5, 2017

It's been a while since we worked on the Kotlin integration. The main functionality is there, but there were a couple of rough edges. We reported the problems to JetBrains, but so far they didn't prioritize them. Besides, the project is largely undocumented so It's really hard to contribute fixes.

In any case, we could publish the Kotlin integration as an optional, incubating feature. This way users could give us and JetBrains more feedback. @oehme WDYT?

@calvertdw
Copy link

Hey @donat! I'm back... XD. Would you mind publishing that incubating version? I'd like to play around with it and see where we're at. Dying to switch our Gradle scripts to Kotlin.

@donat
Copy link
Contributor Author

donat commented Mar 1, 2018

@calvertdw You can install a snapshot version from this update site (credentials: guest/guest). Frankly, there's a lot of room for improvement in Kotlin-Eclipse. The tooling loads things synchronously when the editor is opened. Also, you have to open and close the editor when you apply a plugin to see proper completion. Nonetheless, if you find another problem you can report it here or at the JetBrains issue tracker.

@calvertdw
Copy link

Thanks @donat! I'll try to get some issues submitted to them.

@GFriedrich
Copy link

Hi guys,
did you receive an update from Jetbrains in the meantime?
Because now all Kotlin Eclipse tickets vanished from their YouTrack instance.

I've also put this question into their discourse instance. Let's see what they will answer: https://discuss.kotlinlang.org/t/youtrack-kotlin-eclipse-project-gone/8161

If you've any information, it would be nice to know them.
Thanks in advance.

@donat
Copy link
Contributor Author

donat commented Jun 16, 2018

Not much has moved ever since. Last time I've checked the state of Kotlin-Eclipse it was still kind of unusable in production.

@donat donat removed this from the Buildship 3.0 milestone Jul 18, 2018
@fwgreen
Copy link

fwgreen commented Nov 28, 2018

It seems the Kotlin team is looking into this:
https://youtrack.jetbrains.com/issue/KE-273

@donat
Copy link
Contributor Author

donat commented Nov 30, 2018

@fwgreen Thanks for the update. I'm looking forward to have a stable Eclipse plugin for Kotlin.

@GFriedrich
Copy link

@fwgreen @donat I've opened this ticket a few month ago and I don't think that JetBrains is working on it (see stage "backlog"). I also don't expect that they start working on this soonish, as it's basically an unique selling point of IntelliJ IDEA to have proper Gradle Kotlin support only in this IDE. So if nobody from the "community" starts working on it, it may takes some time (or forever) until it's done.

@calvertdw
Copy link

@GFriedrich I understand why Jetbrains might not want to contribute this feature, but why not Gradle? Surely they want to decouple themselves from being an IntelliJ exclusive product. For instance, my team decided to use Gradle because it supports both IDEs.

@oehme
Copy link
Contributor

oehme commented Dec 4, 2018

but why not Gradle?

We're not in the business of building language support for IDEs ;) Plus, JetBrains is in a much better position to provide support for their own language. We hold the same position with Groovy btw.

For instance, my team decided to use Gradle because it supports both IDEs.

We do, to the extent that the IDEs allow us. We are in close contact with JetBrains and will make sure that the Kotlin scripting situation improves.

@scholzi100
Copy link

Are there any updates?

@donat
Copy link
Contributor Author

donat commented Oct 8, 2019

Not really. The existing Kotlin integration in Eclipse is simply too unstable to work with Gradle DSL. We'll coordinate with JetBrains how can we improve the situation. I'll close this issue for the time being and reopen when we have an update.

@chhex
Copy link

chhex commented Oct 31, 2019

I totally appreciate the great work the gradle also kotlin developers are doing. But the situation is quite frustrating for the normal users: One of the main motivations to develop gradle kotlin, was to have better IDE support for gradle. Current situation: Gradle Kotlin not usable with Eclipse, Gradle Groovy is the way better option.

@sdavids
Copy link

sdavids commented Dec 18, 2020

Any update? -- And why is this issue closed?

@oehme Your stance is understandable, but 3 years later IntelliJ is still the only IDE with proper support for Kotlin DSL.

So if Gradle Kotlin DSL is the future™️ ...

@pr11me
Copy link

pr11me commented Apr 18, 2024

And another 3hree years gone, maybe my grandchildren will enjoy gradle kotlin dsl in eclipse :P

@sdavids
Copy link

sdavids commented Apr 18, 2024

https://blog.gradle.org/kotlin-dsl-is-now-the-default-for-new-gradle-builds

April 13, 2023
Kotlin DSL is now the default choice for new Gradle builds

@donat
Copy link
Contributor Author

donat commented May 7, 2024

I understand your frustration, the situation with regards to Buildship's build script support is less than ideal. We have limited resources for supporting the Gradle ecosystem and providing a custom Kotlin language integration is very challenging.

At the same time, we do have something that you can check out. In Buildship 3.1.8, we added an incubating Kotlin DSL editor support. This was a result of a Google Summer of Code project completed in 2023. It is most probably not production-ready but has a potential to become one.

For more details, check the release announcement: https://discuss.gradle.org/t/buildship-3-1-8-is-now-available/47036. Also, any community help for improving the integration would be greatly appreciated.

@pr11me
Copy link

pr11me commented May 7, 2024

Rest assured that I do feel bad for complaining without offering solutions 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests