Fix Eclipse classpath generation for libs submodule jars #6

Merged
NotAlexNoyle merged 1 commits from codex/fix-eclipse-classpath-for-gradle-submodules into main 2026-03-09 10:37:39 -04:00
NotAlexNoyle commented 2026-03-09 10:37:20 -04:00 (Migrated from github.com)

Motivation

  • Ensure source-based :libs:* submodule projects are represented as concrete jar lib entries in Eclipse instead of empty src placeholders that require manual fixes.
  • Support mixed Java/Kotlin submodules by selecting the actual produced archive (shadowJar when present, otherwise jar) for the IDE classpath.
  • Produce deterministic, stable .classpath entries by copying the built jars into build/ide-libs and stripping transient hash suffixes.

Description

  • Added discovery of :libs:* project dependencies into a new sourcePluginProjects set and call evaluationDependsOn so subprojects are available when assembling IDE artifacts.
  • Prefer shadowJar and fall back to jar for each submodule, copy the produced archive (archiveFile) into build/ide-libs, and normalize filenames by removing the git-hash suffix.
  • Make eclipseClasspath depend on the copy tasks and expose the copied jars via an ideLibs configuration so Eclipse resolution can consume them.
  • Update .classpath post-processing to remove stale/unresolved src entries that start with /libs: and append deterministic lib entries for the copied jars (prevents empty module placeholders).

Testing

  • Ran ./gradlew eclipseClasspath in this environment, which failed early; the failure is due to Kotlin/Java toolchain parsing (java.lang.IllegalArgumentException: 25.0.1) and not the new script logic.
  • Ran ./gradlew eclipseClasspath --stacktrace which reproduced the same Kotlin/Java evaluation error, preventing runtime validation of the generated .classpath here.

Codex Task

### Motivation - Ensure source-based `:libs:*` submodule projects are represented as concrete jar `lib` entries in Eclipse instead of empty `src` placeholders that require manual fixes. - Support mixed Java/Kotlin submodules by selecting the actual produced archive (`shadowJar` when present, otherwise `jar`) for the IDE classpath. - Produce deterministic, stable `.classpath` entries by copying the built jars into `build/ide-libs` and stripping transient hash suffixes. ### Description - Added discovery of `:libs:*` project dependencies into a new `sourcePluginProjects` set and call `evaluationDependsOn` so subprojects are available when assembling IDE artifacts. - Prefer `shadowJar` and fall back to `jar` for each submodule, copy the produced archive (`archiveFile`) into `build/ide-libs`, and normalize filenames by removing the git-hash suffix. - Make `eclipseClasspath` depend on the copy tasks and expose the copied jars via an `ideLibs` configuration so Eclipse resolution can consume them. - Update `.classpath` post-processing to remove stale/unresolved `src` entries that start with `/libs:` and append deterministic `lib` entries for the copied jars (prevents empty module placeholders). ### Testing - Ran `./gradlew eclipseClasspath` in this environment, which failed early; the failure is due to Kotlin/Java toolchain parsing (`java.lang.IllegalArgumentException: 25.0.1`) and not the new script logic. - Ran `./gradlew eclipseClasspath --stacktrace` which reproduced the same Kotlin/Java evaluation error, preventing runtime validation of the generated `.classpath` here. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69aed969c30c832f8a6bfacf9538569d)
Sign in to join this conversation.