Skip to content
Open
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
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ nix develop .#jdk17 # JDK 17
nix develop .#jdk21 # JDK 21
```

This drops you into a shell with `sbt`, `cs` (coursier), `maven`, `gradle`,
`bazelisk`, `scalafmt`, `nodejs`, `yarn`, `git`, `jq`, etc. all pinned to the
versions used in CI.
This drops you into a shell with `sbt`, `maven`, `gradle`, `bazelisk`,
`scalafmt`, `nodejs`, `yarn`, `git`, `jq`, etc. all pinned to the versions used
in CI.

If you'd rather install tools manually, you'll need at least:

Expand Down Expand Up @@ -55,7 +55,6 @@ These are the main components of the project.
| `buildTools/test` | sbt | Run slow build tool tests (Gradle, Maven). |
| `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/testOnly tests.LibrarySnapshotSuite` | sbt | Runs slow snapshot tests. Indexes a corpus of external Java libraries. |
| `snapshots/test` | sbt | Runs all snapshot tests. |
| `snapshots/run` | sbt | Update snapshot tests. Use this command after you have fixed a bug. |
| `cli/run --cwd DIRECTORY` | sbt | Run `scip-java` command-line tool against a given Gradle/Maven build. |
Expand Down
51 changes: 23 additions & 28 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import scala.collection.mutable.ListBuffer
lazy val V =
new {
val protobuf = "4.32.1"
val coursier = "2.1.9"
val scalaXml = "2.1.0"
val moped = "0.2.0"
val gradle = "7.0"
Expand Down Expand Up @@ -125,7 +124,22 @@ lazy val javacPlugin = project
fatjarPackageSettings,
javaOnlySettings,
moduleName := "semanticdb-javac",
javacOptions += "-g",
// Scope -g to the compile task so it doesn't leak into the doc task —
// javadoc rejects '-g' as an unknown flag.
Compile / compile / javacOptions += "-g",
// JDK 14+ javac eagerly enumerates Plugin providers from the processor
// path (or, if absent, the compile classpath). During incremental
// compilation our own META-INF/services/com.sun.source.util.Plugin
// resource is on the classpath but SemanticdbPlugin.class isn't built
// yet, which trips ServiceLoader. Force an explicit empty processor
// path so javac doesn't scan our own output directory. The resource
// must stay in src/main/resources/ so that internal sbt dependents
// (e.g. the `minimized` test project) can find the plugin descriptor.
Compile / compile / javacOptions ++= {
val empty = target.value / "empty-processorpath"
IO.createDirectory(empty)
Seq("-processorpath", empty.getAbsolutePath)
},
(assembly / assemblyShadeRules) :=
Seq(
ShadeRule
Expand Down Expand Up @@ -231,8 +245,6 @@ lazy val cli = project
buildInfoPackage := "com.sourcegraph.scip_java",
libraryDependencies ++=
List(
"io.get-coursier" %% "coursier" % V.coursier,
"io.get-coursier" %% "coursier-jvm" % V.coursier,
"org.scala-lang.modules" %% "scala-xml" % V.scalaXml,
"com.lihaoyi" %% "requests" % V.requests,
"org.scalameta" %% "moped" % V.moped,
Expand Down Expand Up @@ -575,28 +587,6 @@ def javacModuleOptions = List(
"-Jjdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"
)

lazy val minimized17 = project
.in(file("tests/minimized/.j17"))
.settings(
javaOnlySettings,
minimizedSettings,
javaToolchainVersion := "17",
javacOptions ++= javacModuleOptions
)
.dependsOn(agent, javacPlugin)
.disablePlugins(JavaFormatterPlugin)

lazy val minimized21 = project
.in(file("tests/minimized/.j21"))
.settings(
javaOnlySettings,
minimizedSettings,
javaToolchainVersion := "21",
javacOptions ++= javacModuleOptions
)
.dependsOn(agent, javacPlugin)
.disablePlugins(JavaFormatterPlugin)

lazy val unit = project
.in(file("tests/unit"))
.settings(
Expand Down Expand Up @@ -660,12 +650,18 @@ lazy val javaOnlySettings = List[Def.Setting[_]](
incOptions ~= { old =>
old.withEnabled(false).withApiDebug(true)
},
crossPaths := false
crossPaths := false,
// Java 11 is our minimum supported runtime and sbt-assembly's shader uses
// an ASM version that can't read newer class files (e.g. class major 61
// emitted by JDK 17). Pinning the release target keeps the bytecode at
// version 55 regardless of which JDK runs sbt, so shading still works.
Compile / javacOptions ++= Seq("--release", "11")
)

val testSettings = List(
(publish / skip) := true,
autoScalaLibrary := true,
Test / fork := true,
testFrameworks := List(TestFrameworks.MUnit),
testOptions ++= {
if (!(Test / testForkedParallel).value)
Expand All @@ -678,7 +674,6 @@ val testSettings = List(
"org.scalameta" %% "munit" % "0.7.29",
"org.scalameta" %% "moped-testkit" % V.moped,
"org.scalameta" %% "scalameta" % V.scalameta,
"io.get-coursier" %% "coursier" % V.coursier,
"com.lihaoyi" %% "pprint" % "0.6.6"
)
)
Expand Down
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
pkgs.mkShellNoCC {
buildInputs = with pkgs; [
bazelisk
(coursier.override ({ jre = jdk; }))
git
(gradle.override ({ java = jdk; }))
jdk
Expand Down
71 changes: 0 additions & 71 deletions project/JavaToolchainPlugin.scala

This file was deleted.

164 changes: 0 additions & 164 deletions scip-java/src/main/scala/com/sourcegraph/scip_java/Dependencies.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.sourcegraph.scip_java
import java.io.PrintStream

import com.sourcegraph.scip_java.commands.IndexCommand
import com.sourcegraph.scip_java.commands.IndexDependencyCommand
import com.sourcegraph.scip_java.commands.IndexSemanticdbCommand
import com.sourcegraph.scip_java.commands.SnapshotCommand
import moped.cli.Application
Expand All @@ -21,7 +20,6 @@ object ScipJava {
CommandParser[VersionCommand],
CommandParser[IndexCommand],
CommandParser[IndexSemanticdbCommand],
CommandParser[IndexDependencyCommand],
CommandParser[SnapshotCommand]
)
)
Expand Down
Loading
Loading