Skip to content

Commit b2e56ca

Browse files
Copilotpeterkir
andcommitted
feat(osgi): implement bnd workspace with resolvable/executable bndrun files
- osgi/ workspace: bnd Gradle 8.13 workspace with Java 21 toolchain - cnf/build.bnd: workspace settings (Java 21, io.klib namespace, DS annotations) - cnf/ext/repositories.bnd: BndPomRepository + LocalIndexedRepo - cnf/ext/junit5.bnd: JUnit 5 / osgi-test BSN variable definitions - cnf/pom.xml: Maven Central artifact list for BndPomRepository - io.klib.bootstrap.api: BootstrapService + Java/Eclipse/Oomph provision interfaces + ProvisionResult record (Java 21) - io.klib.bootstrap.core: DS @component implementations + 12 JUnit 5 unit tests (all passing) - io.klib.bootstrap.app: launch.bndrun + debug.bndrun (executable, export verified) - io.klib.bootstrap.test.integration: 6 osgi-test/@InjectService integration tests (all passing) - All bndrun files have pre-resolved -runbundles with correct BSNs and versions Agent-Logs-Url: https://github.com/klibio/bootstrap/sessions/ee1da615-53bd-4256-a952-e1796756967a Co-authored-by: peterkir <250545+peterkir@users.noreply.github.com>
1 parent 5523fc9 commit b2e56ca

39 files changed

Lines changed: 1538 additions & 0 deletions

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,14 @@
22
HOME_devel*/
33
resp.json
44
gh_repos_response.json
5+
6+
# ─── bnd workspace build artifacts ───────────────────────────────
7+
osgi/*/bin/
8+
osgi/*/bin_test/
9+
osgi/*/generated/
10+
osgi/cnf/local/
11+
osgi/cnf/cache/
12+
osgi/.gradle/
13+
osgi/build/
14+
osgi/**/build/
15+

osgi/build.gradle

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* ============================================================
2+
build.gradle — root workspace build
3+
Applies Gradle Java toolchain (Java 21) and JUnit Platform
4+
to every bnd bundle sub-project discovered in the workspace.
5+
============================================================ */
6+
7+
subprojects {
8+
if (pluginManager.hasPlugin('biz.aQute.bnd')) {
9+
10+
// Group from namespace; version is managed by bnd via cnf/build.bnd base.version
11+
group = 'io.klib'
12+
13+
// Compile with Java 21 toolchain (auto-downloads if not found)
14+
java {
15+
toolchain {
16+
languageVersion = JavaLanguageVersion.of(21)
17+
}
18+
}
19+
20+
// JUnit 5 test runner
21+
tasks.named('test') {
22+
useJUnitPlatform()
23+
testLogging {
24+
events 'passed', 'failed', 'skipped'
25+
exceptionFormat 'full'
26+
}
27+
}
28+
}
29+
}

osgi/cnf/build.bnd

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
########################
2+
## WORKSPACE BUILD SETTINGS
3+
########################
4+
-require-bnd: "(version>=7.0.0)"
5+
6+
# Java 21 source / target
7+
javac.source: 21
8+
javac.target: 21
9+
-release: 21
10+
11+
# Workspace version
12+
base.version: 0.3.0
13+
Bundle-Version: ${base.version}.${tstamp}-SNAPSHOT
14+
15+
# Default bundle headers
16+
Bundle-Vendor: klibio
17+
Bundle-License: https://opensource.org/licenses/MIT
18+
Bundle-DocURL: https://github.com/klibio/bootstrap
19+
20+
# Reproducible builds
21+
-reproducible: true
22+
-noextraheaders: true
23+
24+
# Derive Java module name from BSN
25+
Automatic-Module-Name: ${def;bsn}
26+
27+
# Workspace-wide compile additions (provided scope — not exported into -runbundles)
28+
-buildpath+: \
29+
osgi.annotation;~version=latest;~maven-scope=provided, \
30+
osgi.core;~version=latest;~maven-scope=provided
31+
32+
# Workspace-wide test additions
33+
-testpath+: \
34+
osgi.annotation;~version=latest, \
35+
osgi.core;~version=latest
36+
37+
# DS annotation processing
38+
-dsannotations: *
39+
40+
# OSGi version range policies
41+
-provider-policy: ${range;[==,=+)}
42+
-consumer-policy: ${range;[==,+)}
43+
44+
# NOTE: cnf/ext/*.bnd files are auto-included by bnd workspace — do NOT add explicit -include here

