-
-
Notifications
You must be signed in to change notification settings - Fork 303
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
Enhance wizard-based creation of OSGi services #5632
Comments
Please see draft pull request #5633 |
Please see new pull request #5643 for simplification of new service wizard support |
@kriegfrj I would appreciate your merging of the pr in bndtools.workspace repo here All it does is add the bundle annotation bundle to the workspace template...so that the java wizard contribution (associated with this issue) will work as expected by users when using the bndtools.workspace workspace template. |
I've completed the technical work to close this issue except for two things:
BTW: I have another Eclipse plugin that adds 5 additional Remote Service wizards to create gRPC, sync, asyn, jaxrs distribution-based remote services. These are based upon the classes added to bndtools (no new java code, just plugin.xml). Currently this Eclipse plugin is in https://github.com/ECF/grpc-RemoteServicesProvider repo (p2 repo in build sub-directory). I may move it elsewhere but obviously it has to wait on bndtools 7 next release. When is that next bndtools 7 release expected? Thanks. |
@scottslewis the bndtools/workspace#18 PR fails, can you fix? About 2, I agree, please also add it to minimum About 3, do you take action here? not sure I get it? Next, release, I am going to work on it soon. July is likely |
On Fri, May 26, 2023, 8:24 AM Peter Kriens ***@***.***> wrote:
@scottslewis <https://github.com/scottslewis> the bndtools/workspace#18
<bndtools/workspace#18> PR fails, can you fix?
Hi Peter. I have no idea why they are failing. It appears random to me
and unrelated to content of change...so don't have first idea of how to fix
other than to try again. Will do that over weekend.
About 2, I agree, please also add it to minimum
Ok will produce issue +pr this coming weekend.
About 3, do you take action here? not sure I get it?
…
Next, release, I am going to work on it soon. July is likely
—
Reply to this email directly, view it on GitHub
<#5632 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABHB5FXKSNGZQZLSWYOYP3XIDDMXANCNFSM6AAAAAAWZPLK74>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
We're discussing release process. Do we want that in here? |
Yes. |
One comment: To have the java service tutorial work 'out of the box' in bndtools 7.x, it requires updates to the two default workspace templates (i.e. bndtools.workspace and bndtools.workspace.minimal). That's why I opened the issues on those workspace template repos. I stated on one of them (can't remember which one now) what the needs/requirements are for the workspace templates (i.e. so that they include the annotations currently used in the tutorial [compile] as well as the runtime-required bundles...e.g. scr, framework, console, etc). Depending on what happens wrt those two templates (e.g. versions) I may need to make some small modifications to the tutorial...which includes generated bndrun files. I will be responsive on doing that work (and contributing to the workspace template changes if needed) to make the necessary and timely adjustments to the java service wizard. |
I feel a bit daft but I cannot really figure out what I need to do to progress this. Can you give me an instruction list for an IQ 85? :-) I am publishing RC1 end of the week and I'd like to get this in. |
What remains to be done to have this work properly is to enhance the bndtools and bndtools.minimal workspace template projects so that they both
Here are is the OSGi R8 issue for bndtools.workspace and bndtools.workspace.min bndtools/bndtools.workspace.min#7 In the workspace.min issue is the dependencies that the wizard-generated require: he requirements of the generated projects are currently: Use of R8 org.osgi.annotation.bundle.Export and org.osgi.annotation.versioning.Version("1.0.0") annotations. Use of org.osgi.service.component.annotations.Component, org.osgi.service.component.annotations.Reference, org.osgi.service.component.annotations.Activate scr annotations. Use of R8 framework impl. Use of R8 SCR impl, Use of gogo (shell, command, runtime bundles). I would request that the wizard's R8 dependencies as above be present for both min and the bndtools.workspace templates (annotations, scr, framework, gogo console). That way the new Java wizard (this issue) output will compile and run for either of the bndtools.workspace and bndtools.workspace.min templates. |
I would interpret that https://github.com/bndtools/workspace/blob/master/cnf/build.bnd currenty points OSGi R7 (7.0.0) (org.osgi.enroute:osgi-api:7.0.0) What I think @scottslewis is asking, is to increase that to R8? Maybe https://mvnrepository.com/artifact/org.osgi/osgi.core/8.0.0 ? Maybe @scottslewis could clarify more. |
>
> What I think @scottslewis is asking, is to increase that to R8?
Yes, that's correct. I've got open issues for both the minimal workspace template repo and the regular workspace template repo to use R8...and to include in both workspace templates the org.osgi.* dependencies required for the Java service wizard-created projects to resolve (e.g. scr impl, as well as some OSGi annotations. See https://github.com/bndtools/bndtools.workspace.min/issues and https://github.com/bndtools/workspace/issues I think a complicating factor here is may be that the location and organization of bundles (enroute?) changed from R7 to R8...and so it isn't a tiny change of the version number in the pom that's necessary. I could be wrong about that, but don't know enough about the shape of things in R7 vs. R8. |
I think @pkriens started something here: Is this related? Sorry for asking, but I get lost a bit with all the links to Issues and PRs :) I can help testing, but I try to find out "what". |
@scottslewis I talked to @pkriens today and I started this PR. I would need your help to verify if this solves what you are asking for. The PR contains steps to test this. Let me know in the PR if you want changes. |
@chrisrueger I will give it a try now |
I just merged the bndtools.workspace.min ... Can we work from this because I understand that @chrisrueger has more confidence in this one than the workspace one. I am also inclined to have only one from now on. @scottslewis can you look and give back a list of things to do? |
Yes. Today, I've tested using the Java OSGi service wizard using the min repo contents from main with bndtools snapshot (12/8). Short story: The Java OSGi Service wizard now (R8 min workspace template) works as desired. Thanks @chrisrueger and @pkriens! There is one small nit fixed by pr #5932. Without this fix, the after the 3 projects are created by the wizard the workspace is not refreshed and has errors because of dependencies between projects. With pr #5932 the workspace is refreshed and so everything is green once the wizard is finished.
It's your call, but haven't there been two around for a while? Won't this be a bit of a surprise for bndtools users that have been using two for a while? So if pr #5932 can be merged then I will close this issue. When is the next expected release of bndtools? I would suggest some promotion of the existence of the Java OSGi Service Wizard in the next release...I'm not sure how/who does that, but if a couple of screenshots are desired I can easily create them now. One other thing to make public: It's possible with the current code to create custom service wizards just by using the eclipse wizard extension point and providing a bndtools service template. For example, this markup creates a new Grpc Remote Service Wizard
I intend to use this so that I (or anyone) can introduce new OSGi service wizards for (e.g.) the wizard-based creation of Remote Services (like with the ECF grpc provider-based wizard as above). I can/will produce more documentation for this, but can't right at the moment. But it is something that's already in the existing service wizard code. |
Oh yes please. Maybe just paste them here with a few bullet points of notes. |
Once this pr is merged: #5932 Then with bndtools snapshot or newer here are screenshots of the projects creation of the Java OSGi Service Wizard Requirements: It's assumed that bndtools snapshot or better has been installed, and a new workspace has been created with the new bndtools.workspace.min (R8) template. To open wizard, select File->New->Other... Then select OSGi Services -> Java OSGi Service (api, impl, consumer) and Next> Fill in desired values for the Project Name and the Service Name fields, and make any other desired changes to the execution environment or project set usage on the wizard page Click Finish There are three projects created org.myorg.test.hello (api), org.myorg.test.hello.impl, and org.myorg.test.hello.consumer. The three Java classes created (in each of the projects) are shown in the edit window (HelloService, HelloServiceImpl, HelloServiceConsumer). If desired, the user can use Eclipse refactoring to rename the default service method (named methodName) to (e.g.) hello, resulting in: Included in the generated org.myorg.test.hello project is a Hello.bndrun file that can be used to launch a framework. register the HelloServiceImpl, inject (via SCR) into the HelloServiceConsumer and have the HelloServiceConsumer call the service. To Run/Debug Opening the bndrun file results in: Then clicking Resolve and Update Then clicking on Run OSGi (or Debug OSGi). Results in the service method being called and the console output |
Thanks a lot @scottslewis for the screnshots and notes. Question: Thoughts? Or you know a better place? @pkriens |
@scottslewis @pkriens I have created bndtools/bndtools.github.io#146 for my website / documentation relevant additions for the next release. Feel free to provide feedback, additions and corrections there. |
I have added a section "Creating custom OSGi service wizards" to the Developer Guide here |
I've just tested the Java OSGi Service wizard in bndtools snapshot: 7.1.0.DEV-202312261441-gd759351. It's working as designed/expected, so I'm closing this issue. Please reopen if issues remain open until actually released. |
@chrisrueger I see that you are the author of the recently released 7.1 changes...i.e. https://github.com/bndtools/bnd/wiki/Changes-in-7.1.0 A couple of small nits about the OSGi Services Wizard finally released in 7.1.0: First, there is this in the text about the OSGi Services Wizard currently: new Wizard for creating a Java OSGi Service (api, impl, consumer) on the new Project Templates section on the bndtools website. I should point out that technically this isn't just another project template, but rather a whole new type of template...i.e. an OSGi service template. Also included is both the infrastructure classes for this new type of template and the wizard/UI classes for using this new type of template to create api, impl, consumer bundles from 3 project templates. So yes, there is just a single Java OSGi Service template right now, but my intention is to introduce a number of OSGi Remote Service templates after refactoring ECF workspace template. Also, I think the screenshots that you/ @chrisrueger have already put together should have a higher profile on the top-level page....just because it is a big (new) user-visible change for encouraging/enabling the creation of OSGi services. As far as I've seen, it's the first UI-visible tooling support for OSGi services specifically in the Eclipse ecosystem. My $0.03. |
Thanks for the remarks @scottslewis . I am totally fine to weave this in, whatever you think is best. I mean you could write it yourself if you want and I put it there exactly as you write it (in case you don't see the Edit button on the wiki page.
Do you mean the homepage (bndtools.org) like the other existing sections? |
@scottslewis I added a separate section: https://github.com/bndtools/bnd/wiki/Changes-in-7.1.0#osgi-service-template If you like to have wording changes, please post the exact sentences and I'll add / copy paste them :) |
Hi @chrisrueger. This looks fine to me. Thanks. I don't need/want to write doc sat the moment as I'm taking some time off...so your willingness to do this is most appreciated. I trust your judgment/decisions about best places to make visible. For everyone's info: It's my intention/desire to contribute additional service creation wizards for ECF remote services...e.g. async remote services using various distribution providers (e.g. grpc). I may try to contribute also a tutorial and/or docs on introducing one's own OSGi service template using the new classes introduced in 7.1 so that others can contribute OSGi service creation wizards also. BTW, congrats on the 7.1 release. |
@scottslewis ok thanks for the feedback.
Thanks, but kudos goes to @pkriens and @peterkir for tweaking and doing the release process. |
As per discussion here
https://bnd.discourse.group/t/osgi-services-creation-wizards/218/12
It would be useful to for bndtools to support wizard-based creation of OSGi services.
As an initial contribution, I've created a new package/API: org.bndtools.core.ui.wizards.service for building wizards for creating OSGi services with (by default) three projects: a service-api project, a service-impl project, and service-consumer project. These wizard classes allow the use of named bndtools templates for creating the service-api, service-impl, and service-consumer projects via a single wizard.
Further, I've created a Java OSGi Service wizard in new package: org.bndtools.core.ui.wizards.service.java and referenced in _plugin.xml. This uses the new package/API above and 3 built-in templates (in new bundtools.core/resources/unprocessed/serviceTemplates) in bndtools.core.
The text was updated successfully, but these errors were encountered: