Skip to content

Migrate to Gradle bnd workspace (bnd 7.2.1) and target Java 1.8#1

Draft
Copilot wants to merge 5 commits intomasterfrom
copilot/create-osgi-test-plugin
Draft

Migrate to Gradle bnd workspace (bnd 7.2.1) and target Java 1.8#1
Copilot wants to merge 5 commits intomasterfrom
copilot/create-osgi-test-plugin

Conversation

Copy link

Copilot AI commented Mar 10, 2026

Replaces the Ant + bnd 2.3 build system with the latest bnd Gradle workspace template (biz.aQute.bnd.workspace 7.2.1, Gradle 8.11 wrapper) and bumps all Java compilation targets from 1.5/1.6 → 1.8.

Gradle workspace scaffold

  • settings.gradlepluginManagement {} + plugins {} pattern, matching the official bndtools/workspace template
  • gradle.propertiesbnd_version=7.2.1
  • build.gradle — minimal root; subprojects are auto-discovered by the workspace plugin via their bnd.bnd files
  • Gradle 8.11 wrapper (gradlew, gradlew.bat, gradle/wrapper/)

Java 1.8 target

  • cnf/build.bnd — sets javac.source: 1.8, javac.target: 1.8, -sources: true, and git metadata manifest headers
  • All four .settings/org.eclipse.jdt.core.prefs files updated (compliance, source, targetPlatform → 1.8)

Repository modernisation

  • Replaced four FixedIndexedRepo entries (fetched Eclipse OBR indices from peterkir.github.io eagerly at workspace init, breaking offline/CI builds) with a MavenBndRepository against Maven Central
  • Added cnf/ext/eclipse.mvn listing org.eclipse.platform:org.eclipse.equinox.app:1.3.400 — the only Eclipse Platform bundle not already present in cnf/localrepo

Source compatibility fix (eclipse3/Activator.java)

The Java 11 compiler silently ignores generic Signature attributes in Java 1.4-era class files (major version 48). Both Bundle.getHeaders() and BundleContext.getServiceReferences() on the bundled org.eclipse.osgi-3.7.x.jar were affected:

// Before — fails with Java 11 (generics not readable from .class major=48)
String bsn = bundle.getHeaders().get(Constants.BUNDLE_SYMBOLICNAME);
ServiceReference<?>[] refs = context.getServiceReferences("...", "...");

// After
String bsn = (String) bundle.getHeaders().get(Constants.BUNDLE_SYMBOLICNAME);
@SuppressWarnings("unchecked")
ServiceReference[] refs = context.getServiceReferences("...", "...");

Removed

  • cnf/build.xml, cnf/build-template.xml, cnf/build.properties
  • All four per-project build.xml files

CI

  • Single ./gradlew build -x testOSGi step replaces four separate ant invocations
  • testOSGi excluded: those tests require a full Eclipse Platform runtime not available in standard CI

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • bnd.bndtools.org
    • Triggering command: /usr/bin/curl curl -s --connect-timeout 10 REDACTED (dns block)
  • https://api.github.com/repos/bndtools/bnd/contents/biz.aQute.bnd.gradle/src/main/resources
    • Triggering command: /usr/bin/curl curl -s --connect-timeout 10 REDACTED (http block)
  • https://api.github.com/repos/bndtools/workspace/contents
    • Triggering command: /usr/bin/curl curl -s --connect-timeout 10 REDACTED (http block)
  • https://api.github.com/repos/bndtools/workspace/contents/cnf
    • Triggering command: /usr/bin/curl curl -s --connect-timeout 10 REDACTED (http block)
  • https://api.github.com/repos/bndtools/workspace/git/trees/master
    • Triggering command: /usr/bin/curl curl -s --connect-timeout 10 REDACTED (http block)
  • peterkir.github.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:&#43;HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: peterkir <250545+peterkir@users.noreply.github.com>
Copilot AI changed the title [WIP] Create OSGi test plugin for bndtools.runtime.applaunch.eclipse4 Add OSGi test plugin for bndtools.runtime.applaunch.eclipse4 Mar 10, 2026
Co-authored-by: peterkir <250545+peterkir@users.noreply.github.com>
Copilot AI changed the title Add OSGi test plugin for bndtools.runtime.applaunch.eclipse4 Add GitHub Actions CI workflow Mar 11, 2026
Co-authored-by: peterkir <250545+peterkir@users.noreply.github.com>
Copilot AI changed the title Add GitHub Actions CI workflow Migrate to Gradle bnd workspace (bnd 7.2.1) and target Java 1.8 Mar 11, 2026
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

Successfully merging this pull request may close these issues.

2 participants