RFR: 8221708 Update Eclipse project files

John Hendrikx jhendrikx at openjdk.org
Sun Nov 6 00:24:32 UTC 2022


On Fri, 28 Oct 2022 20:38:18 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> See https://bugs.openjdk.org/browse/JDK-8221708
>
> yes, something is wrong with test projects.
> Nir's screenshot shows a project-like Properties UI, mine shows a different UI:
> 
> <img width="651" alt="Screen Shot 2022-10-28 at 13 34 58" src="https://user-images.githubusercontent.com/107069028/198727492-2961ad7b-b0a0-4725-b952-afdd794bb6fb.png">
> 
> 
> (also, Nir, you have some .classpath modified in your screenshot)
> 
> Something gets messed up between gradle and eclipse project hierarchy.  What could it be?

@andy-goryachev-oracle I think your `systemTests` project is probably incorrect.  Under builders it should only have `Gradle Project Builder` and nothing else.  It looks like it may have the Java nature or a Java source folder configured somehow.  Can you give us the contents of it's `.project` file and the files in `.settings` ? It shouldn't have a `.classpath` file, but if it does, also that one.

> I've tried to follow what John proposed (with one exception - I did not clone the repo, used an existing repository).  Run a command line gradle build, imported all projects as existing projects (General -> Existing Projects...).
> 
> Got 3 errors and 30 warnings (first 3 entries are errors):
> 
> 
> Description	Resource	Type
> Missing Gradle project configuration file: .settings/org.eclipse.buildship.core.prefs	3DViewer	Gradle Project Configuration Marker
> Missing Gradle project configuration file: .settings/org.eclipse.buildship.core.prefs	Ensemble8	Gradle Project Configuration Marker
> Missing Gradle project configuration file: .settings/org.eclipse.buildship.core.prefs	Modena	Gradle Project Configuration Marker
> Project '3DLighting' has no explicit encoding set	3DLighting	No explicit project encoding
> Project 'DragDrop' has no explicit encoding set	DragDrop	No explicit project encoding
> Project 'FX8-3DFeatures' has no explicit encoding set	FX8-3DFeatures	No explicit project encoding
> Project 'Hello' has no explicit encoding set	Hello	No explicit project encoding
> Project 'LayoutDemo' has no explicit encoding set	LayoutDemo	No explicit project encoding
> Project 'MandelbrotSet' has no explicit encoding set	MandelbrotSet	No explicit project encoding
> Project 'manualTests-controls' has no explicit encoding set	manualTests-controls	No explicit project encoding
> Project 'manualTests-desktop' has no explicit encoding set	manualTests-desktop	No explicit project encoding
> Project 'manualTests-dnd' has no explicit encoding set	manualTests-dnd	No explicit project encoding
> Project 'manualTests-events' has no explicit encoding set	manualTests-events	No explicit project encoding
> Project 'manualTests-graphics' has no explicit encoding set	manualTests-graphics	No explicit project encoding
> Project 'manualTests-media' has no explicit encoding set	manualTests-media	No explicit project encoding
> Project 'manualTests-printing' has no explicit encoding set	manualTests-printing	No explicit project encoding
> Project 'manualTests-swing' has no explicit encoding set	manualTests-swing	No explicit project encoding
> Project 'manualTests-swt' has no explicit encoding set	manualTests-swt	No explicit project encoding
> Project 'manualTests-text' has no explicit encoding set	manualTests-text	No explicit project encoding
> Project 'manualTests-UI' has no explicit encoding set	manualTests-UI	No explicit project encoding
> Project 'manualTests-web' has no explicit encoding set	manualTests-web	No explicit project encoding
> Project 'PickTest3D' has no explicit encoding set	PickTest3D	No explicit project encoding
> Project 'Robot' has no explicit encoding set	Robot	No explicit project encoding
> Project 'systemTests-test' has no explicit encoding set	systemTests-test	No explicit project encoding
> Project 'systemTests-testapp1' has no explicit encoding set	systemTests-testapp1	No explicit project encoding
> Project 'systemTests-testapp2' has no explicit encoding set	systemTests-testapp2	No explicit project encoding
> Project 'systemTests-testapp3' has no explicit encoding set	systemTests-testapp3	No explicit project encoding
> Project 'systemTests-testapp4' has no explicit encoding set	systemTests-testapp4	No explicit project encoding
> Project 'systemTests-testapp5' has no explicit encoding set	systemTests-testapp5	No explicit project encoding
> Project 'systemTests-testapp6' has no explicit encoding set	systemTests-testapp6	No explicit project encoding
> Project 'systemTests-testapp7' has no explicit encoding set	systemTests-testapp7	No explicit project encoding
> Project 'systemTests-testscriptapp1' has no explicit encoding set	systemTests-testscriptapp1	No explicit project encoding
> Project 'systemTests-testscriptapp2' has no explicit encoding set	systemTests-testscriptapp2	No explicit project encoding

@andy-goryachev-oracle Thanks for trying this. The 3 errors you are seeing is because the build ship plugin has never generated its local preference file for those projects (I think this is because they're not actually correctly configured in Gradle).  All other projects will have this file generated locally for working Gradle projects.  I've copied these locally to make the error disappear.  I think the solution here is to add these files to the repository (and remove the `.gitignore` for it).  Then we also don't need to rely on the Buildship import to generate these the first time around (a completely clean check out shouldn't have them, and all projects would have this error AFAIK).

As for the warnings, those are from missing `org.eclipse.core.resources.prefs` files.  I suggest to add these to the repository as well (they are already there in many places, but not for the new projects I added, I didn't see the warning in between the 1000's of others).

So, if all agreed the next step would be:

1) Remove `org.eclipse.buildship.core.prefs` ignore from `.gitignore`
2) Add these prefs files in `.settings` folder for all locations that have the Gradle nature
3) Add the missing `org.eclipse.core.resources.prefs` for all new projects
4) Still figure out what's copying to `bin`.  I even see nested copies now after another build (`bin/bin`).
5) A few projects don't work correctly with Gradle (Ensemble8, 3DViewer and Modena), need to decide how to handle this, either: a) Fix their configuration in Gradle, or b) Remove the Gradle nature

About point 5, these projects can already be run directly from Eclipse.  To run `3DLighting`, just run the main class (`LightingsSample`) with a configuration that includes:

    -Djava.library.path="../../../modules/javafx.graphics/build/module-lib" 
    --add-modules=javafx.controls

I created launch files for these that could be committed so that Eclipse can run them without having to tweak their run configuration.

-------------

PR: https://git.openjdk.org/jfx/pull/930


More information about the openjfx-dev mailing list