-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add bundle using bnd's sub-bundles via -sub: *.bnd
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 Co-Authored-By: Christoph Läubrich <[email protected]>
- Loading branch information
1 parent
2415023
commit 641e7d0
Showing
10 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ pom-model-classic.xml | |
project-dependencies.xml | ||
project-units.xml | ||
requirements.txt | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
-Dtycho-version=4.0.0-SNAPSHOT | ||
-Dtycho-version=4.0.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
# Contains all bundles to consume from maven central | ||
|
||
org.osgi:osgi.core:8.0.0 | ||
org.osgi:osgi.annotation:8.1.0 | ||
org.osgi:org.osgi.service.component.annotations:1.5.1 | ||
org.osgi:org.osgi.service.component.annotations:1.5.1 | ||
org.osgi:org.osgi.service.component:1.5.1 | ||
org.commonmark:commonmark:0.22.0 | ||
org.commonmark:commonmark-ext-gfm-tables:0.22.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
-buildpath: osgi.annotation, \ | ||
tycho.demo.api, \ | ||
tycho.demo.markdown.api,\ | ||
org.osgi.service.component.annotations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Export-Package: com.synesty.utils.markdown.api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-sub: *.bnd | ||
|
||
-buildpath: \ | ||
osgi.core;version=latest,\ | ||
osgi.annotation;version=latest,\ | ||
org.osgi.service.component.annotations;version=latest,\ | ||
org.commonmark:commonmark;version=latest,\ | ||
org.commonmark:commonmark-ext-gfm-tables;version=latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-privatepackage: tycho.demo.utils.markdown.impl | ||
|
||
|
||
|
||
-includeresource: \ | ||
${repo;org.commonmark:commonmark;latest}; lib:=true,\ | ||
${repo;org.commonmark:commonmark-ext-gfm-tables;latest}; lib:=true,\ | ||
|
25 changes: 25 additions & 0 deletions
25
...ace/tycho.demo.markdown/src/main/java/tycho/demo/utils/markdown/api/MarkdownRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 Christoph Rüger and others. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Christoph Rüger - extend example to use bnd -sub instruction | ||
*******************************************************************************/ | ||
package tycho.demo.utils.markdown.api; | ||
|
||
public interface MarkdownRenderer { | ||
|
||
/** | ||
* Renders markdown string to html. | ||
* | ||
* @param markdown | ||
* @return | ||
*/ | ||
String render(String markdown); | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
...ycho.demo.markdown/src/main/java/tycho/demo/utils/markdown/impl/MarkdownRendererImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 Christoph Rüger and others. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Christoph Rüger - extend example to use bnd -sub instruction | ||
*******************************************************************************/ | ||
package tycho.demo.utils.markdown.impl; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import org.commonmark.Extension; | ||
import org.commonmark.ext.gfm.tables.TablesExtension; | ||
import org.commonmark.node.Node; | ||
import org.commonmark.parser.Parser; | ||
import org.commonmark.renderer.html.HtmlRenderer; | ||
import org.osgi.service.component.annotations.Component; | ||
|
||
import tycho.demo.utils.markdown.api.MarkdownRenderer; | ||
|
||
@Component | ||
public class MarkdownRendererImpl implements MarkdownRenderer { | ||
|
||
private Parser parser; | ||
private HtmlRenderer renderer; | ||
|
||
public MarkdownRendererImpl() { | ||
List<Extension> extensions = Arrays.asList(TablesExtension.create()); | ||
|
||
this.parser = Parser.builder().extensions(extensions).build(); | ||
this.renderer = HtmlRenderer.builder().extensions(extensions).build(); | ||
} | ||
|
||
@Override | ||
public String render(String markdown) { | ||
|
||
Node document = parser.parse(markdown); | ||
return renderer.render(document); | ||
} | ||
|
||
} |