-
Notifications
You must be signed in to change notification settings - Fork 16
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
Build Java Gradle Applications #519
Comments
Additional reference comment #459 (comment) |
Note that currently (pre-2.1.0) we do not have a way to configure a Gradle installation in Moonshine, and it is not installed with Moonshine SDK Installer. We'll at least need a settings page for this if we want to include this issue in 2.2.0. Gradle provides a wrapper that will automatically install the correct Gradle version for a project: https://docs.gradle.org/current/userguide/gradle_wrapper.html |
I added this to the 2.3.0 milestone. For this release, don't worry about a "Build & Run", just an action to run Gradle with a configured list of tasks. Note that the user can add support to run the application from Gradle with the "application" plugin - we could consider adding this to the default Java Gradle project. Note that we had some trouble with Gradle projects in #547. If we can't resolve this soon, we may push Java Gradle support to a later release. |
I found that we need to run a Gradle command to regenerate the classpath for the language server. I have a proposed solutions for this here: #547 (comment) |
@rat-moonshine started adding Gradle to Moonshine SDK Installer here: Moonshine-IDE/Moonshine-SDK-Installer#9 |
@rat-moonshine added a Gradle Build > Build Actions setting (#547 (comment)). However, I found that the setting was reset when I restarted Moonshine. Please change this to "Build Tasks" for to match the Gradle terminology. @rat-moonshine also added these Project menu actions:
I have some concerns about this implementation:
I would like to replace Build and Build & Run with an action called "Run Gradle Tasks". This will run the configured tasks from the settings. We can keep Clean for now, since this will always be available for a Gradle project. In order to have a "running" example for new Java Gradle projects, build.gradle should be configured with "run" as the default task, and have the application plugin and main class set by default. |
- Build & Run action removed against Gradle as Build Task should do requisite - Set 'clean run' as default build action to Gradle - Fix: Project name was not populating to .javaproj after settings save in Gradle project - Fix: classpaths tag not populating after settings save for java projects (reference #519)
Regarding A few bug I noticed during my tests, which have rectified now; They are as follows:
Suggested to test with updated project templates. |
I verified that the additional bugs you reported have been fixed. Project > Clean is now using "gradle clean". I am closing this issue. |
Sorry, I missed your earlier question. Unless we can find a reliable way to read the executable path, I think that we can hide Build & Run for Java Gradle projects.
For Project > Build, I think we should just run "$GRADLE_HOME/bin/gradle clean build" by default. You can see all of the other tasks that will be executed with this command:
A more advanced solution would be to let the user configure the tasks for Gradle, similar to the Build actions for Maven.
Is there some limitation I am forgetting that prevents us from running Gradle builds like this?
Originally posted by @JoelProminic in #459 (comment)
The text was updated successfully, but these errors were encountered: