aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/ide
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-12-05 10:14:43 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-12-05 10:22:16 +0000
commitc9e363c674e4a9cd2422e80da2636f6620798fcb (patch)
treeb152212972c9d1d9d5e3f8bca73b34ccd77cca57 /tools/ide
parentb3dc4cc13cd99f919075c36547a00a5475daed7a (diff)
*** Reason for rollback *** Broke ci.bazel.io See http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=HEAD-jdk7,PLATFORM_NAME=linux-x86_64/379/console for error log. See https://cr.bazel.build/7610/ for tests that confirm fix. *** Original change description *** Pass isExternal field to blaze ide info proto -- Change-Id: Ieff9fbc719ea7baf8321bf50570fae5f7d6c7fdd Reviewed-on: https://cr.bazel.build/7610 PiperOrigin-RevId: 141029777 MOS_MIGRATED_REVID=141029777
Diffstat (limited to 'tools/ide')
-rw-r--r--tools/ide/intellij_info.bzl31
1 files changed, 4 insertions, 27 deletions
diff --git a/tools/ide/intellij_info.bzl b/tools/ide/intellij_info.bzl
index d4b69eb425..12ef9cd0ad 100644
--- a/tools/ide/intellij_info.bzl
+++ b/tools/ide/intellij_info.bzl
@@ -67,34 +67,12 @@ def artifact_location(file):
"""Creates an ArtifactLocation proto from a File."""
if file == None:
return None
-
return struct_omit_none(
- relative_path = get_relative_path(file),
+ relative_path = file.short_path,
is_source = file.is_source,
- is_external = is_external(file.owner),
root_execution_path_fragment = file.root.path if not file.is_source else None,
)
-def is_external(label):
- """Determines whether a label corresponds to an external artifact."""
- return label.workspace_root.startswith("external")
-
-def get_relative_path(artifact):
- """A temporary workaround to find the root-relative path from an artifact.
-
- This is required because 'short_path' is incorrect for external source artifacts.
-
- Args:
- artifact: the input artifact
- Returns:
- string: the root-relative path for this artifact.
- """
- # TODO(bazel-team): remove this workaround when Artifact::short_path is fixed.
- if artifact.is_source and is_external(artifact.owner) and artifact.short_path.startswith(".."):
- # short_path is '../repo_name/path', we want 'external/repo_name/path'
- return "external" + artifact.short_path[2:]
- return artifact.short_path
-
def source_directory_tuple(resource_file):
"""Creates a tuple of (source directory, is_source, root execution path)."""
return (
@@ -116,12 +94,11 @@ def all_unique_source_directories(resources):
root_execution_path_fragment = root_execution_path_fragment)
for (relative_path, is_source, root_execution_path_fragment) in source_directory_tuples]
-def build_file_artifact_location(ctx):
+def build_file_artifact_location(build_file_path):
"""Creates an ArtifactLocation proto representing a location of a given BUILD file."""
return struct(
- relative_path = ctx.build_file_path,
+ relative_path = build_file_path,
is_source = True,
- is_external = is_external(ctx.label)
)
def library_artifact(java_output):
@@ -585,7 +562,7 @@ def _aspect_impl(target, ctx):
kind_string = ctx.rule.kind,
dependencies = list(compiletime_deps),
runtime_deps = list(runtime_deps),
- build_file_artifact_location = build_file_artifact_location(ctx),
+ build_file_artifact_location = build_file_artifact_location(ctx.build_file_path),
c_ide_info = c_ide_info,
c_toolchain_ide_info = c_toolchain_ide_info,
java_ide_info = java_ide_info,