/**
* @brief check the file is managed assembly or not.
* @param[in] file path
- * @return return true when the file is managed assembly.
- * otherwise return false including native image case.
- */
-bool isManagedAssembly(const std::string& filePath);
+ * @return return true when the file is managed assembly even if it includes a native image.
+ */
+bool isManagedAssembly(const std::string& fileName);
/**
* @brief Resolve assembly files from directories and append their paths to the given list.
_SERR("Unknown option %s.", argv[0]);
DisplayUsage();
return -1;
- } else if (isManagedAssembly(arg) || isR2RImage(arg)) {
+ } else if (isManagedAssembly(arg)) {
if (!isFile(arg)) {
_SERR("The specified file does not exist.");
return -1;
{
bool ret = false;
auto func = [&ret](const std::string& f_path, const std::string& f_name) {
- if (isManagedAssembly(f_name) || isR2RImage(f_name)) {
+ if (isManagedAssembly(f_name)) {
ret = true;
}
};
}
auto func = [&fileList, opt](const std::string& f_path, const std::string& f_name) {
- if (isManagedAssembly(f_path) && !checkNIExistence(f_path, opt)) {
+ if (isManagedAssembly(f_name) && !checkNIExistence(f_path, opt)) {
fileList.push_back(getAbsolutePath(f_path));
}
};
bool isManagedAssembly(const std::string& fileName)
{
- return iCompare(fileName, fileName.size()-4, ".dll", 0, 4) && !isR2RImage(fileName);
+ return iCompare(fileName, fileName.size()-4, ".dll", 0, 4);
}
std::string concatPath(const std::string& path1, const std::string& path2)
std::unordered_map<std::string, std::string> assemPaths;
auto reader = [&assems, &assemPaths](const std::string& path, const std::string& filename) {
- if (isManagedAssembly(filename) || isR2RImage(filename)) {
+ if (isManagedAssembly(filename)) {
std::string assem = getAssemblyNameFromPath(filename);
if (assemPaths.count(assem) == 0) {
assems.push_back(assem);
assemPaths[assem] = path;
- } else if (isManagedAssembly(assemPaths[assem]) && isR2RImage(filename)) {
+ } else if (isR2RImage(path)) {
// Update only if a native image is found in the same directory.
// For example, if we have two directories = { X, Y } where X contains A.dll and
// Y contains both A.dll and A.ni.dll, always A.dll in X will be used.