-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement: add custom bsp as possible build tool (#5791)
- Loading branch information
1 parent
72692d2
commit 73706fa
Showing
25 changed files
with
417 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
metals/src/main/scala/scala/meta/internal/builds/BspOnly.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package scala.meta.internal.builds | ||
|
||
import java.security.MessageDigest | ||
|
||
import scala.meta.internal.builds.Digest | ||
import scala.meta.internal.mtags.MD5 | ||
import scala.meta.io.AbsolutePath | ||
|
||
/** | ||
* Build tool for custom bsp detected in `.bsp/<name>.json` or `bspGlobalDirectories` | ||
*/ | ||
case class BspOnly( | ||
override val executableName: String, | ||
override val projectRoot: AbsolutePath, | ||
pathToBspConfig: AbsolutePath, | ||
) extends BuildTool { | ||
override def digest(workspace: AbsolutePath): Option[String] = { | ||
val digest = MessageDigest.getInstance("MD5") | ||
val isSuccess = | ||
Digest.digestJson(pathToBspConfig, digest) | ||
if (isSuccess) Some(MD5.bytesToHex(digest.digest())) | ||
else None | ||
} | ||
override val forcesBuildServer = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.