Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n committed Oct 9, 2024
1 parent 60da585 commit 4da9b00
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ jobs:
- shell: bash
run: |
sbt -v clean compile || true
sleep 1
sbt -v clean compile || true
sleep 1
sbt -v clean test scripted
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ lazy val root = (project in file("."))
scalacOptions := {
scalaBinaryVersion.value match {
case "2.12" => Seq("-Xsource:3", "-Xfatal-warnings", "-unchecked", "-deprecation", "-feature", "-language:implicitConversions")
case _ => Seq("-Vdebug")
case _ => Seq("-Vdebug", "-feature", "-deprecation", "-unchecked")
}
},
scalacOptions += "-language:experimental.macros",
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala-3/sbtbuildinfo/BuildInfoKey.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sbt.*
import scala.reflect.ClassTag
import scala.quoted.*

type BuildInfoKey = Entry[?]
// type BuildInfoKey = Entry[?]
object BuildInfoKey:
inline def apply[A1](inline key: SettingKey[A1]): Entry[A1] =
${ entrySetting('key) }
Expand Down
9 changes: 5 additions & 4 deletions src/main/scala-3/sbtbuildinfo/PluginCompat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sbtbuildinfo

import java.nio.file.{ Path => NioPath }
import sbt.*
import scala.annotation.nowarn
import xsbti.{ FileConverter, HashedVirtualFileRef, VirtualFile }

object PluginCompat:
Expand All @@ -20,10 +21,10 @@ object PluginCompat:
cp.map((x) => Attributed.blank(conv.toVirtualFile(x)))

trait BuildInfoKeys0:
inline given [A1]: Conversion[SettingKey[A1], Entry[A1]] = BuildInfoKey(_)
inline given [A1]: Conversion[TaskKey[A1], Entry[A1]] = BuildInfoKey(_)
inline given [A1]: Conversion[sbt.Task[A1], Entry[A1]] = Entry.TaskValue[A1](_)
inline given [A1]: Conversion[(String, A1), Entry[A1]] = BuildInfoKey(_)
@nowarn inline given [A1]: Conversion[SettingKey[A1], Entry[A1]] = BuildInfoKey(_)
@nowarn inline given [A1]: Conversion[TaskKey[A1], Entry[A1]] = BuildInfoKey(_)
@nowarn inline given [A1]: Conversion[sbt.Task[A1], Entry[A1]] = Entry.TaskValue[A1](_)
@nowarn inline given [A1]: Conversion[(String, A1), Entry[A1]] = BuildInfoKey(_)
end BuildInfoKeys0

object BuildInfoKeys0 extends BuildInfoKeys0
Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/sbtbuildinfo/BuildInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import PluginCompat.*
case class BuildInfoResult(identifier: String, value: Any, typeExpr: TypeExpression)

object BuildInfo {
type BuildInfoKey = Entry[?]

def apply(dir: File, renderer: BuildInfoRenderer, obj: String,
keys: Seq[BuildInfoKey], options: Seq[BuildInfoOption],
proj: ProjectRef, state: State, cacheDir: File): Task[File] =
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/sbtbuildinfo/BuildInfoPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object BuildInfoPlugin extends AutoPlugin {

object autoImport extends BuildInfoKeys with PluginCompat.BuildInfoKeys0 {
val BuildInfoKey = sbtbuildinfo.BuildInfoKey
type BuildInfoKey = sbtbuildinfo.BuildInfoKey
type BuildInfoKey = Entry[?]
val BuildInfoOption = sbtbuildinfo.BuildInfoOption
type BuildInfoOption = sbtbuildinfo.BuildInfoOption
val BuildInfoType = sbtbuildinfo.BuildInfoType
Expand Down

0 comments on commit 4da9b00

Please sign in to comment.