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

Unify nature checks and reuse existing constants from core.natures.PDE #941

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HannesWell
Copy link
Member

No description provided.

Copy link

github-actions bot commented Nov 27, 2023

Test Results

  194 files   -    97    194 suites   - 97   21m 28s ⏱️ - 34m 23s
  900 tests  - 2 626    862 ✅  - 2 606  34 💤  -  24  4 ❌ +4 
1 892 runs   - 8 983  1 814 ✅  - 8 884  70 💤  - 107  8 ❌ +8 

For more details on these failures, see this check.

Results for commit 5be7b7d. ± Comparison against base commit a42910f.

This pull request removes 2626 tests.
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test1
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test2
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test3
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test4
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test5
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test6
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test7
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingApiFreezeAntTaskTests ‑ test1
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingApiFreezeAntTaskTests ‑ test2
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingApiFreezeAntTaskTests ‑ test3
…

♻️ This comment has been updated with latest results.

@HannesWell HannesWell force-pushed the reuse_existing_manifest-builder_constant branch 2 times, most recently from 2a5a5f3 to 940a8a9 Compare November 28, 2023 00:09
@HannesWell HannesWell changed the title Reuse existing PDE.MANIFEST_BUILDER_ID constant in MinimalState Unify nature checks and reuse existing constants from core.natures.PDE Nov 28, 2023
@HannesWell HannesWell marked this pull request as draft November 28, 2023 00:18
@HannesWell
Copy link
Member Author

I have now taken this as an opportunity to replace all occurrences of PDE nature and builder literals by the corresponding constants in the PDE class and to leveraging the different PDE.hasXNature methods.

Additionally I moved the isBndProject(IProject) method from BndProject to the PDE class to align it with the other methods.

I also contemplate to rename the hasXNature() method to isXProject(), which I would consider a more speaking name.
But if these names are changed, we could alternativly consider to do the opposite and move the hasXNature respectivly isXProject methods as well as the constants to the corresponding XProject classes in the same package, just like it used to be for the BndProject class.

What's the opinion of the others? Keep one central class for all nature and builder ids and hasNature() or isProject() methods? Or should those constants and methods be added to the corresponding project class?
At the moment we have a split between BNDProject and Plugin/Feature/SiteProject and I would like to unify this.

@laeubi
Copy link
Contributor

laeubi commented Nov 28, 2023

I would appreciate if we could delay such cleanups/unification until the pending PRs are merged so they don't get delayed/distorted by rebase conflicts, for me central classes tend to be convoluted by more and more unrelated stuff over time so I think keeping it on the project classes seems good.

private boolean acceptProject(IProject project) throws CoreException {
if (project == null) {
return false;
}
return (project.hasNature(JavaCore.NATURE_ID) && project.hasNature("org.eclipse.pde.PluginNature")) //$NON-NLS-1$
return project.hasNature(JavaCore.NATURE_ID) && PDE.hasPluginNature(project)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should have also a isJavaPluginNature(...) that checks for java+plugin nature).

Copy link
Contributor

Choose a reason for hiding this comment

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

I assume you mean hasJavaPluginNature...

@laeubi
Copy link
Contributor

laeubi commented Feb 11, 2024

@HannesWell still relevant?

@HannesWell HannesWell force-pushed the reuse_existing_manifest-builder_constant branch from 940a8a9 to 534e1d5 Compare February 18, 2024 17:25
@HannesWell HannesWell force-pushed the reuse_existing_manifest-builder_constant branch 3 times, most recently from e8ea3a7 to 92378a0 Compare April 26, 2024 21:54
@HannesWell
Copy link
Member Author

HannesWell commented Apr 26, 2024

I also contemplate to rename the hasXNature() method to isXProject(), which I would consider a more speaking name.
But if these names are changed, we could alternativly consider to do the opposite and move the hasXNature respectivly isXProject methods as well as the constants to the corresponding XProject classes in the same package, just like it used to be for the BndProject class.

Implemented that now which makes the PDE class obsolete since all methods and constants have been moved to the corresponding <Type>Project classes. Furthermore I renamed BaseProject to PDEProject since fundamental constants and methods reside there now and I think the latter name more expressive.

Now I just have to find out, why the tests are failing...

@HannesWell HannesWell force-pushed the reuse_existing_manifest-builder_constant branch from 92378a0 to eed8a92 Compare May 15, 2024 22:29
@HannesWell HannesWell force-pushed the reuse_existing_manifest-builder_constant branch from eed8a92 to 5be7b7d Compare May 18, 2024 17:46
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.

None yet

3 participants