0

I am trying to configure bazel with scala.

here is my BUILD file:

load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library", "scala_binary", "scala_test")

scala_binary(
    name = "Main",
    srcs = glob(["app/**/*.scala"]),
    resources = [],
    deps = [],
    main_class = "io.baku.sbzcp.Main",
    visibility = ["//visibility:public"]
)

If I try to do: bazel run //:Main I get an error:

Error: Could not find or load main class io.baku.sbzcp.Main

it will work fine if I will move scala files to scala folder, without package, and remove package name from main_class. Problem is when I want to keep them in package.

Any idea ? Thanks!

1 Answer 1

0

Ah I am blind :) Wrong path in src should be:

srcs = glob(["src/main/scala/**/*.scala"]),

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.