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

[ksp] Rename files during extraction #1201

Merged
merged 1 commit into from
Aug 2, 2024
Merged
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
18 changes: 9 additions & 9 deletions src/main/starlark/core/repositories/ksp.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ def _ksp_compiler_plugin_repository_impl(repository_ctx):
repository_ctx.download_and_extract(
attr.urls,
sha256 = attr.sha256,
# Move the jars to the top level and remove verison information.
rename_files = {
"com/google/devtools/ksp/{jar}/{version}/{jar}-{version}.jar".format(
jar = jar,
version = attr.strip_version,
): "{jar}.jar".format(jar = jar)
for jar in _JARS_INSIDE_REPO
},
)

# Move the jars that we need into the root of the workspace and strip the
# version specific information out of the file name.
for jar in _JARS_INSIDE_REPO:
args = [
"mv",
"com/google/devtools/ksp/{jar}/{version}/{jar}-{version}.jar".format(jar = jar, version = attr.strip_version),
"{jar}.jar".format(jar = jar),
]
repository_ctx.execute(args, quiet = False)
# Remove unused .pom and checksum files files.
repository_ctx.delete("com")

repository_ctx.file(
Expand Down