-
-
Notifications
You must be signed in to change notification settings - Fork 286
Specs2 toolchain #1136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specs2 toolchain #1136
Changes from 8 commits
ee7a6da
05d6b3b
181ca23
a7d6005
550e5c0
66f188b
445df2e
14f3d6c
638da03
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
workspace(name = "specs2_junit_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//:scala_config.bzl", "scala_config") | ||
|
||
scala_config() | ||
|
||
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:specs2_junit.bzl", "specs2_junit_repositories", "specs2_junit_toolchain") | ||
|
||
specs2_junit_repositories() | ||
|
||
specs2_junit_toolchain() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_specs2_junit_test") | ||
|
||
scala_specs2_junit_test( | ||
name = "example", | ||
srcs = ["Specs2ExampleTest.scala"], | ||
suffixes = ["Test"], | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package example | ||
|
||
import org.specs2.mutable.SpecWithJUnit | ||
|
||
class Specs2ExampleTest extends SpecWithJUnit { | ||
"works" in { | ||
1 mustEqual 1 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
test_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/test/shell | ||
|
||
. "${test_dir}"/test_examples.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ scala_testing_toolchain( | |
dep_providers = [ | ||
":junit_classpath_provider", | ||
":scalatest_classpath_provider", | ||
":specs2_classpath_provider", | ||
":specs2_junit_classpath_provider", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
@@ -32,6 +34,23 @@ toolchain( | |
visibility = ["//visibility:public"], | ||
) | ||
|
||
scala_testing_toolchain( | ||
name = "specs2_junit_toolchain_impl", | ||
dep_providers = [ | ||
":junit_classpath_provider", | ||
":specs2_classpath_provider", | ||
":specs2_junit_classpath_provider", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
toolchain( | ||
name = "specs2_junit_toolchain", | ||
toolchain = ":specs2_junit_toolchain_impl", | ||
toolchain_type = "@io_bazel_rules_scala//testing/toolchain:testing_toolchain_type", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
scala_testing_toolchain( | ||
name = "junit_toolchain_impl", | ||
dep_providers = [ | ||
|
@@ -66,3 +85,24 @@ declare_deps_provider( | |
"//external:io_bazel_rules_scala/dependency/scala/scalatest/scalatest", | ||
], | ||
) | ||
|
||
declare_deps_provider( | ||
name = "specs2_classpath_provider", | ||
deps_id = "specs2_classpath", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"@io_bazel_rules_scala_org_specs2_specs2_common", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why all other deps are in form There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It comes from the existing code: https://github.com/bazelbuild/rules_scala/blob/master/specs2/BUILD#L9 It's binded later in https://github.com/bazelbuild/rules_scala/blob/master/specs2/specs2.bzl#L26 Existing binds are subject to be removed later. Currently the goal is to give a way to not use binds. |
||
"@io_bazel_rules_scala_org_specs2_specs2_core", | ||
"@io_bazel_rules_scala_org_specs2_specs2_fp", | ||
"@io_bazel_rules_scala_org_specs2_specs2_matcher", | ||
], | ||
) | ||
|
||
declare_deps_provider( | ||
name = "specs2_junit_classpath_provider", | ||
deps_id = "specs2_junit_classpath", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//external:io_bazel_rules_scala/dependency/specs2/specs2_junit", | ||
], | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
load("//specs2:specs2_junit.bzl", _repositories = "specs2_junit_repositories") | ||
|
||
def specs2_junit_repositories(): | ||
_repositories() | ||
|
||
def specs2_junit_toolchain(): | ||
native.register_toolchains("@io_bazel_rules_scala//testing:specs2_junit_toolchain") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for catching - fixed