-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix toolchain registration call for ScalaTest (#1130)
* Fix toolchain registration call for ScalaTest * Use external name in toolchain registration * Add example/integration test for ScalaTest repositories * Use the same skylib version and download it from google mirror * Update rules_go to support 1.0.3 skylib
- Loading branch information
Vaidas Pilkauskas
authored
Oct 30, 2020
1 parent
f9fbf4e
commit 09d6c74
Showing
9 changed files
with
81 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
workspace(name = "scalatest_repositories") | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
skylib_version = "1.0.3" | ||
|
||
http_archive( | ||
name = "bazel_skylib", | ||
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c", | ||
type = "tar.gz", | ||
url = "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{}/bazel-skylib-{}.tar.gz".format(skylib_version, skylib_version), | ||
) | ||
|
||
local_repository( | ||
name = "io_bazel_rules_scala", | ||
path = "../../..", | ||
) | ||
|
||
load("@io_bazel_rules_scala//:version.bzl", "bazel_version") | ||
|
||
bazel_version(name = "bazel_version") | ||
|
||
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories") | ||
|
||
scala_repositories() | ||
|
||
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") | ||
|
||
scala_register_toolchains() | ||
|
||
load("@io_bazel_rules_scala//testing:scalatest.bzl", "scalatest_repositories", "scalatest_toolchain") | ||
|
||
scalatest_repositories() | ||
|
||
scalatest_toolchain() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_test") | ||
|
||
scala_test( | ||
name = "example", | ||
srcs = ["ExampleTest.scala"], | ||
) |
9 changes: 9 additions & 0 deletions
9
examples/testing/scalatest_repositories/example/ExampleTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package examples.testing.scalatest_repositories.example | ||
|
||
import org.scalatest.{FlatSpec, MustMatchers} | ||
|
||
class ExampleTest extends FlatSpec with MustMatchers { | ||
"Exmaple" should "pass" in { | ||
1 must be(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# shellcheck source=./test_runner.sh | ||
dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
. "${dir}"/test_runner.sh | ||
. "${dir}"/test_helper.sh | ||
runner=$(get_test_runner "${1:-local}") | ||
|
||
function scalatest_repositories_example() { | ||
(cd examples/testing/scalatest_repositories; bazel test //...) | ||
} | ||
|
||
$runner scalatest_repositories_example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters