Skip to content

Commit

Permalink
Use ctx.attr._scala_provider instead of ..attr.scalalib, run linter
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnj committed Jul 16, 2018
1 parent 16767e3 commit 25db5f6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
17 changes: 9 additions & 8 deletions scala/private/rule_impls.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ def try_to_compile_java_jar(ctx, scala_output, all_srcjars, java_srcs,
providers_of_dependencies = collect_java_providers_of(ctx.attr.deps)
providers_of_dependencies += collect_java_providers_of(
implicit_junit_deps_needed_for_java_compilation)
providers_of_dependencies += collect_java_providers_of([ctx.attr._scalalib])
providers_of_dependencies += collect_java_providers_of(
ctx.attr._scala_provider[_ScalacProvider].default_classpath)
scala_sources_java_provider = _interim_java_provider_for_java_compilation(
scala_output)
providers_of_dependencies += [scala_sources_java_provider]
Expand Down Expand Up @@ -331,13 +332,13 @@ def _compile_or_empty(ctx, manifest, jars, srcjars, buildijar,
sources = [
f for f in ctx.files.srcs if f.basename.endswith(_scala_extension)
] + java_srcs
compile_scala(ctx, ctx.label, ctx.outputs.jar, manifest,
ctx.outputs.statsfile, sources, jars, all_srcjars,
transitive_compile_jars, ctx.attr.plugins,
ctx.attr.resource_strip_prefix, ctx.files.resources,
ctx.files.resource_jars, jars2labels, ctx.attr.scalacopts,
ctx.attr.print_compile_time, ctx.attr.expect_java_output,
ctx.attr.scalac_jvm_flags, ctx.attr._scala_provider[_ScalacProvider])
compile_scala(
ctx, ctx.label, ctx.outputs.jar, manifest, ctx.outputs.statsfile,
sources, jars, all_srcjars, transitive_compile_jars, ctx.attr.plugins,
ctx.attr.resource_strip_prefix, ctx.files.resources,
ctx.files.resource_jars, jars2labels, ctx.attr.scalacopts,
ctx.attr.print_compile_time, ctx.attr.expect_java_output,
ctx.attr.scalac_jvm_flags, ctx.attr._scala_provider[_ScalacProvider])

# build ijar if needed
if buildijar:
Expand Down
3 changes: 2 additions & 1 deletion scala/scala_cross_version.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def extract_major_version_underscore(scala_version):
def default_scala_major_version():
return extract_major_version(default_scala_version())

def scala_mvn_artifact(artifact, major_scala_version = default_scala_major_version()):
def scala_mvn_artifact(artifact,
major_scala_version = default_scala_major_version()):
"""Add scala version to maven artifact"""
gav = artifact.split(":")
groupid = gav[0]
Expand Down
10 changes: 5 additions & 5 deletions specs2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ java_import(
name = "specs2",
jars = [],
exports = [
"@io_bazel_rules_scala_org_scalaz_scalaz_core//:io_bazel_rules_scala_org_scalaz_scalaz_core",
"@io_bazel_rules_scala_org_scalaz_scalaz_effect//:io_bazel_rules_scala_org_scalaz_scalaz_effect",
"@io_bazel_rules_scala_org_specs2_specs2_common//:io_bazel_rules_scala_org_specs2_specs2_common",
"@io_bazel_rules_scala_org_specs2_specs2_core//:io_bazel_rules_scala_org_specs2_specs2_core",
"@io_bazel_rules_scala_org_specs2_specs2_matcher//:io_bazel_rules_scala_org_specs2_specs2_matcher",
"@io_bazel_rules_scala_org_scalaz_scalaz_core",
"@io_bazel_rules_scala_org_scalaz_scalaz_effect",
"@io_bazel_rules_scala_org_specs2_specs2_common",
"@io_bazel_rules_scala_org_specs2_specs2_core",
"@io_bazel_rules_scala_org_specs2_specs2_matcher",
],
deps = [
"//external:io_bazel_rules_scala/dependency/scala/parser_combinators",
Expand Down

0 comments on commit 25db5f6

Please sign in to comment.