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

Add support for exporting bndruns in bndworkspace projects #4676

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

laeubi
Copy link
Member

@laeubi laeubi commented Feb 2, 2025

This adds support for "building" bndrun files by exporting them into a runnable jar.

This successfully builds the extended demo project supplied here:

FYI @chrisrueger

@laeubi laeubi added the backport-to-tycho-4.0.x Can be added to a PR to trigger an automatic backport of the change label Feb 2, 2025
@chrisrueger
Copy link
Contributor

@laeubi since the export should export an "executable jar":

Could you change the extension to .jar instead of .zip? e.g. in the demo bnd-workspace: target/tycho.demo.app.jar instead of target/tycho.demo.app.zip

Then it would be in sync with current bnd export behavior (gradle, bnd cli and probably also bnd-maven-plugin).

Copy link

github-actions bot commented Feb 2, 2025

Test Results

  606 files  ±0    606 suites  ±0   4h 6m 50s ⏱️ + 11m 40s
  434 tests ±0    426 ✅  - 1   7 💤 ±0  1 ❌ +1 
1 302 runs  ±0  1 279 ✅  - 1  22 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit 708520b. ± Comparison against base commit 9330061.

@laeubi
Copy link
Member Author

laeubi commented Feb 2, 2025

Could you change the extension to .jar instead of .zip?

Done that and also slightly modified the path to be tycho.demo.impl/target/export/tycho.demo.app.jar so it does not collide with the main jar produced by the project

@chrisrueger
Copy link
Contributor

chrisrueger commented Feb 2, 2025

Hmm something is different. The content of the exported jar looks different than when I create it with Eclipse or bnd cli:
Tested in #4675

with tycho -Dbndrun.exports=tycho.demo.app

image
  • Inside there is a jar/bnd-workspace.jar
  • and when I run java -jar tycho.demo.app.jar nothing happens
  • also tycho.demo.app.jar is 1,8MB as compared to 2,8MB when I export from within Eclipse.

And here the executable jar exported with Eclipse (Export button in .bndrun editor)

image

@laeubi

The exported jar should be launchable with:

java -jar tycho.demo.impl/target/export/tycho.demo.app.jar

____________________________
Welcome to Apache Felix Gogo

g! Please type 'hello' into the console and press Enter, and magic will happen.

Then type 'hello'.

hello
Hello BND Workspace!
Render some markdown to HTML: <h2>H2 Headline</h2>

@laeubi
Copy link
Member Author

laeubi commented Feb 2, 2025

You now can specify

-Dbndrun.resolve=true

to perform a resolve operation, but currently it seems to do "nothing" (maybe because everything is already resolved).

@chrisrueger
Copy link
Contributor

You now can specify

-Dbndrun.resolve=true

to perform a resolve operation, but currently it seems to do "nothing" (maybe because everything is already resolved).

Cool. You could test it by removing one of the -runbundles in the demo

I will test it later today. On the road now

This adds support for "building" bndrun files by exporting them into a
runnable jar.
@laeubi
Copy link
Member Author

laeubi commented Feb 2, 2025

Hmm something is different. The content of the exported jar looks different than when I create it with Eclipse or bnd cli

This is fixed now I accidentally passed the wrong file to the bndrun exporter and therefore it was empty :-\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-tycho-4.0.x Can be added to a PR to trigger an automatic backport of the change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants