-
Notifications
You must be signed in to change notification settings - Fork 76
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
Remove unused attributes in auto-generated feature.xml #770
Remove unused attributes in auto-generated feature.xml #770
Conversation
I did not remove the fragment attribute, as it causes warnings in feature.xml compiler. I will investigate where the compiler is processing that, and create a separate PR to take that out |
Investigating the test failures. |
@alshamams thanks for working on this. |
...clipse.pde.ui.tests/src/org/eclipse/pde/core/tests/internal/feature/FeatureDataTestCase.java
Outdated
Show resolved
Hide resolved
...clipse.pde.ui.tests/src/org/eclipse/pde/core/tests/internal/feature/FeatureDataTestCase.java
Outdated
Show resolved
Hide resolved
Thanks @alshamams, after a quick look this looks much better. 👍🏽 |
9eb4d51
to
7cd3d43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed this in detail and everthing that was removed is fine.
There was just a little bit more to remove.
In FeaturePlugin
the fFragment
field can be removed and instead isFragment()
returns if the PluginBase model is a fragment. The returned value is only considered to select the icon of an included Plugin in the Feature editor.
This also removes the fragment
attribute, which should not be read or written anymore.
The method FeatureExportOperation.setAdditionalAttributes()
can be removed because all overrides are now removed and the texts for all removed elements in the PluginDetailsSection in the Feature Edeitor can be removed too.
For all of that I have pushed another commit at the tip of your branch.
I also verified that with your change and all the unnecessary attributes are not written and displayed anymore. 👍🏽
Please address the only remaining comment and squash all your commits and mine into one commit with a reasonable overall message.
Then I think this should be ready for submission.
@laeubi can you tell if Tycho already handles features with all those features removed properly?
String id = attr.getValue(); | ||
int severity = CompilerFlags.getFlag(fProject, CompilerFlags.F_UNRESOLVED_PLUGINS); | ||
if (severity != CompilerFlags.IGNORE) { | ||
IPluginModelBase model = PluginRegistry.findModel(id); | ||
if (model == null || !model.isEnabled()) { | ||
VirtualMarker marker = report(NLS.bind(PDECoreMessages.Builders_Feature_reference, id), | ||
getLine(plugin, attr.getName()), severity, PDEMarkerFactory.CAT_OTHER); | ||
addMarkerAttribute(marker, PDEMarkerFactory.compilerKey, | ||
CompilerFlags.F_UNRESOLVED_PLUGINS); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of implementing a logic without isFragment
I think it is sufficient to remove that parameter from validatePluginExists
and remove the associated logic in that method and then just call:
String id = attr.getValue(); | |
int severity = CompilerFlags.getFlag(fProject, CompilerFlags.F_UNRESOLVED_PLUGINS); | |
if (severity != CompilerFlags.IGNORE) { | |
IPluginModelBase model = PluginRegistry.findModel(id); | |
if (model == null || !model.isEnabled()) { | |
VirtualMarker marker = report(NLS.bind(PDECoreMessages.Builders_Feature_reference, id), | |
getLine(plugin, attr.getName()), severity, PDEMarkerFactory.CAT_OTHER); | |
addMarkerAttribute(marker, PDEMarkerFactory.compilerKey, | |
CompilerFlags.F_UNRESOLVED_PLUGINS); | |
} | |
} | |
validatePluginExists(plugin, attr); |
@HannesWell Do I read this part as you intended?
Is this a breaking change? Would existing feature.xml files no longer be understood by the newest revision of the parser? Why I am asking this: |
It shouldn't be a breaking change. For existing
Yes a missing Lines 124 to 126 in 6b0f0ed
Some time later we can consider to remove even that so that a Illegal attribute will be issued for them if they are present. But what makes me wonder, why can't you just use the latest Eclipse release? |
I also checked Tycho. A feature.xml without |
ccac62d
to
a496ac2
Compare
Hi @HannesWell , |
@HannesWell have your concerns be adressed? |
Thanks for the update @alshamams! Your change looks good now. 👍🏽 But while checking the P2 code-base I found some references to the attributes about to be removed, i.e. the |
A quick update on this one. What's currently blocking the submission of this one is that |
This commit removes some of the unused attributes of plugin element, which are redundant and are never read from a feature.xml file: install-size, fragment, download size and unpack attributes.
a496ac2
to
67a7a83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an issue to follow the work of CoreUtility.guessUnpack()?
I just created eclipse-equinox/p2#368 to some related work on P2. But it looks like PDE-build again uses some parts of that again.
However the good news is that I confused CoreUtility.guessUnpack()
with another Utility class in P2 and it is in fact not used and this change is ready for submission now.
Thank you @alshamams for your work on this issue.
Thanks @HannesWell ! |
Thanks @alshamams and @HannesWell , always great if we get rid of outdated stuff. |
JDT moved in eclipse-jdt/eclipse.jdt.ui#810, JDT moved classes from o.e.jdt.ui to o.e.jdt.core.manipulation PDE removed unused attributes of feature.xml in eclipse-pde/eclipse.pde#770 Fixes eclipse-m2e#1591
JDT moved in eclipse-jdt/eclipse.jdt.ui#810, JDT moved classes from o.e.jdt.ui to o.e.jdt.core.manipulation PDE removed unused attributes of feature.xml in eclipse-pde/eclipse.pde#770 Fixes eclipse-m2e#1591
JDT moved in eclipse-jdt/eclipse.jdt.ui#810, JDT moved classes from o.e.jdt.ui to o.e.jdt.core.manipulation PDE removed unused attributes of feature.xml in eclipse-pde/eclipse.pde#770 Fixes #1591
For wrapped OSGi States obtained from pde.core/ui the Manifest 'Eclipse-BundleShape' entries, besides others, were not copied into the bundle's user-object Properties. This had the consequence that in ShapeAdvisor.getUnpackClause() the value of that entry never has been considered. The method only used to return the expected boolean value because of corresponding unpack-attributes in 'plugin' entries of feature.xml files. But since the removal of that otherwise unused attribute in [1] this makeshift was gone and ShapeAdvisor.getUnpackClause() always return false leading to all bundles in an exported product being in jar-shape, even if the 'Eclipse-BundleShape' entry in the MANIFEST.MF told something different. Fixes eclipse-pde#995 [1] - eclipse-pde#770
For wrapped OSGi States obtained from pde.core/ui the Manifest 'Eclipse-BundleShape' entries, besides others, were not copied into the bundle's user-object Properties. This had the consequence that in ShapeAdvisor.getUnpackClause() the value of that entry could never be considered. The method only used to return the expected boolean value because of corresponding unpack-attributes in 'plugin' entries of feature.xml files. But since the removal of that otherwise unused attribute in [1] this makeshift was gone and ShapeAdvisor.getUnpackClause() always return false leading to all bundles in an exported product being in jar-shape, even if the 'Eclipse-BundleShape' entry in the MANIFEST.MF told something different. Fixes eclipse-pde#995 [1] - eclipse-pde#770
For wrapped OSGi States obtained from pde.core/ui the Manifest 'Eclipse-BundleShape' entries, besides others, were not copied into the bundle's user-object Properties. This had the consequence that in ShapeAdvisor.getUnpackClause() the value of that entry could never be considered. The method only used to return the expected boolean value because of corresponding unpack-attributes in 'plugin' entries of feature.xml files. But since the removal of that otherwise unused attribute in [1] this makeshift was gone and ShapeAdvisor.getUnpackClause() always return false leading to all bundles in an exported product being in jar-shape, even if the 'Eclipse-BundleShape' entry in the MANIFEST.MF told something different. Fixes #995 [1] - #770
For wrapped OSGi States obtained from pde.core/ui the Manifest 'Eclipse-BundleShape' entries, besides others, were not copied into the bundle's user-object Properties. This had the consequence that in ShapeAdvisor.getUnpackClause() the value of that entry could never be considered. The method only used to return the expected boolean value because of corresponding unpack-attributes in 'plugin' entries of feature.xml files. But since the removal of that otherwise unused attribute in [1] this makeshift was gone and ShapeAdvisor.getUnpackClause() always return false leading to all bundles in an exported product being in jar-shape, even if the 'Eclipse-BundleShape' entry in the MANIFEST.MF told something different. Fixes eclipse-pde#995 [1] - eclipse-pde#770
This commit removes some of the unused attributes of plugin element, which are redundant and are never read from a feature.xml file: install-size, download size and unpack attributes.
Fixes: 730