Skip to content

Commit

Permalink
add sbt BuildInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
aishfenton committed Jan 7, 2023
1 parent de19c5b commit 79694d8
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
13 changes: 11 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ val scala3Version = "3.2.1"

// enablePlugins(JavaAppPackaging)
enablePlugins(GraalVMNativeImagePlugin)
enablePlugins(BuildInfoPlugin)

lazy val root = project
.in(file("."))
.settings(
name := "bazel-bsp",
organization := "afenton",
version := "0.0.15",
version := "0.0.16",
scalaVersion := scala3Version,
libraryDependencies += "org.typelevel" %% "cats-effect" % "3.4.4",
libraryDependencies += "co.fs2" %% "fs2-core" % "3.3.0",
Expand All @@ -32,5 +33,13 @@ lazy val root = project
),
Compile / PB.targets := Seq(
scalapb.gen() -> (Compile / sourceManaged).value / "scalapb"
)
),
buildInfoKeys := Seq[BuildInfoKey](
name,
version,
scalaVersion,
sbtVersion,
"bspVersion" -> "2.0.0-M2"
),
buildInfoPackage := "afenton.bazel.bsp"
)
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.11")
addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.3")

libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.11"

addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
6 changes: 3 additions & 3 deletions src/main/scala/afenton/bazel/bsp/BazelBspApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object BazelBspApp
extends CommandIOApp(
name = "bazel-bsp",
header = "Bazel BSP server",
version = BuildMetaData.Version
version = BuildInfo.version
):

val verboseOpt =
Expand Down Expand Up @@ -124,8 +124,8 @@ object BazelBspApp
private lazy val bspConfig: String = s"""
{
"name": "BazelBsp",
"version": "${BuildMetaData.Version}",
"bspVersion": "${BuildMetaData.BspVersion}",
"version": "${BuildInfo.version}",
"bspVersion": "${BuildInfo.bspVersion}",
"languages": [
"scala"
],
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/afenton/bazel/bsp/BazelBspServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class BazelBspServer(

InitializeBuildResult(
"Bazel",
BuildMetaData.Version,
BuildMetaData.BspVersion,
BuildInfo.version,
BuildInfo.bspVersion,
BuildServerCapabilities(
compileProvider = Some(compileProvider),
inverseSourcesProvider = Some(true),
Expand Down
6 changes: 0 additions & 6 deletions src/main/scala/afenton/bazel/bsp/BuildMetaData.scala

This file was deleted.

4 changes: 2 additions & 2 deletions src/test/scala/afenton/bazel/bsp/End2EndTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class End2EndTest extends munit.CatsEffectSuite with BspHelpers:
responses.select[InitializeBuildResult],
InitializeBuildResult(
"Bazel",
BuildMetaData.Version,
BuildMetaData.BspVersion,
BuildInfo.version,
BuildInfo.bspVersion,
BuildServerCapabilities(
compileProvider = Some(CompileProvider(List("scala"))),
inverseSourcesProvider = Some(true),
Expand Down

0 comments on commit 79694d8

Please sign in to comment.