Intellij doesn't recognize code in build.sbt and doesn't compile

Viewed 283

I've tried all the solutions I'd found online:

  • Invalid cache\Restart
  • Uninstall\reinstall Scala plugin
  • force intellij to use the sbt shell
  • Remove .idea and reimport

But intellij doesn't recognize the build.sbt code claiming all in red. The project via terminal sbt compile and run, but intellij doesn't like it. The project contains also gradle. I'm using intellij ultimate.

build.sbt:

import sbt.Keys.{libraryDependencies, publishMavenStyle, _}

scalaVersion := "2.12.13"
organization in ThisBuild := "ai.faire.platform"

githubOwner := "faireai"
githubRepository := "platform-transactions-service-protobuf"
githubTokenSource := TokenSource.Environment("GITHUB_TOKEN")

resolvers += Resolver.githubPackages("faireai")

lazy val protobufDependencies = Seq(
  "com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf"
)

Compile / PB.protoSources := Seq(baseDirectory.value / "src" / "main" / "proto")

lazy val publishSettings = Seq(
  publishMavenStyle := true
)

lazy val `transactions-service-protobuf` = project
  .in(file("."))
  .settings(
    name := "transactions-service-protobuf",
    unmanagedResourceDirectories in Compile += baseDirectory.value / "src" / "main" / "proto",
    libraryDependencies ++= protobufDependencies
  )
  .settings(
    publishArtifact in (Test, packageDoc) := false,
    PB.targets in Compile := Seq(
      PB.gens.java                                            -> (Compile / sourceManaged).value,
      scalapb.gen(flatPackage = true, javaConversions = true) -> (Compile / sourceManaged).value / "proto"
    )
  )
  .settings(publishSettings)

plugin.sbt:

addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")

addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.2")

protoc.sbt:

addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")

addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.2")
0 Answers
Related