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
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
55 changes: 25 additions & 30 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 @@ -82,8 +81,8 @@ lazy val agent = project
moduleName := "semanticdb-agent",
libraryDependencies ++=
List(
"net.bytebuddy" % "byte-buddy" % "1.11.9",
"net.bytebuddy" % "byte-buddy-agent" % "1.15.7"
"net.bytebuddy" % "byte-buddy" % "1.15.11",
"net.bytebuddy" % "byte-buddy-agent" % "1.15.11"
),
Compile / packageBin / packageOptions +=
Package.ManifestAttributes(
Expand Down Expand Up @@ -125,7 +124,16 @@ lazy val javacPlugin = project
fatjarPackageSettings,
javaOnlySettings,
moduleName := "semanticdb-javac",
javacOptions += "-g",
// Scoped to compile so doc tasks (which reject -g) are unaffected.
Compile / compile / javacOptions += "-g",
// JDK 14+ ServiceLoader-scans the classpath for Plugin providers; our
// own META-INF/services entry points at SemanticdbPlugin before it's
// built. Force an empty processor path so javac skips the scan.
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 +239,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 @@ -335,6 +341,8 @@ lazy val semanticdbKotlinc = project
description := "A kotlinc plugin to emit SemanticDB information",
crossPaths := false,
autoScalaLibrary := false,
// Pin bytecode to major 55 so sbt-assembly's older ASM can shade it.
Compile / javacOptions ++= Seq("--release", "11"),
kotlinVersion := V.kotlinVersion,
kotlincJvmTarget := "1.8",
kotlincOptions ++= Seq("-Xinline-classes", "-Xcontext-parameters"),
Expand Down Expand Up @@ -575,28 +583,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 +646,22 @@ lazy val javaOnlySettings = List[Def.Setting[_]](
incOptions ~= { old =>
old.withEnabled(false).withApiDebug(true)
},
crossPaths := false
crossPaths := false,
// Pin bytecode to major 55 so sbt-assembly's older ASM can shade it.
Compile / javacOptions ++= Seq("--release", "11")
)

val testSettings = List(
(publish / skip) := true,
autoScalaLibrary := true,
Test / fork := true,
// Open the JDK-internal javac packages to in-process tests that drive
// javac via reflection (e.g. JavacClassesDirectorySuite, TestCompiler).
// On JDK 17+ this is required or the reflective access fails.
Test / javaOptions ++= javacModuleOptions.map(_.stripPrefix("-J")),
// Pin the JDK version embedded in stdlib SCIP symbols (e.g. `jdk 11
// java/lang/String#`) so snapshots are stable across JDK 11/17/21.
Test / javaOptions += "-Dscip.jdk.version=11",
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