Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy aspect files to workspace #7202

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

LeFrosch
Copy link
Collaborator

@LeFrosch LeFrosch commented Dec 20, 2024

Copy all aspects into the workspace instead of using a --override_repository or --inject_repository flag to point to the bundled aspects. This provides some benefits:

  • No more caching problems caused by --override_repository
  • No different logic for Bazel 8, since --inject_repository is also not required

Since aspects need to be copied to the workspace anyway, we can now store them inside the plugin jar. This makes accessing the aspects easier, since they are not in different locations for tests and production.

Also adds aspect writing as a dedicated sync step:
image

@LeFrosch LeFrosch changed the title Copy aspect files to workspace root Copy aspect files to workspace Dec 20, 2024
@LeFrosch LeFrosch force-pushed the aspect-coping branch 2 times, most recently from c65289c to 78d12ee Compare December 25, 2024 23:30
@LeFrosch LeFrosch force-pushed the aspect-coping branch 2 times, most recently from 2fc7bca to e02934b Compare January 7, 2025 13:28
The AspectStorageService is responsible for writing the aspect files into a directory contained in the workspace root. The AspectWriter extension allows to register writers that write individual parts of the aspect to this directory.
@LeFrosch LeFrosch force-pushed the aspect-coping branch 2 times, most recently from 1d8aa3f to 9793dc0 Compare January 13, 2025 19:19
Bazel 5 seems to have problems with relative labels used in the aspect. This also means that the plugin is no longer compatible with Bazel 5.

# Conflicts:
#	MODULE.bazel.lock
@LeFrosch LeFrosch marked this pull request as ready for review January 14, 2025 13:17
@github-actions github-actions bot added product: CLion CLion plugin product: IntelliJ IntelliJ plugin product: GoLand GoLand plugin awaiting-review Awaiting review from Bazel team on PRs labels Jan 14, 2025
Copy link
Collaborator

@mai93 mai93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @LeFrosch! I left some comments. I am not familiar with the template related parts if you would like someone else to review those.

MODULE.bazel Show resolved Hide resolved
aspect/build_defs.bzl Outdated Show resolved Hide resolved
To ensure compatibility when executing the jars during the aspect execution, they have to be built with java 8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review Awaiting review from Bazel team on PRs product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin
Projects
Status: Untriaged
Development

Successfully merging this pull request may close these issues.

5 participants