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

Suggestion: generate -runbundles in archetype #54

Open
njbartlett opened this issue Jun 6, 2018 · 7 comments
Open

Suggestion: generate -runbundles in archetype #54

njbartlett opened this issue Jun 6, 2018 · 7 comments

Comments

@njbartlett
Copy link
Member

The bndrun files generated by the archetype have -runrequires populated but not -runbundles. This forces the user to do a resolve before the project can build cleanly.

Why not prepopulate -runbundles in the initial archetype output? We already know exactly what it will be at this stage. Then the user can immediately build and run.

@timothyjward
Copy link
Contributor

Why not prepopulate -runbundles in the initial archetype output?

What would we populate it with? In the majority of cases the bundle in -runrequires will have dependencies and we don't know what they are.

@njbartlett
Copy link
Member Author

The bundle will not have any dependencies immediately after generation from the archetype. Even if the user starts adding basic "hello world" code to the bundle, they will not need to worry about dependencies until later on.

The output of resolving immediately after generation of the project is:

-runbundles: \
        org.apache.felix.scr;version='[2.1.0,2.1.1)',\
        ${project.groupId}.${project.artifactId};version='[1.0.0,1.0.1)'

@timothyjward
Copy link
Contributor

The bundle will not have any dependencies immediately after generation from the archetype. Even if the user starts adding basic "hello world" code to the bundle, they will not need to worry about dependencies until later on.

I can see that this is reasonable for the project archetype, but the application archetype could be run very late in the process and pointed at an existing bundle with many dependencies. Isn't it better to say nothing and force a resolve rather than appear to have resolved but get errors when attempting to run?

@njbartlett
Copy link
Member Author

I can see that this is reasonable for the project archetype, but the application archetype could be run very late in the process and pointed at an existing bundle with many dependencies.

Then maybe we just do this for the project archetype. If the app archetype is used late in the process then the user will have learned about resolving at that point. But for the project archetype I think it's a win to remove steps in the way of "Hello world".

Isn't it better to say nothing and force a resolve rather than appear to have resolved but get errors when attempting to run?

I don't think there's a difference. The build will fail at the resolve stage, whether -runbundles is empty or non-empty-with-incorrect-content.

@timothyjward
Copy link
Contributor

I don't think there's a difference. The build will fail at the resolve stage, whether -runbundles is empty or non-empty-with-incorrect-content.

There is a difference if you're in Eclipse. An empty -runbundles prevents you from launching using the Run button, but a non-empty -runbundles will launch and fail to resolve. I'm not sure which I think is the more obvious to fix...

@njbartlett
Copy link
Member Author

Okay good point. Then I propose to leave -runbundles empty for the app archetype but populate it for the project template.

@timothyjward
Copy link
Contributor

Sounds good - will you make a PR?

njbartlett pushed a commit to njbartlett/osgi.enroute that referenced this issue Jun 6, 2018
njbartlett pushed a commit to njbartlett/osgi.enroute that referenced this issue Jun 6, 2018
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

No branches or pull requests

2 participants