GithubHelp home page GithubHelp logo

Gradle support about vscode-java HOT 37 CLOSED

redhat-developer avatar redhat-developer commented on June 16, 2024 49
Gradle support

from vscode-java.

Comments (37)

TheFanatr avatar TheFanatr commented on June 16, 2024 38

Any updates?

from vscode-java.

fbricon avatar fbricon commented on June 16, 2024 30

Basic Java Gradle seems to work now. However, we can't provide Android support for now, as BuildShip (that we depend on), doesn't support it.

Closing.

from vscode-java.

danielnmai avatar danielnmai commented on June 16, 2024 23

It's pretty annoying to jump back and forth between VS Code and Android Studio for a React Native app on Android. My tasks require writing a lot of native modules in Java, and with the lack of Android dev support, I'm not sure this extension is worth it for my use case.

from vscode-java.

safield avatar safield commented on June 16, 2024 22

Please add Android Gradle support! That is a significatn chunk of the Java code out there.

from vscode-java.

jacek99 avatar jacek99 commented on June 16, 2024 12

+1. Maven has been all but replaced by Gradle on any new projects that I know of. Without Gradle support, the plugin is not really usable :-/

from vscode-java.

ivanz avatar ivanz commented on June 16, 2024 9

In case it helps someone out there (note that I am new to Java) - I was able to workaround the lack of direct Gradle support by using the 'eclipse' gradle plugin to generate an Eclipse project:

  1. Add apply plugin: 'eclipse' to your gradle file
  2. Generate the classpath/project files on the console/terminal via gradlew eclipse

Intellisense works after that.

I've also tried to use the maven plugin, but the vscode-java plugin bombs out when loading the pom-default.xml (assuming it's even trying to load it)

from vscode-java.

scgm11 avatar scgm11 commented on June 16, 2024 9

+1 Gradle support

from vscode-java.

adelphes avatar adelphes commented on June 16, 2024 9

For those interested in Java support for Android, the latest version of the Android Extension now includes Java Intellisense based upon the Android SDK.
Java language support is not as fully featured as the vscode-java extension, but I'd be happy to add more features as developers require - or you can help out with the project by submitting issues, suggestions or PRs.

from vscode-java.

f2001642 avatar f2001642 commented on June 16, 2024 6

+1 for Gradle support

from vscode-java.

zhuarifp avatar zhuarifp commented on June 16, 2024 4

+1 i also need gradle support for learning libGDX in vscode. i love VSCode because lightweight but powerfull and crossplatform. the bad thing is it is still new.

from vscode-java.

 avatar commented on June 16, 2024 2

+1

from vscode-java.

fbricon avatar fbricon commented on June 16, 2024 1

@akhleung I'll submit an initial PR later today or tomorrow

from vscode-java.

gorkem avatar gorkem commented on June 16, 2024 1

PR is up at eclipse-jdtls/eclipse.jdt.ls#97

from vscode-java.

fbricon avatar fbricon commented on June 16, 2024 1

PR is not fully functional yet. Seems to work for simple examples, but I don't have reliable results yet on real world projects. Still looking into it.

from vscode-java.

gorkem avatar gorkem commented on June 16, 2024

Related to eclipse-jdtls/eclipse.jdt.ls#40

from vscode-java.

gorkem avatar gorkem commented on June 16, 2024

My guess is pom-default.xml fails because we look for pom.xml files only. @fbricon can you confirm?

from vscode-java.

fbricon avatar fbricon commented on June 16, 2024

yes, we only look at pom.xmls

from vscode-java.

tills13 avatar tills13 commented on June 16, 2024

This is a fairly important feature which is missing from this project - has any work been done twoards completing this?

from vscode-java.

jacek99 avatar jacek99 commented on June 16, 2024

Just a note: latest Gradle is focusing on Kotlin support, so it would be good if that was supported

https://blog.gradle.org/kotlin-scripting-update

from vscode-java.

gorkem avatar gorkem commented on June 16, 2024

@tills13 I believe @fbricon did have a look at using buildship last week.

from vscode-java.

fbricon avatar fbricon commented on June 16, 2024

@jacek99 we (as a 2 committers team) have no plans on providing a gradle editor for vscode, whether it's in groovy or kotlin. I believe this could be done in a 3rd party vscode plugin.

Our main objective is for gradle-based projects to be configured for java support. Basically, if you can import the gradle project in Eclipse (with Buildship), we should be able to do the same in VS Code. That said, I have no idea if kotlin is or will be supported in Buildship. If that was the case though, any changes to the build file (groovy or kotlin) should be able to trigger classpath updates (provided we add that feature).

