ohos: Bundle resource files in hap (#33513)

Bundle resource files into the .hap, so they are available
as files in the application sandbox, instead of included
into the shared library.
This should slightly reduce the binary size in debug and
release mode.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
This commit is contained in:
Jonathan Schwender 2024-09-24 06:29:53 +02:00 committed by GitHub
parent ff86771b48
commit 88ffe9f7a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 77 additions and 21 deletions

View file

@ -194,6 +194,10 @@ class PackageCommands(CommandBase):
print("Cleaning up from previous packaging")
delete(ohos_target_dir)
shutil.copytree(ohos_app_dir, ohos_target_dir)
resources_src_dir = path.join(self.get_top_dir(), "resources")
resources_app_dir = path.join(ohos_target_dir, "AppScope", "resources", "resfile", "servo")
os.makedirs(resources_app_dir, exist_ok=True)
shutil.copytree(resources_src_dir, resources_app_dir, dirs_exist_ok=True)
# Map non-debug profiles to 'release' buildMode HAP.
if build_type.is_custom():