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

Java Frontend Application wizard for Gradle #1154

Merged
merged 8 commits into from
Apr 20, 2019

Conversation

dukescript
Copy link
Contributor

Introducing new module that provides a Java Frontend Application wizard for Gradle project. The goal is to get the support for Apache HTML/Java API and the rest of the DukeScript technologies into the hands of our Gradle users. They should be able to choose the project type and get a project with a sample application that can be executed, debugged and tested out of the box.

@lkishalmi, what is the right way to populate a project with predefined structure? There is nothing like Maven archetypes in the Gradle world, right? As such the IDE has to configure the project skeleton by own means. The first attempt extracts the sample from a ZIP file. That is probably not ideal. Are there some better ideas?

Thanks for the review. We'd like to take some time and polish this PR and integrate for NetBeans 12.

Copy link
Contributor

@lkishalmi lkishalmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well,
Probably create a zip file as template could be fine, though, the zip shall be created at build time from files in this project.
Do not add wrapper related files to the zip as those can be created by Gradle as a last step of installation.
As of actions, the reload rules can be just DEFAULT (removed from the properties) NEVER was intended for quick actions like debug.fix or compile.single
The Gradle files are need some love as well. It would be better to review them as source.

@dukescript
Copy link
Contributor Author

Thanks @lkishalmi for the review. Rather than copying the files from a ZIP file, let's copy them from the layer.xml! The 03c5e39 commit contains an example how that could be done (iOS files are still in the ZIP as there is too many of them). More work will be needed on processing the template files and placing them in the right packages...

@junichi11
Copy link
Member

@dukescript Missing license headers:

https://github.com/apache/incubator-netbeans/tree/master/groovy/gradle.htmlui/build.xml
https://github.com/apache/incubator-netbeans/tree/master/groovy/gradle.htmlui/nbproject/project.properties
https://github.com/apache/incubator-netbeans/tree/master/groovy/gradle.htmlui/nbproject/project.xml
https://github.com/apache/incubator-netbeans/tree/master/groovy/gradle.htmlui/src/org/netbeans/modules/gradle/htmlui/Bundle.properties

@dukescript
Copy link
Contributor Author

dukescript commented Apr 8, 2019

Re. Review by @lkishalmi:

The Gradle files are need some love as well. It would be better to review them as source.

Done. Most of the files is available as freemarker template.

As of actions, the reload rules can be just DEFAULT (removed from the properties)

Handled in 657726b

Do not add wrapper related files to the zip as those can be created by
Gradle as a last step of installation.

There are no gradlew files, as far as I can tell, but please take another look now.

In addition to that your advice may be needed: how to make sure the project is loaded (or at least reloaded) only when all the files are created? Right now I need to modify a build script file to make sure the IDE sees correct classpath...

Copy link
Contributor

@lkishalmi lkishalmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good direction, keep it up!

import org.openide.util.NbBundle.Messages;

@TemplateRegistration(folder="Project/Gradle", position=999, displayName="#template.htmlUIProject", iconBase="org/netbeans/modules/gradle/htmlui/DukeHTML.png", description="description.html")
@Messages("template.htmlUIProject=Java Frontend Application")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be quite confusing especially when this is in the main Gradle Project Wizard folder. At least if I'd like to do a Java Frontend Application, I would not think on bck2brwsr app on the first place (I'm sorry for that).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This template is not about bck2brwsr. The main focus is DukeScript - e.g. combination of the best Java VM and portable frontend rendering. What exactly is the problem? The "Run" action? If so, it can be changed to do the same thing as "Debug".

The naming is consistent with the Maven category. There is a Java Frontend Application archetype in the Maven category which leads to the same/similar application, using the same libraries. Our intention is to deliver the same Java Frontend Application experience to Gradle users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw. there is also a way to run the application as Android application and as iOS application. They aren't advertised in the UI yet as it requires additional configuration of SDK, simulator, etc. We'd welcome coordinated support in this direction of generic Java Frontend Applications, but we think it is out of the scope of this PR.

super(Bundle.LBL_FrontendApplicationProject(), initParams());
}

private static Map<String, Object> initParams() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this method is a copy paste and does not really needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method is used on line 47, but the properties are likely useless: ee258eb

@dukescript
Copy link
Contributor Author

Are there any outstanding issues or can we move on and proceed with integration, please? @lkishalmi, @geertjanw - this PR is open to maintainers - feel free to do any renames that you wish. There is no need to block integration just because of the naming.

@dukescript
Copy link
Contributor Author

The checks fails when running org.netbeans.modules.java.completion.JavaCompletionTask110FeaturesTest. That is unlikely related to the gradle wizard changes, as groovy cluster isn't even present in such mode. Do you, @jlahoda, know something about that test? Can you address the failure and merge this PR when appropriate?

@asfgit asfgit merged commit e03eba2 into apache:master Apr 20, 2019
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

Successfully merging this pull request may close these issues.

4 participants