Skip to content
Merged
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
5 changes: 5 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ load("//scala:scala_cross_version.bzl", "default_scala_major_version", "scala_mv

MAVEN_SERVER_URLS = default_maven_server_urls()

# needed for the cross repo proto test
load("//test/proto_cross_repo_boundary:repo.bzl", "proto_cross_repo_boundary_repository")

proto_cross_repo_boundary_repository()

# test adding a scala jar:
jvm_maven_import_external(
name = "com_twitter__scalding_date",
Expand Down
3 changes: 2 additions & 1 deletion scala/private/resources.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def _target_path_by_strip_prefix(resource, resource_strip_prefix):
# Start from absolute resource path and then strip roots so we get to correct short path
# resource.short_path sometimes give weird results ie '../' prefix
path = resource.path
path = _strip_prefix(path, resource.owner.workspace_root + "/")
if resource_strip_prefix != resource.owner.workspace_root:
path = _strip_prefix(path, resource.owner.workspace_root + "/")
path = _strip_prefix(path, resource.root.path + "/")

# proto_library translates strip_import_prefix to proto_source_root which includes root so we have to strip it
Expand Down
7 changes: 7 additions & 0 deletions test/proto_cross_repo_boundary/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scalapb_proto_library")

scalapb_proto_library(
name = "sample_scala_proto",
visibility = ["//visibility:public"],
deps = ["@proto_cross_repo_boundary//:sample_proto"],
)
6 changes: 6 additions & 0 deletions test/proto_cross_repo_boundary/repo.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def proto_cross_repo_boundary_repository():
native.new_local_repository(
name = "proto_cross_repo_boundary",
path = "test/proto_cross_repo_boundary/repo",
build_file = "test/proto_cross_repo_boundary/repo/BUILD.repo",
)
5 changes: 5 additions & 0 deletions test/proto_cross_repo_boundary/repo/BUILD.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
proto_library(
name = "sample_proto",
srcs = ["sample.proto"],
visibility = ["//visibility:public"],
)
9 changes: 9 additions & 0 deletions test/proto_cross_repo_boundary/repo/sample.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
syntax = "proto3";

package sample;

option java_package = "sample";

message Sample {
repeated string foobar = 1;
}