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();
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);
}
}