Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ These are the main components of the project.
| `snapshots/testOnly tests.MinimizedSnapshotSuite` | sbt | Runs fast snapshot tests. Indexes a small set of files under `tests/minimized`. |
| `snapshots/testOnly tests.MinimizedSnapshotSuite -- *InnerClasses*` | sbt | Runs only individual tests cases matching the name "InnerClasses". |
| `snapshots/test` | sbt | Runs all snapshot tests. |
| `snapshots/run` | sbt | Update snapshot tests. Use this command after you have fixed a bug. |
| `snapshots/run` | sbt | Update only the Java snapshot goldens under `tests/snapshots`. |
| `scipKotlincMinimized/kotlincSnapshots` | sbt | Update only the Kotlin snapshot goldens under `scip-kotlinc/minimized`. |
| `regenerateSnapshots` | sbt | Regenerate ALL snapshot goldens (Java + Kotlin). Run after fixing a bug. |
| `cli/run --cwd DIRECTORY` | sbt | Run `scip-java` command-line tool against a given Gradle/Maven build. |
| `fixAll` | sbt | Run Scalafmt, Scalafix and Javafmt on all sources. Run this before opening a PR. |

Expand Down
17 changes: 15 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ commands +=
"scalafixAll --check" :: "publishLocal" :: s
}

commands +=
Command.command("regenerateSnapshots") { s =>
"snapshots/run" :: "scipKotlincMinimized/kotlincSnapshots" :: s
}

// Shared module with the SCIP shard utilities (symbol encoder, document
// builder, on-disk writer) consumed by both the Java compiler plugin
// (scip-javac) and the Kotlin compiler plugin (scip-kotlinc).
Expand Down Expand Up @@ -480,15 +485,23 @@ lazy val scipKotlincMinimized = project
val snapDir =
(baseDirectory.value / "src" / "generatedSnapshots" / "resources")
.getAbsolutePath
val scipOut = s"$tgtRoot/index.scip"
// Write the aggregated index OUTSIDE the scanned targetroot. If it
// lived under `tgtRoot`, a second `kotlincSnapshots` run would feed
// the previous index.scip back into `aggregate`, which re-applies the
// package prefix and yields doubled symbols
// (e.g. `scip-java maven . . scip-java maven . . kotlin/`).
val indexDir = target.value / "scip-index"
IO.createDirectory(indexDir)
val scipOut = (indexDir / "index.scip").getAbsolutePath
val mainCls = "com.sourcegraph.scip_java.ScipJava"
Def.sequential(
Compile / compile,
(cli / Compile / runMain).toTask(
s" $mainCls aggregate --no-emit-inverse-relationships --cwd $srcRoot --output $scipOut $tgtRoot"
),
(cli / Compile / runMain).toTask(
s" $mainCls snapshot --cwd $srcRoot --output $snapDir $tgtRoot"
s" $mainCls snapshot --cwd $srcRoot --output $snapDir ${indexDir
.getAbsolutePath}"
)
)
}
Expand Down
71 changes: 70 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-25.11";
};
scip = {
url = "github:scip-code/scip";
};
};

outputs =
{
self,
flake-utils,
nixpkgs,
scip,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
scipCli = scip.packages.${system}.default;
mkDevShell =
jdk:
pkgs.mkShellNoCC {
Expand All @@ -32,6 +37,7 @@
nodejs
(sbt.override ({ jre = jdk; }))
scalafmt
scipCli
yarn
];
};
Expand Down
Loading
Loading