git - 来自 github PR (ScalaNative) 的 sbt scala 插件失败,未找到值

标签 git scala github sbt scala-native

如果我需要使用稳定版,我的 project/plugins.sbt 如下:

addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0")

我正在尝试为我的项目使用特定版本(准确地说是 PR)的 ScalaNative。

这是我的build.sbt

scalaVersion := "2.13.4"


// Set to false or remove if you want to show stubs as linking errors
nativeLinkStubs := true

enablePlugins(ScalaNativePlugin)

这是我的项目/plugins.sbt

lazy val root = (project in file(".")).dependsOn(scalaNativePlugin)
lazy val scalaNativePlugin = RootProject(uri("https://github.com/scala-native/scala-native.git#v0.4.0"))

当我运行 sbt 时,它失败并显示以下错误日志。

[info] welcome to sbt 1.4.6 (Oracle Corporation Java 1.8.0_292)
[info] loading global plugins from /home/sadique/.sbt/1.0/plugins
[info] loading settings for project root from plugins.sbt ...
[info] loading settings for project scala-native-build from build.sbt ...
[info] loading project definition from /home/sadique/.sbt/1.0/staging/5c4ed83a83573e9369a0/scala-native/project
[info] loading settings for project scala-native from build.sbt ...
[info] resolving key references (24414 settings) ...
[info] loading project definition from /home/sadique/Programming/scala/scala-native-template/sn-test-custom/project
/home/sadique/Programming/scala/scala-native-template/sn-test-custom/build.sbt:6: error: not found: value ScalaNativePlugin
enablePlugins(ScalaNativePlugin)
              ^
[error] Type error in expression
[warn] Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? (default: r)

我已经尝试在 scalaNativePlugin 中使用大写和小写 S 作为 plugins.sbt 中的变量名。

我做错了什么?执行此操作的正确方法是什么?

最佳答案

作为解决方法,我可能建议在本地构建 Scala Native,只需 fork github 项目, rebase 到预期的分支/PR,运行 sbt 并使用 publishLocal 命令,如果你想获得 Scala 2.11 或 2.13 artifacts 请记住使用 ++SCALA_VERSION 切换使用的 Scala 版本,因为 sbt 假定 Scala 2.12.x 为默认版本。 当前构建的版本可以在 nir/src/main/scala/scala/scalanative/nir/Versions.scala 中找到,目前是 0.4.1-SNAPSHOT。您可以在创建本地工件或对其进行调整后在您的项目中使用它。

关于git - 来自 github PR (ScalaNative) 的 sbt scala 插件失败,未找到值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68161110/

相关文章:

git - SmartGIT 不要求 ssh key

git - 如何在 Sourcetree 中进行 Git Rebase?

scala - 在加载语句中期望 StringLiteral 接近 'inpath'

github - 无法在 github 上创建存储库

version-control - 我的 GitHub SSH key 应该是什么?

Git merge 分支到master

git - 为什么 git log/status 不返回任何输出?

java - Apache ServiceMix 7,ScalaDSL,未找到方案 : jetty 的组件

scala - 我可以使用 SBT 从其目录中组装一个子项目吗?

git - 从 git 历史记录中删除敏感数据但不删除文件