Skip to content
This repository was archived by the owner on Jul 2, 2026. It is now read-only.

Commit 8df49a9

Browse files
authored
Drop snapshot runner (#141)
Drop the KotlinPlugin (and kotlin-stdlib) from snapshotsRunner — it now exists purely as a classpath container for scip-java_2.13. The snapshots task chains two ScipJava.main invocations (index-semanticdb then snapshot) via Def.sequential + runMain, removing the need for the Snapshot.kt entry point.
1 parent 406d727 commit 8df49a9

2 files changed

Lines changed: 18 additions & 41 deletions

File tree

build.sbt

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,10 @@ lazy val kotlinc = project
141141

142142
lazy val snapshotsRunner = project
143143
.in(file("snapshots-runner"))
144-
.enablePlugins(KotlinPlugin)
145144
.settings(
146145
publish / skip := true,
147-
kotlinVersion := V.kotlin,
148-
kotlincJvmTarget := "1.8",
149-
kotlinLib("stdlib"),
150-
151-
// Pulls in com.sourcegraph.scip_java.ScipJava (the published scip-java CLI)
152-
// which Snapshot.kt invokes via ScipJava.main.
146+
crossPaths := false,
147+
autoScalaLibrary := false,
153148
libraryDependencies +=
154149
"com.sourcegraph" % "scip-java_2.13" % V.scipJava,
155150

@@ -237,15 +232,25 @@ lazy val minimized = project
237232
},
238233

239234
// ----- snapshots regeneration task -----
240-
// Runs snapshotsRunner's SnapshotKt in the snapshotsRunner JVM (forked —
241-
// ScipJava.main calls System.exit). Snapshot.kt reads sourceroot,
242-
// targetroot, snapshotDir from argv.
235+
// Invokes `com.sourcegraph.scip_java.ScipJava.main` twice in the
236+
// snapshotsRunner JVM (forked — ScipJava.main calls System.exit on
237+
// failure). First pass converts the *.semanticdb files under
238+
// target/semanticdb-targetroot/ into an index.scip; second pass renders
239+
// that index as the human-readable golden snapshots.
243240
snapshots := Def.taskDyn {
244-
val _ = (Compile / compile).value
245241
val srcRoot = (ThisBuild / baseDirectory).value.getAbsolutePath
246242
val tgtRoot = (target.value / "semanticdb-targetroot").getAbsolutePath
247243
val snapDir = (baseDirectory.value / "src" / "generatedSnapshots" / "resources").getAbsolutePath
248-
(snapshotsRunner / Compile / runMain)
249-
.toTask(s" com.sourcegraph.scip_kotlin.SnapshotKt $srcRoot $tgtRoot $snapDir")
244+
val scipOut = s"$tgtRoot/index.scip"
245+
val mainCls = "com.sourcegraph.scip_java.ScipJava"
246+
Def.sequential(
247+
Compile / compile,
248+
(snapshotsRunner / Compile / runMain).toTask(
249+
s" $mainCls index-semanticdb --no-emit-inverse-relationships --cwd $srcRoot --output $scipOut $tgtRoot"
250+
),
251+
(snapshotsRunner / Compile / runMain).toTask(
252+
s" $mainCls snapshot --cwd $srcRoot --output $snapDir $tgtRoot"
253+
)
254+
)
250255
}.value
251256
)

snapshots-runner/src/main/kotlin/com/sourcegraph/scip_kotlin/Snapshot.kt

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)