Skip to content

Commit

Permalink
Merge pull request #220 from olafurpg/fix-jdk
Browse files Browse the repository at this point in the history
Fix minor PackageHub regressions
  • Loading branch information
olafurpg authored May 19, 2021
2 parents d796c58 + c4d8214 commit c8a122a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PackageActor(
src: String,
coursier: String,
store: PackageStore,
packagehubUrl: String,
lsifJavaVersion: String,
val dir: Path,
val addr: Int = 3434
)(implicit ctx: Context, log: cask.Logger)
Expand Down Expand Up @@ -247,7 +247,10 @@ class PackageActor(
return dump
pkg match {
case _: NpmPackage =>
exec(sourceroot, List("yarn", "install"))
val toolVersions = sourceroot.resolve(".tool-versions")
if (!Files.isRegularFile(toolVersions)) {
Files.write(toolVersions, List("yarn 1.22.4").asJava)
}
val tsconfig = sourceroot.resolve("tsconfig.json")
if (!Files.isRegularFile(tsconfig)) {
val config = Obj(
Expand All @@ -256,6 +259,7 @@ class PackageActor(
)
Files.write(tsconfig, List(ujson.write(config, indent = 2)).asJava)
}
exec(sourceroot, List("yarn", "install"))
exec(
sourceroot,
List("npx", "@olafurpg/lsif-tsc", "-p", sourceroot.toString)
Expand Down Expand Up @@ -285,8 +289,9 @@ class PackageActor(
"launch",
"--jvm",
jvm,
"--contrib",
"lsif-java",
s"com.sourcegraph:lsif-java_2.13:${lsifJavaVersion}",
"-r",
"sonatype:snapshots",
"--",
"index",
"--output",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ case class PackageHub(
postgres: PostgresOptions = PostgresOptions(),
@Description("URL of the PackageHub server") packagehubUrl: String =
"https://packagehub-ohcltxh6aq-uc.a.run.app",
@Description(
"The version of lsif-java to use for indexing packages"
) lsifJavaVersion: String = BuildInfo.version,
@Description("Path to the src-cli binary") src: String = "src",
@Description("Path to the coursier binary") coursier: String = "coursier",
@Description("If enabled, schedule an LSIF index after the given delay")
Expand All @@ -62,7 +65,7 @@ case class PackageHub(
src,
coursier,
store,
packagehubUrl,
lsifJavaVersion,
dir.getOrElse(app.env.cacheDirectory)
)(ctx, log)
val routes = new PackageRoutes(this, actor, store, log)(ctx)
Expand Down

0 comments on commit c8a122a

Please sign in to comment.