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

commented Mar 5, 2019

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.

@lkishalmi
Copy link
Contributor

left a comment

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

This comment has been minimized.

Copy link
Contributor Author

commented Mar 15, 2019

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...

@dukescript dukescript force-pushed the dukescript:GradleFrontendProject branch from 03c5e39 to 32b8ab1 Apr 7, 2019

@junichi11

This comment has been minimized.

Copy link
Member

commented Apr 7, 2019

@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 added some commits Apr 7, 2019

@dukescript

This comment has been minimized.

Copy link
Contributor Author

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...

@lkishalmi
Copy link
Contributor

left a comment

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")

This comment has been minimized.

Copy link
@lkishalmi

lkishalmi Apr 9, 2019

Contributor

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).

This comment has been minimized.

Copy link
@dukescript

dukescript Apr 10, 2019

Author Contributor

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.

This comment has been minimized.

Copy link
@dukescript

dukescript Apr 10, 2019

Author Contributor

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() {

This comment has been minimized.

Copy link
@lkishalmi

lkishalmi Apr 9, 2019

Contributor

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

This comment has been minimized.

Copy link
@dukescript

dukescript Apr 10, 2019

Author Contributor

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

@dukescript dukescript force-pushed the dukescript:GradleFrontendProject branch from ee1a3c3 to 28f106d Apr 14, 2019

@dukescript

This comment has been minimized.

Copy link
Contributor Author

commented Apr 14, 2019

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

This comment has been minimized.

Copy link
Contributor Author

commented Apr 15, 2019

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?

@dukescript dukescript force-pushed the dukescript:GradleFrontendProject branch from f0bb331 to e03eba2 Apr 20, 2019

@asfgit asfgit merged commit e03eba2 into apache:master Apr 20, 2019

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.