Bug fixed: Skips generation of ni.dll in the TPA list
authorj-h.choi <j-h.choi@samsung.com>
Mon, 3 Feb 2020 08:17:42 +0000 (17:17 +0900)
committer조웅석/Common Platform Lab(SR)/Principal Engineer/삼성전자 <ws77.cho@samsung.com>
Mon, 3 Feb 2020 23:45:04 +0000 (08:45 +0900)
NativeLauncher/tool/ni_common.cc

index 318cc49..6fc442f 100644 (file)
@@ -546,18 +546,12 @@ void createNiUnderDirs(const std::string rootPaths[], int count, DWORD flags)
        auto convert = [&appPaths, flags, tpaAssemblies](const std::string& path, const char* name) {
                bool isAppNI = flags & NI_FLAGS_APPNI;
                if (isAppNI) {
-                       std::string assembly = path.substr(path.rfind('/') + 1);
-                       bool isExist = false;
                        for (auto& tpa : tpaAssemblies) {
-                               if (!strcmp(replaceAll(tpa, ".ni.dll", ".dll").c_str(), assembly.c_str())) {
-                                       isExist = true;
-                                       break;
+                               if (!strcmp(replaceAll(tpa.substr(tpa.rfind('/') + 1), ".ni.dll", ".dll").c_str(), name)) {
+                                       fprintf(stderr, "%s present in the TPA list skips generation of NI file.\n", name);
+                                       return;
                                }
                        }
-                       if (isExist) {
-                               fprintf(stderr, "%s present in the TPA list skips generation of NI file.\n", path.c_str());
-                               return;
-                       }
                }
                if (!crossgen(path, appPaths.c_str(), flags)) {
                        waitInterval();
@@ -625,21 +619,15 @@ ni_error_e createNiDllUnderPkgRoot(const std::string& pkgId, const std::string&
                std::string assembly = dllPath.substr(dllPath.rfind('/') + 1);
                std::vector<std::string> tpaAssemblies;
                splitPath(__tpa, tpaAssemblies);
-               bool isExist = false;
                for (auto& tpa : tpaAssemblies) {
-                       if (!strcmp(replaceAll(tpa, ".ni.dll", ".dll").c_str(), assembly.c_str())) {
-                               isExist = true;
-                               break;
+                       if (!strcmp(replaceAll(tpa.substr(tpa.rfind('/') + 1), ".ni.dll", ".dll").c_str(), assembly.c_str())) {
+                               fprintf(stderr, "%s present in the TPA list skips generation of NI file.\n", assembly.c_str());
+                               return NI_ERROR_NONE;
                        }
                }
                tpaAssemblies.clear();
-               if (isExist) {
-                       fprintf(stderr, "%s present in the TPA list skips generation of NI file.\n", dllPath.c_str());
-                       return NI_ERROR_NONE;
-               } else {
-                       flags |= NI_FLAGS_APPNI;
-                       return crossgen(dllPath, paths, flags);
-               }
+               flags |= NI_FLAGS_APPNI;
+               return crossgen(dllPath, paths, flags);
        }
 }