Skip to content

Remove providers #914

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

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
24 changes: 12 additions & 12 deletions scala/private/phases/phase_final.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
16 changes: 8 additions & 8 deletions scala/private/rule_impls.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ _scala_extension = ".scala"
_srcjar_extension = ".srcjar"

_empty_coverage_struct = struct(
instrumented_files = struct(),
instrumented_files = None,
providers = [],
replacements = {},
)
Expand Down Expand Up @@ -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,
)

Expand Down