Fix warnings in SBT build (#8026)

Fixes warnings on SBT startup

```
$ sbt
[info] welcome to sbt 1.9.0 (GraalVM Community Java 17.0.7)
...
[warn] 5 feature warnings; re-run with -feature for details
[warn] one warning found
[info] loading settings for project enso from build.sbt ...
```
This commit is contained in:
Dmitry Bushev 2023-10-12 09:19:45 +01:00 committed by GitHub
parent cd84ac16ce
commit 1a7e83b80c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -84,14 +84,14 @@ object BuildInfo {
private def getGitInformation(log: ManagedLogger): Option[GitInformation] = private def getGitInformation(log: ManagedLogger): Option[GitInformation] =
try { try {
val hash = ("git rev-parse HEAD" !!).trim val hash = "git rev-parse HEAD".!!.trim
val ref = val ref =
try { try {
val branchCommand = "git symbolic-ref -q --short HEAD" val branchCommand = "git symbolic-ref -q --short HEAD"
val tagCommand = "git describe --tags --exact-match" val tagCommand = "git describe --tags --exact-match"
val refCommand = val refCommand =
branchCommand #|| tagCommand branchCommand #|| tagCommand
(refCommand !!).trim refCommand.!!.trim
} catch { } catch {
case e: Exception => case e: Exception =>
log.warn( log.warn(
@ -100,8 +100,8 @@ object BuildInfo {
) )
"HEAD" "HEAD"
} }
val isDirty = !("git status --porcelain" !!).trim.isEmpty val isDirty = "git status --porcelain".!!.trim.nonEmpty
val latestCommitDate = ("git log HEAD -1 --format=%cd" !!).trim val latestCommitDate = "git log HEAD -1 --format=%cd".!!.trim
Some( Some(
GitInformation( GitInformation(
ref = ref, ref = ref,

View File

@ -33,7 +33,7 @@ object LibraryManifestGenerator {
val store = val store =
cacheStoreFactory.make(s"library-manifest-$namespace-$name-$version") cacheStoreFactory.make(s"library-manifest-$namespace-$name-$version")
val sources = (projectPath / "src" allPaths).get val sources = (projectPath / "src").allPaths.get
Tracked.diffInputs(store, FileInfo.hash)(sources.toSet) { diff => Tracked.diffInputs(store, FileInfo.hash)(sources.toSet) { diff =>
def manifestExists = (projectPath / "manifest.yaml").exists() def manifestExists = (projectPath / "manifest.yaml").exists()
if (diff.modified.nonEmpty || !manifestExists) { if (diff.modified.nonEmpty || !manifestExists) {

View File

@ -9,3 +9,5 @@ addSbtPlugin("com.simplytyped" % "sbt-antlr4" % "0.8.3")
libraryDependencies += "io.circe" %% "circe-yaml" % "0.14.2" libraryDependencies += "io.circe" %% "circe-yaml" % "0.14.2"
libraryDependencies += "commons-io" % "commons-io" % "2.12.0" libraryDependencies += "commons-io" % "commons-io" % "2.12.0"
libraryDependencies += "nl.gn0s1s" %% "bump" % "0.1.3" libraryDependencies += "nl.gn0s1s" %% "bump" % "0.1.3"
scalacOptions ++= Seq("-deprecation", "-feature")