osgi/cnf/ext/junit5.bnd

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# JUnit 5 dependency variables — reference with ${junit5} in project bnd.bnd files
2+
# Note: JUnit 5 OSGi Bundle-SymbolicNames use short names (junit-jupiter-api etc.)
3+
junit5: \
4+
junit-jupiter-api;version='[5.11,6)', \
5+
junit-jupiter-engine;version='[5.11,6)', \
6+
junit-platform-commons;version='[1.11,2)', \
7+
junit-platform-engine;version='[1.11,2)', \
8+
junit-platform-launcher;version='[1.11,2)', \
9+
org.opentest4j;version='[1.3,2)'
10+
11+
# bnd JUnit 5 OSGi test runner (required for integration.bndrun)
12+
bnd.tester.junit5: \
13+
biz.aQute.tester.junit-platform;version='[7,8)'
14+
15+
# osgi-test from eclipse-osgi-technology — https://github.com/eclipse-osgi-technology/osgi-test
16+
# Published on Maven Central under groupId org.osgi (not org.eclipse.osgi-technology)
17+
# Provides: BundleContextExtension, ServiceExtension, @InjectBundleContext, @InjectService
18+
osgi.test.junit5: \
19+
org.osgi.test.junit5;version='[1.3,2)', \
20+
org.osgi.test.common;version='[1.3,2)'
21+
22+
# Combined OSGi integration test path
23+
osgi.test.all: ${junit5}, ${bnd.tester.junit5}, ${osgi.test.junit5}

osgi/cnf/ext/repositories.bnd

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Local indexed repository — stores locally built bundle JARs
2+
-plugin.Local: \
3+
aQute.bnd.deployer.repository.LocalIndexedRepo; \
4+
name = Local; \
5+
local = ${workspace}/cnf/local; \
6+
readonly = false
7+
8+
# Maven Central via BndPomRepository — eagerly resolves OSGi bundles from the POM dependency list.
9+
# This plugin builds its BSN index on first use and caches it in ${storageDir}.
10+
-plugin.Central: \
11+
aQute.bnd.repository.maven.pom.provider.BndPomRepository; \
12+
name = Central; \
13+
releaseUrls = https://repo1.maven.org/maven2/; \
14+
pom = ${workspace}/cnf/pom.xml; \
15+
snapshotUrls = https://oss.sonatype.org/content/repositories/snapshots/
16+
17+

osgi/cnf/gradle.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Gradle settings
2+
org.gradle.daemon=true
3+
org.gradle.parallel=true
4+
org.gradle.jvmargs=-Xmx1g
5+
6+
# bnd Gradle plugin version (keep in sync with settings.gradle buildscript)
7+
bnd_version=7.1.0

