From b1ca38576e49c0b66de7f52c3555860fc72c8f5c Mon Sep 17 00:00:00 2001 From: Woongsuk Cho Date: Thu, 18 Jul 2024 15:14:25 +0900 Subject: [PATCH] Skip AOT in plugin when pkg contains ni files --- NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc b/NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc index a2e3659..68b3d91 100644 --- a/NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc +++ b/NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc @@ -68,6 +68,15 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_INSTALL(const char *pkgId, const char *app iter = g_list_next(iter); } + // if package contains native image, skip AOT. + std::string rootPath = getRootPath(pkgId); + if (!rootPath.empty()) { + if (exist(concatPath(rootPath, concatPath("bin", APP_NI_SUB_DIR)))) { + _INFO("Package already contains native images. Skip native image generation"); + doAOT = false; + } + } + if (doAOT) { _DBG("Prefer dotnet application AOT set TRUE"); -- 2.7.4