-
Notifications
You must be signed in to change notification settings - Fork 54
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
infra: convert nested libs to wrapped OSGi bundles #406
infra: convert nested libs to wrapped OSGi bundles #406
Conversation
d1338da
to
84545bf
Compare
For reviewers: The interesting parts from the build are the lines around https://app.travis-ci.com/github/checkstyle/eclipse-cs/jobs/588568308#L346, where Tycho mentions how it wraps one of the libs from maven as Eclipse plugin. |
Please show that you did testing and Checkstyle still functions correctly.
This sounds great that the JARs are being removed. Why isn't this also possible with the Checkstyle JAR?
So this file is safe to modify? It says generated, so I was thinking some process need to run to create/update. |
EclipseCS uses several external libraries, which are copied manually into the libs folder. Since everything else comes from the Eclipse target platform, those 3 libraries are easier to maintain by fetching them directly from maven and letting Eclipse PDE automatically wrap them into OSGi bundles. With that change in place, updating the external libraries is as easy as changing the version number in the .target file. Also improve the documentation how to maintain the target platform, required plugins etc.
84545bf
to
99874c2
Compare
All the changes I commit have been tested locally by
That removal is probably also possible with the checkstyle jar. I did not yet do that, since I wanted to take a look at what else happens with that newly built checkstyle-all.jar and what #263 did instead. But it's on my todo list. :) I would also like to fix #385 first, since having the fat jar twice is really not nice, no matter whether it is created manually, taken from maven etc. However, #385 seems not trivial, since there are classpath issues when "just removing" one of them.
Good catch, that line was a copy/paste error. I've taken time to update the readme and to explain the complete process in more details. It may look confusing on first glance, but it leads to a very simple structure for editing and generating files. If you are curious, it looks like this now when opening the target file in a target editor: |
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 am approving, but @Calixte need to review this to be aware and may be new ideas come up how to simplify dependency on main library
</target> | ||
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> | ||
<locations> | ||
<location type="Target" uri="file:${project_loc:/net.sf.eclipsecs.core}/../net.sf.eclipsecs.target/net.sf.eclipsecs.partial.target"/> |
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.
You use a "partial" target file here just for code organization / clarity?
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.
Yes. The Maven part of the target must be edited manually, and the remaining Eclipse part can be generated. However, you cannot have the generation and the manual editing in one target file, therefore the generated part is included as "partial". If you think there is a better name for more clarity ("generated" instead?), I'll happily accept every suggestion.
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.
Nope, partial sounds good to me. I'm just trying to make sure I understand.
We could take this a step further and make another partial for the maven libs, and the main target file would just be an aggregate of partials.
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 would be fine with that, too. At work, I use exactly such a 3 target files setup. I wasn't sure if I confuse people even more if I go from 1 to 3 here. :)
Co-authored-by: Calixte <[email protected]>
EclipseCS uses several external libraries, which are copied manually into the libs folder. Since everything else comes from the Eclipse target platform, those 3 libraries are easier to maintain by fetching them directly from maven and letting Eclipse PDE automatically wrap them into OSGi bundles.
With that change in place, updating the external libraries is as easy as changing the version number in the .target file.
For end users, this change is in fact visible. Previously the nested libs were contained in the checkstyle jar, now they are visible as plugin in the IDE. This is how the newly wrapped javassist library looks like (that entry did not exist before):
The overall functionality and behavior are the same. Basically we just have another container around them to get them onto the classpath.