aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2024-04-12 13:06:01 -0700
committerDan Albert <danalbert@google.com>2024-04-12 13:06:01 -0700
commit96187863ec87f9d35b45cc5d041cd851a232584b (patch)
tree7cdf8c07ce856b0900a0746df10b80a93efcffbe
parent54ca59cde4cbd9ab5b88d25161541099718575f9 (diff)
downloadndk-96187863ec87f9d35b45cc5d041cd851a232584b.tar.gz
Add install path info to the source.properties.
ADRT used to have some explicit mangling of the Pkg.Revision to remove this extra data. I have no idea why that was done, as it makes the install path worse, but we have to remain compatible with it. The new release tooling doesn't do that mangling (nor should it!), so set the install path explicitly here. Bug: http://b/333988131#comment7 Test: inspected source.properties after build Change-Id: Iedd27a0d275d50f0ee312f1c7a8587a7f761e153
-rwxr-xr-xndk/checkbuild.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/ndk/checkbuild.py b/ndk/checkbuild.py
index c3ac9b979..7eef1a80e 100755
--- a/ndk/checkbuild.py
+++ b/ndk/checkbuild.py
@@ -1935,14 +1935,25 @@ class SourceProperties(ndk.builds.Module):
# manager UI in Android Studio will use as the display name and categorization,
# so the formats of those should not change.
#
+ # Pkg.Path determines the install location within the SDK directory when
+ # installed by the SDK manager. ndk;1.2.3 will install to
+ # $SDK/ndk/1.2.3. AGP expects the NDK to be installed to
+ # ndk/$MAJOR.$HOTFIX.$BUILD, so we cannot improve on the name of this
+ # directory by, say, using the correct name or indicating beta/RC
+ # status.
+ #
# The rest is up to us. We can add new fields that can be used in the release
# configs. Pkg.ReleaseName, for example, is used to populate that portion of the
# name of the zip file produced by the release.
+ version_number = (
+ f"{ndk.config.major}.{ndk.config.hotfix}.{self.context.build_number}"
+ )
path.write_text(
textwrap.dedent(
f"""\
Pkg.Desc = Android NDK
Pkg.Revision = {version}
+ Pkg.Path = ndk;{version_number}
Pkg.ReleaseName = {ndk.config.release}
"""
)