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
10 changes: 2 additions & 8 deletions aspect/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load(":build_defs.bzl", "aspect_files", "aspect_library")
load(":flag_hack.bzl", "define_flag_hack")

licenses(["notice"])

Expand Down Expand Up @@ -42,7 +41,6 @@ aspect_files(
files = [
"artifacts.bzl",
"fast_build_info_bundled.bzl",
"flag_hack.bzl",
"intellij_info_impl_bundled.bzl",
"java_classpath.bzl",
"make_variables.bzl",
Expand Down Expand Up @@ -89,15 +87,13 @@ _dev_aspect_path = package_name()
# This genrule is required for the aspect to be valid in all three repositories in which it's used.
# Changes:
# //.../aspect/tools:tool_name -> //:tool_name_bin
# //.../aspect:flag_hack -> //:flag_hack
# :intellij_info_impl.bzl -> :intellij_info_impl_bundled.bzl
genrule(
name = "modify_tools_path",
srcs = ["intellij_info.bzl"],
outs = ["intellij_info_bundled.bzl"],
cmd = "cat $(SRCS) >$@ && " +
"sed -i -e 's,//%s/tools:\" + tool_name,tools/\" + tool_name,g' $@ && " % _dev_aspect_path +
"sed -i -e 's,//%s:flag_hack,:flag_hack,g' $@ && " % _dev_aspect_path +
"sed -i -e 's,:intellij_info_impl.bzl,:intellij_info_impl_bundled.bzl,g' $@",
)

Expand All @@ -123,11 +119,11 @@ genrule(
"sed -i -e 's,:intellij_info_impl.bzl,:intellij_info_impl_bundled.bzl,g' $@",
)

define_flag_hack()

aspect_library(
name = "aspect_template_lib",
files = [
"cc_info.bzl",
"cc_info.template.bzl",
"code_generator_info.bzl",
"code_generator_info.template.bzl",
"intellij_info.template.bzl",
Expand All @@ -136,8 +132,6 @@ aspect_library(
"java_info.template.bzl",
"python_info.bzl",
"python_info.template.bzl",
"cc_info.bzl",
"cc_info.template.bzl",
],
namespace = "aspect/template",
visibility = ["//visibility:public"],
Expand Down
4 changes: 0 additions & 4 deletions aspect/BUILD.aspect
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@

licenses(["notice"]) # Apache 2.0

load(":flag_hack.bzl", "define_flag_hack")

exports_files([
"tools/PackageParser_deploy.jar",
"tools/CreateAar_deploy.jar",
"tools/JarFilter_deploy.jar",
])

define_flag_hack()
32 changes: 0 additions & 32 deletions aspect/flag_hack.bzl

This file was deleted.

1 change: 0 additions & 1 deletion aspect/intellij_info.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ semantics = struct(
py = struct(
get_launcher = get_py_launcher,
),
flag_hack_label = "//aspect:flag_hack",
)

def _aspect_impl(target, ctx):
Expand Down
18 changes: 3 additions & 15 deletions aspect/intellij_info_impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ load(
"struct_omit_none",
"to_artifact_location",
)
load(":cc_info.bzl", "CC_USE_GET_TOOL_FOR_ACTION")
load(":code_generator_info.bzl", "CODE_GENERATOR_RULE_NAMES")
load(":flag_hack.bzl", "FlagHackInfo")
load(":java_info.bzl", "get_java_info", "java_info_in_target", "java_info_reference", "get_provider_from_target")
load(":java_info.bzl", "get_java_info", "get_provider_from_target", "java_info_in_target", "java_info_reference")
load(
":make_variables.bzl",
"expand_make_variables",
)
load(":python_info.bzl", "get_py_info", "py_info_in_target")
load(":cc_info.bzl", "CC_USE_GET_TOOL_FOR_ACTION")

IntelliJInfo = provider(
doc = "Collected information about the targets visited by the aspect.",
Expand Down Expand Up @@ -320,14 +319,7 @@ def _get_output_mnemonic(ctx):
return ctx.bin_dir.path.split("/")[1]

def _get_python_version(ctx):
if ctx.attr._flag_hack[FlagHackInfo].incompatible_py2_outputs_are_suffixed:
if _get_output_mnemonic(ctx).find("-py2-") != -1:
return PY2
return PY3
else:
if _get_output_mnemonic(ctx).find("-py3-") != -1:
return PY3
return PY2
return PY3

_SRCS_VERSION_MAPPING = {
"PY2": SRC_PY2,
Expand Down Expand Up @@ -1337,7 +1329,6 @@ def semantics_extra_deps(base, semantics, name):
def make_intellij_info_aspect(aspect_impl, semantics, **kwargs):
"""Creates the aspect given the semantics."""
tool_label = semantics.tool_label
flag_hack_label = semantics.flag_hack_label
deps = semantics_extra_deps(DEPS, semantics, "extra_deps")
runtime_deps = RUNTIME_DEPS
prerequisite_deps = semantics_extra_deps(PREREQUISITE_DEPS, semantics, "extra_prerequisites")
Expand All @@ -1353,9 +1344,6 @@ def make_intellij_info_aspect(aspect_impl, semantics, **kwargs):
default = tool_label("JarFilter_deploy.jar"),
allow_single_file = True,
),
"_flag_hack": attr.label(
default = flag_hack_label,
),
"_create_aar": attr.label(
default = tool_label("CreateAar_deploy.jar"),
allow_single_file = True,
Expand Down