...
You should take advantage of Eclipse's incremental compiler and faster unit tests compared to gradle tasks, however, you still need gradle for the initial setup (./gradlew
or /.gradlew build
) that generates resources that are specified in the Eclipse projects dependencies, and to verify that you can build with javac. You can either use gradle from the command line or use Buildship.
Import the Eclipse Projects
You can either import the projects as Java projects and then run the gradle Gradle build manually (from a command line), or import them directly as gradle Gradle projects with Buildship (recommendedin which case you can run the Gradle tasks from within Eclipse). In either case, you might find it convenient to use Working Sets, which you can configure during the import or later.
To import as gradle projects:
Importing as Gradle Java projects
Eclipse has Gradle support via Eclipse Buildship. Use the latest Buildship version as the Gradle version used in OpenJFX updates from time to time. OpenJFX uses the Gradle wrapper.
The project structure for Gradle is such that the root directory contains the parent project with all other projects being its children. The Gradle Tasks view will allow you to execute the tasks that you would use Cygwin for otherwise.
NOTE: this process will override the projects' configuration and will cause them to not work anymore. However, since we are inside a git repository, we can revert the breaking changes and keep the Gradle settings. This will allow us to work with both Eclipse and Gradle.
- Install Buildship.
- Go to
File -> Import -> Gradle -> Existing Gradle ProjectProjects.
- Set the root directory to the base repository path.
- If your workspace setting is to use the wrapper by default, there is no need to override the settings. Otherwise specify
Gradle wrapper
.
The import process includes an initial gradle build, at the end of which you should see the root project (jfx
, or previously, rt
) with its subprojects under Gradle project structure
.
Finish and wait for the workspace to rebuild. This will result in many compilation errors.
Revert all .classpath and files (and clean and rebuild if it does not happen automatically - this will some take time). There should be no compilation errors.
What this process does is add the Gradle nature and build command to the .project files. This means that these files are now different than the ones in the repo. Additionally, the .settings folder for each project will contain a Buildship pref file. You will need to resolve the conflicts with the upstream repo.
Importing as only Java projects
To import as Java projects:
- Go to
File -> Import -> General -> Existing Projects into Workspace.
- Set the root directory to the base repository path.
- Check
Search for nested projects.
- Click
Finish
Configure Eclipse to use the latest JDK
...
Run Sample Code (NOTE: old)
Using Gradle
Eclipse has Gradle support via Eclipse Buildship. Use the latest Buildship version as the Gradle version used in OpenJFX updates from time to time. OpenJFX uses the Gradle wrapper.
The project structure for Gradle is such that the root directory contains the parent project with all other projects being its children. The Gradle Tasks view will allow you to execute the tasks that you would use Cygwin for otherwise.
NOTE: this process will override the projects' configuration and will cause them to not work anymore. However, since we are inside a mercurial repository, we can revert the breaking changes and keep the Gradle settings. This will allow us to work with both Eclipse and Gradle.
- Install Buildship.
- Go to
File -> Import -> Gradle -> Existing Gradle Projects.
- Set the root directory to the base repository path.
Finish and wait for the workspace to rebuild. This will result in many compilation errors.
Revert all .classpath and files (and clean and rebuild if it does not happen automatically - this will some take time). There should be no compilation errors.
What this process does is add the Gralde nature and build command to the .project files. This means that these files are now different than the ones in the repo. Additionally, the .settings folder for each project will contain a Buildship pref file. You will need to resolve the conflicts with the upstream repo.
Run Sample Code with Gradle Built Shared Libraries (Note: old)
...