Skip to content

Commit

Permalink
attempt to fix aspect test
Browse files Browse the repository at this point in the history
  • Loading branch information
xuansontrinh committed Oct 4, 2024
1 parent 1443a2a commit ea0279c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
7 changes: 7 additions & 0 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ load("@io_bazel_rules_scala//testing:scalatest.bzl", "scalatest_repositories", "
scalatest_repositories()

scalatest_toolchain()

load("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository")

local_repository(
name = "intellij_aspect_template",
path = "aspect_template"
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ java_binary(
srcs = ["BazelInvokingIntegrationTestRunner.java"],
data = [
"//aspect:aspect_files",
"//aspect_template:aspect_files",
],
main_class = "com.google.idea.blaze.aspect.integration.BazelInvokingIntegrationTestRunner",
deps = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ public static void main(String[] a) throws Exception {
"%s=%s/%s/aspect",
AspectRepositoryProvider.OVERRIDE_REPOSITORY_FLAG,
System.getenv("TEST_SRCDIR"),
System.getenv("TEST_WORKSPACE")));
System.getenv("TEST_WORKSPACE")),
String.format(
"%s=%s/%s/aspect_template",
AspectRepositoryProvider.OVERRIDE_REPOSITORY_TEMPLATE_FLAG,
System.getenv("TEST_SRCDIR"),
System.getenv("TEST_WORKSPACE"))
);

if (bazelVersion.isAtLeast(6, 0, 0)
&& !aspectFlags.contains(
Expand Down
20 changes: 19 additions & 1 deletion aspect_template/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
filegroup(
name = "aspect_files",
srcs = glob(["**"]),
srcs = [
"WORKSPACE",
"BUILD.bazel",
"java_info.bzl",
],
visibility = ["//visibility:public"],
)

genrule(
name = "rename_files",
srcs = ["BUILD.aspect"],
outs = ["BUILD.bazel"],
cmd = "cp $< $@",
)

genrule(
name = "create_workspace_file",
outs = ["WORKSPACE"],
srcs = [],
cmd = r"""echo 'workspace(name = "intellij_aspect_template")' > $@"""
)

0 comments on commit ea0279c

Please sign in to comment.