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

Add Kotlin container to Eclipse classpath containers #32

Open
nniesen opened this issue Oct 10, 2022 · 1 comment
Open

Add Kotlin container to Eclipse classpath containers #32

nniesen opened this issue Oct 10, 2022 · 1 comment

Comments

@nniesen
Copy link

nniesen commented Oct 10, 2022

The org.jetbrains.kotlin.core.KOTLIN_CONTAINER is not be added to the Eclipse project .classpath files.

We have multi-module Gradle projects with mixed languages. The Java and Groovy source sets cannot "find" the Kotlin classes without adding the KOTLIN_CONTAINER to the .classpath files.

Eclipse 2022_09 (v4.25)
Plugin from https://s3.eu-central-1.amazonaws.com/github.bvfalcon/kotlin-eclipse/eclipse-releases/2022-09/

I'm currently using this workaround in my ~\.gradle\init.gradle file to fixup the .classpath files:

allprojects {
    if (project.plugins.hasPlugin(EclipsePlugin)) {
        eclipse.synchronizationTasks {
            def fixKotlinContainer = (project.tasks.find({ it.name.matches("^compile.*Kotlin\$")}) != null) // find first kotlin compile task; null if none.
            if (fixKotlinContainer) {
                println "Adding KOTLIN_CONTAINER for ${eclipse.project.name}"
                eclipse.classpath.containers 'org.jetbrains.kotlin.core.KOTLIN_CONTAINER'
            }
        }
    }
}

which gets me the KOTLIN_CONTAINER in my classpath files:

...
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"/>
	<classpathentry kind="con" path="org.jetbrains.kotlin.core.KOTLIN_CONTAINER"/>
	<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
...
@gayanper
Copy link
Collaborator

Yes this is because the upstream has removed gradle support if I remember correctly. But if we can fix the issues by enabling the gradle support it should work. Could you look into and provide a PR ? The required code should be inside the gradle sub module

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

No branches or pull requests

2 participants