osgi/cnf/pom.xml

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
This POM is used exclusively by the bnd MavenBndRepository plugin to resolve
4+
external bundle artifacts from Maven Central into the bnd workspace repository.
5+
It is NOT a build POM — do not run mvn against it.
6+
-->
7+
<project xmlns="http://maven.apache.org/POM/4.0.0"
8+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
10+
http://maven.apache.org/xsd/maven-4.0.0.xsd">
11+
<modelVersion>4.0.0</modelVersion>
12+
<groupId>io.klib</groupId>
13+
<artifactId>workspace-deps</artifactId>
14+
<version>0.3.0</version>
15+
<packaging>pom</packaging>
16+
17+
<dependencies>
18+
19+
<!-- ═══════════════════════════════════════════════
20+
OSGi Core & Annotations
21+
═══════════════════════════════════════════════ -->
22+
<dependency>
23+
<groupId>org.osgi</groupId>
24+
<artifactId>osgi.core</artifactId>
25+
<version>8.0.0</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>org.osgi</groupId>
29+
<artifactId>osgi.annotation</artifactId>
30+
<version>8.1.0</version>
31+
</dependency>
32+
<dependency>
33+
<groupId>org.osgi</groupId>
34+
<artifactId>org.osgi.service.component.annotations</artifactId>
35+
<version>1.5.1</version>
36+
</dependency>
37+
<dependency>
38+
<groupId>org.osgi</groupId>
39+
<artifactId>org.osgi.service.component</artifactId>
40+
<version>1.5.1</version>
41+
</dependency>
42+
<dependency>
43+
<groupId>org.osgi</groupId>
44+
<artifactId>org.osgi.util.promise</artifactId>
45+
<version>1.3.0</version>
46+
</dependency>
47+
<dependency>
48+
<groupId>org.osgi</groupId>
49+
<artifactId>org.osgi.util.function</artifactId>
50+
<version>1.1.0</version>
51+
</dependency>
52+
53+
<!-- ═══════════════════════════════════════════════
54+
Apache Felix Runtime
55+
═══════════════════════════════════════════════ -->
56+
<dependency>
57+
<groupId>org.apache.felix</groupId>
58+
<artifactId>org.apache.felix.framework</artifactId>
59+
<version>7.0.5</version>
60+
</dependency>
61+
<dependency>
62+
<groupId>org.apache.felix</groupId>
63+
<artifactId>org.apache.felix.scr</artifactId>
64+
<version>2.2.6</version>
65+
</dependency>
66+
<dependency>
67+
<groupId>org.apache.felix</groupId>
68+
<artifactId>org.apache.felix.log</artifactId>
69+
<version>1.3.0</version>
70+
</dependency>
71+
<dependency>
72+
<groupId>org.apache.felix</groupId>
73+
<artifactId>org.apache.felix.logback</artifactId>
74+
<version>1.0.6</version>
75+
</dependency>
76+
<dependency>
77+
<groupId>org.apache.felix</groupId>
78+
<artifactId>org.apache.felix.gogo.runtime</artifactId>
79+
<version>1.1.6</version>
80+
</dependency>
81+
<dependency>
82+
<groupId>org.apache.felix</groupId>
83+
<artifactId>org.apache.felix.gogo.command</artifactId>
84+
<version>1.1.2</version>
85+
</dependency>
86+
<dependency>
87+
<groupId>org.apache.felix</groupId>
88+
<artifactId>org.apache.felix.gogo.shell</artifactId>
89+
<version>1.1.4</version>
90+
</dependency>
91+
92+
<!-- ═══════════════════════════════════════════════
93+
SLF4J (required by Felix Logback)
94+
═══════════════════════════════════════════════ -->
95+
<dependency>
96+
<groupId>org.slf4j</groupId>
97+
<artifactId>slf4j-api</artifactId>
98+
<version>2.0.16</version>
99+
</dependency>
100+
<dependency>
101+
<groupId>ch.qos.logback</groupId>
102+
<artifactId>logback-classic</artifactId>
103+
<version>1.5.12</version>
104+
</dependency>
105+
<dependency>
106+
<groupId>ch.qos.logback</groupId>
107+
<artifactId>logback-core</artifactId>
108+
<version>1.5.12</version>
109+
</dependency>
110+
111+
<!-- ═══════════════════════════════════════════════
112+
JUnit 5 (OSGi-compatible bundles from JUnit 5.11+)
113+
═══════════════════════════════════════════════ -->
114+
<dependency>
115+
<groupId>org.junit.jupiter</groupId>
116+
<artifactId>junit-jupiter-api</artifactId>
117+
<version>5.11.4</version>
118+
</dependency>
119+
<dependency>
120+
<groupId>org.junit.jupiter</groupId>
121+
<artifactId>junit-jupiter-engine</artifactId>
122+
<version>5.11.4</version>
123+
</dependency>
124+
<dependency>
125+
<groupId>org.junit.jupiter</groupId>
126+
<artifactId>junit-jupiter-params</artifactId>
127+
<version>5.11.4</version>
128+
</dependency>
129+
<dependency>
130+
<groupId>org.junit.platform</groupId>
131+
<artifactId>junit-platform-commons</artifactId>
132+
<version>1.11.4</version>
133+
</dependency>
134+
<dependency>
135+
<groupId>org.junit.platform</groupId>
136+
<artifactId>junit-platform-engine</artifactId>
137+
<version>1.11.4</version>
138+
</dependency>
139+
<dependency>
140+
<groupId>org.junit.platform</groupId>
141+
<artifactId>junit-platform-launcher</artifactId>
142+
<version>1.11.4</version>
143+
</dependency>
144+
<dependency>
145+
<groupId>org.opentest4j</groupId>
146+
<artifactId>opentest4j</artifactId>
147+
<version>1.3.0</version>
148+
</dependency>
149+
<!-- apiguardian-api (required by JUnit 5 annotations) -->
150+
<dependency>
151+
<groupId>org.apiguardian</groupId>
152+
<artifactId>apiguardian-api</artifactId>
153+
<version>1.1.2</version>
154+
</dependency>
155+
156+
<!-- ═══════════════════════════════════════════════
157+
bnd JUnit 5 OSGi Test Runner
158+
═══════════════════════════════════════════════ -->
159+
<dependency>
160+
<groupId>biz.aQute.bnd</groupId>
161+
<artifactId>biz.aQute.tester.junit-platform</artifactId>
162+
<version>7.1.0</version>
163+
</dependency>
164+
<dependency>
165+
<groupId>biz.aQute.bnd</groupId>
166+
<artifactId>biz.aQute.tester</artifactId>
167+
<version>7.1.0</version>
168+
</dependency>
169+
170+
<!-- ═══════════════════════════════════════════════
171+
eclipse-osgi-technology/osgi-test
172+
https://github.com/eclipse-osgi-technology/osgi-test
173+
Published on Maven Central under groupId org.osgi
174+
Provides: @InjectBundleContext, @InjectService, BundleContextExtension, ServiceExtension
175+
═══════════════════════════════════════════════ -->
176+
<dependency>
177+
<groupId>org.osgi</groupId>
178+
<artifactId>org.osgi.test.common</artifactId>
179+
<version>1.3.0</version>
180+
</dependency>
181+
<dependency>
182+
<groupId>org.osgi</groupId>
183+
<artifactId>org.osgi.test.junit5</artifactId>
184+
<version>1.3.0</version>
185+
</dependency>
186+
187+
</dependencies>
188+
</project>
47.8 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)