Skip to content

Commit

Permalink
[ksp] Rename files during extraction (#1201)
Browse files Browse the repository at this point in the history
  • Loading branch information
restingbull authored Aug 2, 2024
1 parent f14d01e commit 9cfccc3
Showing 1 changed file with 9 additions and 9 deletions.
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

0 comments on commit 9cfccc3

Please sign in to comment.