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

Extend demo bnd-workspace with subbundles #4661

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

Conversation

chrisrueger
Copy link

@chrisrueger chrisrueger commented Jan 30, 2025

see the bnd.bnd of the new tycho.demo.markdown bundle.
it uses the -sub: *.bnd instruction to create 2 jar files based on the other .bnd files (api.bnd and impl.bnd)

this build currently fails (which is intentional) and we want to use that to fix tycho to make it compile.
It seems that tycho currently does not recognize the 2 (sub) jars so it cannot find them as dependencies for the HelloWorldService

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-bnd-plugin:4.0.10:compile (compile) on project tycho.demo.impl: javac failed /bnd-workspace/tycho.demo.impl/src/main/java/org/eclipse/tycho/demo/impl/HelloWorldService.java:18: error: package tycho.demo.utils.markdown.api does not exist
[ERROR] import tycho.demo.utils.markdown.api.MarkdownRenderer;
[ERROR]                                     ^
[ERROR] /bnd-workspace/tycho.demo.impl/src/main/java/org/eclipse/tycho/demo/impl/HelloWorldService.java:24: error: cannot find symbol
[ERROR]     private MarkdownRenderer markdown;
[ERROR]             ^
[ERROR]   symbol:   class MarkdownRenderer
[ERROR]   location: class HelloWorldService
[ERROR] 2 errors

Expected result

The build should have produced two jars in tycho.demo.markdown

  • tycho.demo.markdown.api.jar
  • tycho.demo.markdown.impl.jar

And those should be recognized as dependency as required by the -buildpath of the tycho.demo.impl/bnd.bnd, so that tycho.demo.impl compiles successfully.

Copy link
Member

@laeubi laeubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for enhancing the example, we need some license headers on the java code and it would be good to squash all into one commit (it is the easier to later cherry pick/backport the test).

@chrisrueger chrisrueger force-pushed the extend-demo-bndworkspace-with-subbundles branch from de5eba7 to 9cb9035 Compare January 30, 2025 17:30
@chrisrueger chrisrueger force-pushed the extend-demo-bndworkspace-with-subbundles branch from 638c519 to 641e7d0 Compare January 31, 2025 09:04
bump tycho version to 4.0.10

gitignore MacOS .DS_Store files

add bundle using bnd's sub-bundles via -sub: *.bnd

see the bnd.bnd of the new tycho.demo.markdown bundle.
it uses the -sub: *.bnd instruction to create 2 jar files based on the other .bnd files (api.bnd and impl.bnd)

this build currently fails and we want to use that to fix tycho to make it pass.
It seems that tycho currently does not recognize the 2 (sub) jars so it cannot find them as dependencies for the HelloWorldService

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-bnd-plugin:4.0.10:compile (compile) on project tycho.demo.impl: javac failed /bnd-workspace/tycho.demo.impl/src/main/java/org/eclipse/tycho/demo/impl/HelloWorldService.java:18: error: package tycho.demo.utils.markdown.api does not exist
[ERROR] import tycho.demo.utils.markdown.api.MarkdownRenderer;
[ERROR]                                     ^
[ERROR] /bnd-workspace/tycho.demo.impl/src/main/java/org/eclipse/tycho/demo/impl/HelloWorldService.java:24: error: cannot find symbol
[ERROR]     private MarkdownRenderer markdown;
[ERROR]             ^
[ERROR]   symbol:   class MarkdownRenderer
[ERROR]   location: class HelloWorldService
[ERROR] 2 errors

add licence headers

Update demo/bnd-workspace/tycho.demo.markdown/src/main/java/tycho/demo/utils/markdown/impl/MarkdownRendererImpl.java

Update demo/bnd-workspace/tycho.demo.markdown/src/main/java/tycho/demo/utils/markdown/api/MarkdownRenderer.java

Update demo/bnd-workspace/tycho.demo.markdown/api.bnd

Co-Authored-By: Christoph Läubrich <[email protected]>
@chrisrueger chrisrueger force-pushed the extend-demo-bndworkspace-with-subbundles branch from 32d9b76 to 41ce326 Compare January 31, 2025 17:12
@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 Jan 31, 2025
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