Skip to content
Draft
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
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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
`bazelisk`, `scalafmt`, `nodejs`, `yarn`, `git`, 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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM eclipse-temurin:17@sha256:6eca72bb4cd5fb8cd215f2579a4dfffd24b0f47effb6c868b7e92b7f0422fa9f

RUN apt-get update && apt-get install --yes jq wget curl zip unzip git python3 python3-pip autoconf automake libtool build-essential libtool make g++
RUN apt-get update && apt-get install --yes wget curl zip unzip git python3 python3-pip autoconf automake libtool build-essential libtool make g++

WORKDIR /workdir

Expand Down
7 changes: 0 additions & 7 deletions bin/scip-java-docker-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
# `scip-java` binary is already installed at `/app/scip-java/bin/scip-java`.
set -eu
JVM_VERSION="${JVM_VERSION:-21,17,11,8}"
FILE="$PWD/lsif-java.json"
if test -f "$FILE"; then
FROM_CONFIG=$(jq -r '.jvm' "$FILE")
if [ "$FROM_CONFIG" != "null" ]; then
JVM_VERSION="$FROM_CONFIG"
fi
fi

JVM_VERSIONS=$(echo "$JVM_VERSION" | tr "," "\n")

Expand Down
9 changes: 1 addition & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,7 @@ lazy val cli = project
"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,
"org.jetbrains.kotlin" % "kotlin-compiler-embeddable" % V.kotlinVersion,
"org.jetbrains.kotlin" % "kotlin-scripting-common" % V.kotlinVersion,
"org.jetbrains.kotlin" % "kotlin-scripting-jvm" % V.kotlinVersion,
"org.jetbrains.kotlin" % "kotlin-scripting-dependencies" %
V.kotlinVersion,
"org.jetbrains.kotlin" % "kotlin-scripting-dependencies-maven" %
V.kotlinVersion
"org.scalameta" %% "moped" % V.moped
),
(Compile / resourceGenerators) +=
Def
Expand Down
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
git
(gradle.override ({ java = jdk; }))
jdk
jq
(maven.override ({ jdk_headless = jdk; }))
nixfmt
nodejs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import java.io.File
import java.nio.file.Path

import scala.concurrent.duration.Duration
import scala.util.Try
import scala.xml.XML

import coursier.Fetch
import coursier.Repositories
import coursier.Resolve
import coursier.cache.Cache
import coursier.cache.CachePolicy
import coursier.cache.FileCache
import coursier.core._
Expand Down Expand Up @@ -43,39 +41,6 @@ object Dependencies {
Repositories.centralGcs
)

/**
* Attempts to find the "common definitions" JAR for a potentially
* MultiPlatform Project. We only support JVM for now, native and JS are not
* supported. If it ends with '-jvm', we search for a JAR with the classifier
* truncated. If it does not end with -jvm, we search for a JAR with the
* -common classifier. This is non-exhaustive, and the classifiers are
* completely arbitrary.
*/
def kotlinMPPCommon(
group: String,
artifact: String,
version: String
): Option[Path] =
Try {
val task = Fetch[Task](Cache.default)
.withClassifiers(Set(Classifier.sources))
.addRepositories(defaultExtraRepositories: _*)

if (artifact.endsWith("-jvm")) {
val dependency = Dependencies.parseDependency(
s"$group:${artifact.stripSuffix("-jvm")}:$version"
)
val result = task.addDependencies(dependency).runResult()
return Some(result.files.head.toPath)
}

val dependency = Dependencies.parseDependency(
s"$group:$artifact-common:$version"
)
val result = task.addDependencies(dependency).runResult()
result.files.head.toPath
}.toOption

def resolveDependencies(
dependencies: List[String],
transitive: Boolean = true
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ object BuildTool {
// first detected build tool will be used in `auto` mode
// Bazel is missing because it isn't supported by auto-indexing

// first as it indicates user's intent to use SCIP auto-indexing
new ScipBuildTool(index),
// Maven first, then Gradle
// To match the order indicated in IntelliJ Java developer survey 2022:
// https://www.jetbrains.com/lp/devecosystem-2022/java/#which-build-systems-do-you-regularly-use-if-any-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import scala.jdk.CollectionConverters._

import com.sourcegraph.scip_java.Embedded
import com.sourcegraph.scip_java.commands.IndexCommand
import org.intellij.lang.annotations.Language

case class GradleJavaToolchains(
toolchains: List[GradleJavaCompiler],
Expand Down Expand Up @@ -86,7 +85,6 @@ object GradleJavaToolchains {
)
val gradleVersionPath = tmp.resolve("gradle-version.txt")
val taskName = "scipDetectJavaToolchains"
@Language("Groovy")
val script =
s"""|
|try {
Expand Down
Loading
Loading