Skip to content

Commit

Permalink
Fix broken MacroParameters on Scala 3 (#2066)
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-kai authored Feb 20, 2024
1 parent cf5be0a commit 11cb812
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ import scala.quoted.{Expr, Quotes, Type}

object MacroParameters {

def scalaVersion(): Option[String] = macroSetting("scala-version")
def scalaCrossVersions(): Option[String] = macroSetting("scala-versions")
inline def scalaVersion(): Option[String] = macroSetting("scala-version")
inline def scalaCrossVersions(): Option[String] = macroSetting("scala-versions")

def projectGroupId(): Option[String] = macroSetting("product-group")
def artifactVersion(): Option[String] = macroSetting("product-version")
def artifactName(): Option[String] = macroSetting("product-name")
inline def projectGroupId(): Option[String] = macroSetting("product-group")
inline def artifactVersion(): Option[String] = macroSetting("product-version")
inline def artifactName(): Option[String] = macroSetting("product-name")

def sbtVersion(): Option[String] = macroSetting("sbt-version")
def scalatestVersion(): Option[String] = macroSetting("scalatest-version")
inline def sbtVersion(): Option[String] = macroSetting("sbt-version")
inline def scalatestVersion(): Option[String] = macroSetting("scalatest-version")

def gitRepoClean(): Option[Boolean] = macroSettingBool("git-repo-clean")
def gitBranch(): Option[String] = macroSetting("git-branch")
def gitHeadCommit(): Option[String] = macroSetting("git-head-commit")
def gitDescribedVersion(): Option[String] = macroSetting("git-described-version")
inline def gitRepoClean(): Option[Boolean] = macroSettingBool("git-repo-clean")
inline def gitBranch(): Option[String] = macroSetting("git-branch")
inline def gitHeadCommit(): Option[String] = macroSetting("git-head-commit")
inline def gitDescribedVersion(): Option[String] = macroSetting("git-described-version")

def sbtIsInsideCI(): Option[Boolean] = macroSettingBool("is-ci")
inline def sbtIsInsideCI(): Option[Boolean] = macroSettingBool("is-ci")

inline def macroSetting(inline name: String): Option[String] = {
${ MacroParametersImpl.extractString('{ name }) }
Expand Down

0 comments on commit 11cb812

Please sign in to comment.