Skip to content

Drop functionality related to Coursier#888

Open
jupblb wants to merge 10 commits into
mainfrom
michal/drop-coursier
Open

Drop functionality related to Coursier#888
jupblb wants to merge 10 commits into
mainfrom
michal/drop-coursier

Conversation

@jupblb
Copy link
Copy Markdown
Member

@jupblb jupblb commented May 28, 2026

No description provided.

jupblb added 6 commits May 28, 2026 11:59
This command indexed an individual Maven artifact by fetching its sources
via Coursier, unzipping the -sources.jar, and running the standard
indexer over the extracted tree. It is no longer needed.

Removed:
- IndexDependencyCommand (and its registration in ScipJava)
- LibrarySnapshotGenerator / LibrarySnapshotSuite, the only caller of
  the command, along with the saved exposed-core snapshot output under
  tests/snapshots/src/main/generated/org/jetbrains/...
- JavaVersion.classfileJvmVersion, roundToNearestStableRelease,
  classfileMajorVersion, JAVA17_VERSION, JAVA0_MAJOR_VERSION,
  CLASS_PATTERN, JAR_PATTERN — only used by IndexDependencyCommand.
  The JavaVersion class itself is kept for PackageTable and
  JavaVersionSuite.
- CONTRIBUTING.md entry for LibrarySnapshotSuite.
…enerator

With only MinimizedSnapshotScipGenerator left, the multi-generator
abstractions are no longer earning their keep.

Removed:
- SnapshotGenerator trait (single implementation, no abstract consumer)
- AggregateSnapshotGenerator (wrapped a one-element list)
- SemanticdbJavacSnapshotGenerator (defined but never referenced)
- SnapshotHandler.withoutFinishedEvent and the `self =>` alias
  (only used by the aggregate)
- MinimizedSnapshotScipGenerator.onFinished (dead empty method)

Collapsed:
- SnapshotSuite abstract base + MinimizedSnapshotScipSuite subclass
  into a single concrete MinimizedSnapshotScipSuite (file renamed to
  match)
- SaveSnapshots Map-based dispatch into a direct generator call,
  with handler.onFinished(context) invoked explicitly to preserve the
  stale-snapshot cleanup that the aggregate used to drive.
ScipBuildTool no longer fetches anything from the network.

- Maven dependency resolution: remove Dependencies.scala and the
  'dependencies' field handling from compile(). Callers must
  pre-resolve and populate the 'classpath' field; passing
  non-empty 'dependencies' produces a hard error explaining
  the migration path.
- Kotlin MPP -common JAR fetch: removed (Kotlin MPP indexing now
  produces only the JVM half).
- JDK provisioning: javacPathViaCoursier deleted. javacPath now
  requires either 'javaHome' in scip-java.json or JAVA_HOME in
  the environment and raises a clear error otherwise.
- build.sbt: drop io.get-coursier:coursier{,-jvm} from scip-java
  and the test-side coursier dep. scala-xml stays (still used
  by ClasspathEntry).
- Tests: replace the two coursier-env-var tests and the two
  resolution-dependent checkBuild cases with two focused tests:
  rejects-dependencies-field and compiles-with-empty-classpath.

Bazel, Maven, and Gradle indexing paths are unaffected.
@jupblb jupblb force-pushed the michal/drop-coursier branch from 9e7245d to 4c40d59 Compare May 28, 2026 11:01
@jupblb jupblb marked this pull request as ready for review May 28, 2026 11:03
jupblb added 4 commits May 28, 2026 13:12
The minimized17 and minimized21 subprojects compiled the same shared
sources under JDK 17/21 via JavaToolchainPlugin, which shelled out to
'cs java-home' to obtain those JDKs on demand. The CI matrix (Tests
(11)/(17)/(21)) already exercises the plugin under each JDK, so these
subprojects were redundant. Removing them eliminates the build's last
dependency on coursier.
JavaToolchainPlugin (now removed) used to set fork := true globally,
which made unit tests run in a forked JVM. Without forking, the unit
tests' TestCompiler reads System.getProperty("java.class.path") from
sbt's JVM, which doesn't include the semanticdb-javac plugin, so
compileSemanticdb produces no document and Symtab(null) NPEs.

Add Test / fork := true to the shared testSettings so unit and
snapshots projects fork like buildTools already does.
JavaToolchainPlugin (now removed) used to mask two JDK-17+ issues in the
javacPlugin project by pinning its compile JDK to 11 and stripping flags
from the doc task. With the plugin gone, both issues surface:

1. JDK 14 added Plugin.autoStart(), so JDK 17/21 javac eagerly enumerates
   ServiceLoader<Plugin> providers from the compile classpath. During
   incremental compilation our META-INF/services/com.sun.source.util.Plugin
   descriptor lives on the classpath but SemanticdbPlugin.class isn't
   built yet, so ServiceLoader throws 'Provider ... not found'.

   Fix: move the descriptor from src/main/resources/ to
   src/main/assembly-resources/ and inject that directory only into the
   assembled fat jar via 'assembly / fullClasspath'. The descriptor is
   absent from the compile classpath but still bundled in the published
   jar.

2. javadoc rejects the '-g' flag that was previously added via
   'javacOptions += "-g"'. The old plugin worked around this with
   '(doc / javacOptions) --= List("-g")'.

   Fix: scope '-g' to 'Compile / javacOptions' so it never reaches the
   doc task.
@jupblb jupblb force-pushed the michal/drop-coursier branch from 213f6b4 to e7ea166 Compare May 28, 2026 15:51
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.

1 participant