Skip to content

Commit

Permalink
Merge pull request #511 from bazelbuild/binary_build_event_protocol
Browse files Browse the repository at this point in the history
expose scala binary jars in build even protocol
  • Loading branch information
johnynek authored Jun 3, 2018
2 parents 861d4fa + 5340847 commit eeee467
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
1 change: 0 additions & 1 deletion scala/private/rule_impls.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,6 @@ def _scala_binary_common(ctx, cjars, rjars, transitive_compile_time_jars, jars2l
java_provider = create_java_provider(scalaattr, transitive_compile_time_jars)

return struct(
files=depset([ctx.outputs.executable]),
providers = [java_provider],
scala = scalaattr,
transitive_rjars = rjars, #calling rules need this for the classpath in the launcher
Expand Down
33 changes: 32 additions & 1 deletion test_rules_scala.sh
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,34 @@ test_scala_classpath_resources_expect_warning_on_namespace_conflict() {
fi
}

scala_binary_common_jar_is_exposed_in_build_event_protocol() {
local target=$1
set +e
bazel build test:$target --build_event_text_file=$target_bes.txt
cat $target_bes.txt | grep "test/$target.jar"
if [ $? -ne 0 ]; then
echo "test/$target.jar was not found in build event protocol:"
cat $target_bes.txt
rm $target_bes.txt
exit 1
fi

rm $target_bes.txt
set -e
}

scala_binary_jar_is_exposed_in_build_event_protocol() {
scala_binary_common_jar_is_exposed_in_build_event_protocol ScalaLibBinary
}

scala_test_jar_is_exposed_in_build_event_protocol() {
scala_binary_common_jar_is_exposed_in_build_event_protocol HelloLibTest
}

scala_junit_test_jar_is_exposed_in_build_event_protocol() {
scala_binary_common_jar_is_exposed_in_build_event_protocol JunitTestWithDeps
}

dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
# shellcheck source=./test_runner.sh
. "${dir}"/test_runner.sh
Expand Down Expand Up @@ -840,4 +868,7 @@ $runner test_scala_import_library_passes_labels_of_direct_deps
$runner java_toolchain_javacopts_are_used
$runner bazel run test/src/main/scala/scala/test/classpath_resources:classpath_resource
$runner test_scala_classpath_resources_expect_warning_on_namespace_conflict
$runner bazel build //test_expect_failure/proto_source_root/... --strict_proto_deps=off
$runner bazel build //test_expect_failure/proto_source_root/... --strict_proto_deps=off
$runner scala_binary_jar_is_exposed_in_build_event_protocol
$runner scala_test_jar_is_exposed_in_build_event_protocol
$runner scala_junit_test_jar_is_exposed_in_build_event_protocol

0 comments on commit eeee467

Please sign in to comment.