From: 최종헌/Common Platform Lab(SR)/Engineer/삼성전자 Date: Mon, 29 Jun 2020 21:52:29 +0000 (+0900) Subject: Seperate the pluginDir and extraDir from the path manager (#252) X-Git-Tag: accepted/tizen/unified/20200630.131320~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb3374a3902c4a9a3539b16161c39e877a896c5d;p=platform%2Fcore%2Fdotnet%2Flauncher.git Seperate the pluginDir and extraDir from the path manager (#252) Change-Id: If710a702feaaa4e1e9047c346c9a656920dcb921 --- diff --git a/NativeLauncher/util/path_manager.cc b/NativeLauncher/util/path_manager.cc index 3d73528..d89b84e 100644 --- a/NativeLauncher/util/path_manager.cc +++ b/NativeLauncher/util/path_manager.cc @@ -37,7 +37,8 @@ typedef struct DllPath { std::string runtime_dir; std::string tizenfx_dir; std::string tizenfx_ref_dir; - std::vector extra_dirs; + std::vector extra_dirs; + std::vector plugin_dirs; } DllPath; static DllPath* __dllPath = nullptr; @@ -82,11 +83,11 @@ int initializePathManager(const std::string& runtimeDir, const std::string& tize // ":" seperated extra directories if (!extraDir.empty()) { splitPath(extraDir, __dllPath->extra_dirs); - } else { - char* extraPath = pluginGetDllPath(); - if (extraPath) { - splitPath(extraPath, __dllPath->extra_dirs); - } + } + + char* pluginPath = pluginGetDllPath(); + if (pluginPath) { + splitPath(pluginPath, __dllPath->plugin_dirs); } _INFO("Path manager initialize success"); @@ -97,6 +98,7 @@ int initializePathManager(const std::string& runtimeDir, const std::string& tize void finalizePathManager() { + _INFO("Path manager finalize called"); if (__dllPath) { delete __dllPath; __dllPath = NULL; @@ -120,11 +122,16 @@ std::string getTizenFXRefDir() return __dllPath->tizenfx_ref_dir; } -std::vector getExtraDirs() +std::vector getExtraDirs() { return __dllPath->extra_dirs; } +std::vector getPluginDirs() +{ + return __dllPath->plugin_dirs; +} + static std::string getPlatformTPA() { std::string platform_tpa; @@ -137,6 +144,7 @@ static std::string getPlatformTPA() cacheFile.close(); } else { std::vector tpaDirs = { getRuntimeDir(), getTizenFXDir(), getTizenFXRefDir() }; + tpaDirs.insert(tpaDirs.end(), getExtraDirs().begin(), getExtraDirs().end()); addAssembliesFromDirectories(tpaDirs, platform_tpa); } @@ -146,14 +154,13 @@ static std::string getPlatformTPA() static std::string getPluginTPA() { std::string plugin_tpa; - char* plugin_tpa_list = pluginGetTPA(); if (plugin_tpa_list) { _INFO("plugin TPA list found. use TPA list for plugin"); plugin_tpa = plugin_tpa_list; - } else if (!__dllPath->extra_dirs.empty()) { - _INFO("plugin extra directory found. use plugin extra directroy for TPA"); - addAssembliesFromDirectories(__dllPath->extra_dirs, plugin_tpa); + } else if (!getPluginDirs().empty()) { + _INFO("Plugin directory found. use plugin directroy for TPA"); + addAssembliesFromDirectories(getPluginDirs(), plugin_tpa); } return plugin_tpa;