Skip to content

Commit a248d1e

Browse files
blorenteAndre Rocha
authored and
Andre Rocha
committed
Fixes to make test_version.sh work (bazel-contrib#1051)
* Fix test_runner.sh path * Add skylib * Change jvm_flags to scalac_jvm_flags * Add more dependencies to WORKSPACE.template * Enable test_version.sh on travis
1 parent 8caddfe commit a248d1e

File tree

4 files changed

+33
-6
lines changed

4 files changed

+33
-6
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ jobs:
5252
env: TEST_SCRIPT=test_rules_scala BAZEL_VERSION=2.0.0
5353
- <<: *linux
5454
env: TEST_SCRIPT=test_reproducibility BAZEL_VERSION=2.0.0
55+
- <<: *linux
56+
env: TEST_SCRIPT=test_version BAZEL_VERSION=2.0.0
5557
- <<: *osx
5658
env: TEST_SCRIPT=test_rules_scala BAZEL_VERSION=2.0.0
5759
- <<: *osx
5860
env: TEST_SCRIPT=test_reproducibility BAZEL_VERSION=2.0.0
61+
- <<: *osx
62+
env: TEST_SCRIPT=test_version BAZEL_VERSION=2.0.0
5963

6064
before_install:
6165
- |

test_version.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ test_scala_version() {
3535

3636
}
3737

38+
if ! bazel_loc="$(type -p 'bazel')" || [[ -z "$bazel_loc" ]]; then
39+
export PATH="$(cd "$(dirname "$0")"; pwd)"/tools:$PATH
40+
echo 'Using ./tools/bazel directly for bazel calls'
41+
fi
42+
3843
dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
3944
# shellcheck source=./test_runner.sh
40-
. "${dir}"/test_runner.sh
45+
. "${dir}"/test/shell/test_runner.sh
4146
runner=$(get_test_runner "${1:-local}")
4247

4348
$runner test_scala_version "2.11.12" \

test_version/WORKSPACE.template

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
workspace(name = "io_bazel_rules_scala_test")
22

3+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4+
5+
# bazel-skylib 0.8.0 released 2019.03.20 (https://github.com/bazelbuild/bazel-skylib/releases/tag/0.8.0)
6+
skylib_version = "0.8.0"
7+
http_archive(
8+
name = "bazel_skylib",
9+
type = "tar.gz",
10+
url = "https://github.com/bazelbuild/bazel-skylib/releases/download/{}/bazel-skylib.{}.tar.gz".format (skylib_version, skylib_version),
11+
sha256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e",
12+
)
13+
314
local_repository(
415
name = "io_bazel_rules_scala",
516
path = "../../"
@@ -30,6 +41,10 @@ load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_reposito
3041

3142
scala_proto_repositories(scala_version)
3243

44+
load("@io_bazel_rules_scala//scala_proto:toolchains.bzl", "scala_proto_register_toolchains")
45+
46+
scala_proto_register_toolchains()
47+
3348
load("@io_bazel_rules_scala//specs2:specs2_junit.bzl", "specs2_junit_repositories")
3449

3550
specs2_junit_repositories(scala_version)
@@ -38,9 +53,12 @@ load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_unused_deps_
3853

3954
scala_register_unused_deps_toolchains()
4055

56+
protobuf_version="3.11.3"
57+
protobuf_version_sha256="cf754718b0aa945b00550ed7962ddc167167bd922b842199eeb6505e6f344852"
58+
4159
http_archive(
4260
name = "com_google_protobuf",
43-
sha256 = "9510dd2afc29e7245e9e884336f848c8a6600a14ae726adb6befdb4f786f0be2",
44-
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.6.1.3.zip"],
45-
strip_prefix = "protobuf-3.6.1.3",
46-
)
61+
url = "https://github.com/protocolbuffers/protobuf/archive/v%s.tar.gz" % protobuf_version,
62+
strip_prefix = "protobuf-%s" % protobuf_version,
63+
sha256 = protobuf_version_sha256,
64+
)

test_version/version_specific_tests_dir/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ scala_library(
107107
srcs = glob(["src/main/scala/scalarules/test/mix_java_scala/*.scala"]) + glob([
108108
"src/main/scala/scalarules/test/mix_java_scala/*.java",
109109
]),
110-
jvm_flags = [
110+
scalac_jvm_flags = [
111111
"-Xms1G",
112112
"-Xmx4G",
113113
],

0 commit comments

Comments
 (0)