bazelbuild / rules_scala

Scala rules for Bazel
Apache License 2.0
363 stars 278 forks source link

scalatest 3.x.x support? #275

Open azymnis opened 7 years ago

azymnis commented 7 years ago

Package scio_test depends on scalatest 3.x.x which means that it won't work off the box with scala_test rules. Is there any plan to upgrade this rule to use the new version of scalatest? I could pick it up if no one else is working on it.

johnynek commented 7 years ago

We do this internally this way;

Add these to WORKSPACE

bind(name = 'io_bazel_rules_scala/dependency/scalatest/scalatest', actual = '//3rdparty/jvm/org/scalatest')

In fact we also do this with thrift.

# Here we set up the bindings to the jars the thrift rules need
# this must come after we load all the dependencies
# this replaces what would be called here:
# https://github.com/bazelbuild/rules_scala/blob/692a867a1f65f61c1a92fad6884ee7c414095c82/twitter_scrooge/twitter_scrooge.bzl#L9
bind(name = 'io_bazel_rules_scala/dependency/thrift/libthrift', actual = '@org_apache_thrift_libthrift//jar')
bind(name = 'io_bazel_rules_scala/dependency/thrift/scrooge_core', actual = '@com_twitter_scrooge_core_2_11//jar')
bind(name = 'io_bazel_rules_scala/dependency/thrift/scrooge_generator', actual = '@com_twitter_scrooge_generator_2_11//jar')
bind(name = 'io_bazel_rules_scala/dependency/thrift/util_core', actual = '@com_twitter_util_core_2_11//jar')
bind(name = 'io_bazel_rules_scala/dependency/thrift/util_logging', actual = '@com_twitter_util_logging_2_11//jar')
johnynek commented 7 years ago

which assumes you have set up //3rdparty/jvm/org/scalatest:scalatest as a target (which we do using the bazel-deps tool: https://github.com/johnynek/bazel-deps

azymnis commented 7 years ago

Got it