diff --git a/.travis.yml b/.travis.yml index 68f173423..79d47e914 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,19 +49,19 @@ jobs: env: TEST_SCRIPT=test_lint # Test - <<: *linux - env: TEST_SCRIPT=test_rules_scala BAZEL_VERSION=0.28.1 + env: TEST_SCRIPT=test_rules_scala BAZEL_VERSION=1.1.0 - <<: *linux env: TEST_SCRIPT=test_rules_scala BAZEL_VERSION=2.0.0 - <<: *linux - env: TEST_SCRIPT=test_reproducibility BAZEL_VERSION=0.28.1 + env: TEST_SCRIPT=test_reproducibility BAZEL_VERSION=1.1.0 - <<: *linux env: TEST_SCRIPT=test_reproducibility BAZEL_VERSION=2.0.0 - <<: *osx - env: TEST_SCRIPT=test_rules_scala BAZEL_VERSION=0.28.1 + env: TEST_SCRIPT=test_rules_scala BAZEL_VERSION=1.1.0 - <<: *osx env: TEST_SCRIPT=test_rules_scala BAZEL_VERSION=2.0.0 - <<: *osx - env: TEST_SCRIPT=test_reproducibility BAZEL_VERSION=0.28.1 + env: TEST_SCRIPT=test_reproducibility BAZEL_VERSION=1.1.0 - <<: *osx env: TEST_SCRIPT=test_reproducibility BAZEL_VERSION=2.0.0 diff --git a/scala/private/phases/phase_final.bzl b/scala/private/phases/phase_final.bzl index 565cccb5c..04d0a6720 100644 --- a/scala/private/phases/phase_final.bzl +++ b/scala/private/phases/phase_final.bzl @@ -4,32 +4,32 @@ # DOCUMENT THIS # def phase_binary_final(ctx, p): - return struct( + defaultInfo = DefaultInfo( executable = p.declare_executable, - coverage = p.compile.coverage, files = depset([p.declare_executable, ctx.outputs.jar]), - instrumented_files = p.compile.coverage.instrumented_files, - providers = [p.compile.merged_provider, p.collect_jars.jars2labels] + p.compile.coverage.providers, runfiles = p.runfiles.runfiles, - transitive_rjars = p.compile.rjars, #calling rules need this for the classpath in the launcher + ) + return struct( + providers = [defaultInfo, p.compile.merged_provider, p.collect_jars.jars2labels] + p.compile.coverage.providers, ) def phase_library_final(ctx, p): - return struct( + defaultInfo = DefaultInfo( files = depset([ctx.outputs.jar] + p.compile.full_jars), # Here is the default output - instrumented_files = p.compile.coverage.instrumented_files, - jars_to_labels = p.collect_jars.jars2labels, - providers = [p.compile.merged_provider, p.collect_jars.jars2labels] + p.compile.coverage.providers, runfiles = p.runfiles.runfiles, ) + return struct( + providers = [defaultInfo, p.compile.merged_provider, p.collect_jars.jars2labels] + p.compile.coverage.providers, + ) def phase_scalatest_final(ctx, p): coverage_runfiles = p.coverage_runfiles.coverage_runfiles coverage_runfiles.extend(p.write_executable) - return struct( + defaultInfo = DefaultInfo( executable = p.declare_executable, files = depset([p.declare_executable, ctx.outputs.jar]), - instrumented_files = p.compile.coverage.instrumented_files, - providers = [p.compile.merged_provider, p.collect_jars.jars2labels] + p.compile.coverage.providers, runfiles = ctx.runfiles(coverage_runfiles, transitive_files = p.runfiles.runfiles.files), ) + return struct( + providers = [defaultInfo, p.compile.merged_provider, p.collect_jars.jars2labels] + p.compile.coverage.providers, + ) diff --git a/scala/private/rule_impls.bzl b/scala/private/rule_impls.bzl index a67ed814f..b5f0411b8 100644 --- a/scala/private/rule_impls.bzl +++ b/scala/private/rule_impls.bzl @@ -40,7 +40,7 @@ _scala_extension = ".scala" _srcjar_extension = ".srcjar" _empty_coverage_struct = struct( - instrumented_files = struct(), + instrumented_files = None, providers = [], replacements = {}, ) @@ -871,14 +871,14 @@ def _jacoco_offline_instrument(ctx, input_jar): provider = _coverage_replacements_provider.create( replacements = replacements, ) - + instrumented_files_provider = coverage_common.instrumented_files_info( + ctx, + source_attributes = ["srcs"], + dependency_attributes = _coverage_replacements_provider.dependency_attributes, + extensions = ["scala", "java"], + ) return struct( - instrumented_files = struct( - dependency_attributes = _coverage_replacements_provider.dependency_attributes, - extensions = ["scala", "java"], - source_attributes = ["srcs"], - ), - providers = [provider], + providers = [provider, instrumented_files_provider], replacements = replacements, )