from vscode-java.

akhleung avatar akhleung commented on June 16, 2024

Hello, I work for Sourcegraph, and we're interesting in using this Java language server to power our online code analysis and browsing tools. Just wondering if there's a concrete plan/timeline for adding Gradle (and Android) support, as well as making this the de-facto standard server for supporting all Java projects -- we'd definitely be willing to help contribute, if this turns out to be the right solution for our needs!

(referencing eclipse-jdtls/eclipse.jdt.ls#40, and cc-ing a couple other interested parties: @sqs @rothfels)

from vscode-java.

gorkem avatar gorkem commented on June 16, 2024

@akhleung It happens so that @fbricon is looking for volunteers to test his initial Gradle implementation. I think on a best case scenario we are looking at a Late November release. Perhaps, you can help with this work.

Can you elaborate what you mean by "the de-facto standard server for supporting all Java projects"

from vscode-java.

akhleung avatar akhleung commented on June 16, 2024

Great, we'd definitely be interested in helping to test Gradle support. @fbricon Is there some code we could look at, just to acquaint ourselves with the implementation (and maybe even contribute to)?

@gorkem Regarding my comment about "de facto standard", we'd ideally like a single high-quality LSP server that provides code analysis for all kinds of Java projects, whether they're using Maven, Gradle, etc. If this is on the roadmap for your project, then we'd be interested in contributing developer time to help make it happen.

from vscode-java.

gorkem avatar gorkem commented on June 16, 2024

@akhleung We do want the java language server to be the high-quality LSP server for Java. I think we are already moving on that direction. As you are aware, this project (vscode-java) only hosts the vscode extension that uses the server. Otherwise the server project is hosted on a different repo and is going to be moved to Eclipse as a subproject of Eclipse JDT. We are waiting for the paperwork to complete for all initial contributors to complete the move.

The server is not vscode specific. Eclipse Orion project is already using it for its Java support and we are working with Eclipse Che to replace theirs. IMHO if we have cases like yours which are slightly different from a code editor it will make the implementation better.

Java is a language with many excellent choices for tools. We prefer to use existing information maintained for existing tools such as build tools to resolve our projects. We have started with Maven, for no reason but when I was doing the initial PoC development @fbricon ,who is a committer for m2e, was available to jolt start my implementation.

from vscode-java.

akhleung avatar akhleung commented on June 16, 2024

This all sounds great! Regarding the code, I've been looking through your java language server repo, but so far I haven't been able to find anything related to Gradle support, hence my asking specifically about @fbricon's contributions.

from vscode-java.

fbricon avatar fbricon commented on June 16, 2024

As mentioned on eclipse-jdtls/eclipse.jdt.ls#40, looks like we won't be able to get android support any time soon.

If anyone can provide links to some real-world-not-android-gradle-based projects on github, I'm interested.

from vscode-java.

scgm11 avatar scgm11 commented on June 16, 2024

I have some build gradle for wars and jars if interested I can share them, let me know
Im using now eclipse gradle plugin to create the files and the java support works great, anyway not having to do that would be great

from vscode-java.

fbricon avatar fbricon commented on June 16, 2024

@scgm11 if they're available on github, let me know

from vscode-java.

scgm11 avatar scgm11 commented on June 16, 2024

is not an open soure project but I can provide the build.gradle if you want to check uses of gradle maybe as a gist??

from vscode-java.

fbricon avatar fbricon commented on June 16, 2024

you can just create a dummy project with that gradle file, throw in a couple of classes referencing some of the dependencies.
I tried your fork of https://github.com/scgm11/asterisk-java, and it seems to work so far.

from vscode-java.

scgm11 avatar scgm11 commented on June 16, 2024

ok, I'll do that in some minutes and let you know

from vscode-java.

scgm11 avatar scgm11 commented on June 16, 2024

OK ready they are in my profile GradleTest1 generate a jar GradleTest2 generate a war and depends on the output build of GradleTest1, let me know if is ok or not.

thanks!

from vscode-java.

scgm11 avatar scgm11 commented on June 16, 2024

was that useful??

from vscode-java.

JulioJu avatar JulioJu commented on June 16, 2024

It seems to have an official hack (not tested) http://www.vogella.com/tutorials/EclipseGradle/article.html#android-support , eclipse/buildship#779 (comment) .

from vscode-java.

MichelMelhem avatar MichelMelhem commented on June 16, 2024

up

from vscode-java.

caodingpeng avatar caodingpeng commented on June 16, 2024

you can follow this guide:
https://github.com/greensopinion/gradle-android-eclipse

from vscode-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.