return NI_ERROR_NONE;
}
- ni_error_e status = crossgen(dllPath, std::string(), flags);
-
- return status;
+ return crossgen(dllPath, std::string(), flags);
}
void createNiUnderTAC(std::vector<std::string> nugets, DWORD flags)
}
std::string binDir = concatPath(pkgRoot, "bin");
+ std::string libDir = concatPath(pkgRoot, "lib");
std::string tacDir = concatPath(binDir, TAC_SYMLINK_SUB_DIR);
std::string binNIDir = concatPath(binDir, APP_NI_SUB_DIR);
+ std::string paths = binDir + ":" + libDir + ":" + tacDir;
if (bf::exists(tacDir)) {
try {
for (auto& symlinkAssembly : bf::recursive_directory_iterator(tacDir)) {
std::string originPath = bf::read_symlink(symPath).string();
std::string originNiPath = originPath.substr(0, originPath.rfind(".dll")) + ".ni.dll";
if (!bf::exists(originNiPath)) {
- if(createNiDll(originPath, flags) != NI_ERROR_NONE) {
+ flags |= NI_FLAGS_APPNI;
+ if(crossgen(originPath, paths, flags) != NI_ERROR_NONE) {
fprintf(stderr, "Failed to create NI file [%s]\n", originPath.c_str());
return NI_ERROR_UNKNOWN;
}
fprintf(stderr, "%s symbolic link file generated successfully.\n", symNIPath.c_str());
copySmackAndOwnership(tacDir.c_str(), symNIPath.c_str(), true);
- std::string NIFileName = symNIPath.substr(symNIPath.rfind('/') + 1);
- if (!removeFile(concatPath(binNIDir, NIFileName))) {
- fprintf(stderr, "Failed to remove of %s\n", concatPath(binNIDir, NIFileName).c_str());
- return NI_ERROR_UNKNOWN;
+ std::string niFileName = symNIPath.substr(symNIPath.rfind('/') + 1);
+ if (!removeFile(concatPath(binNIDir, niFileName))) {
+ fprintf(stderr, "Failed to remove of %s\n", concatPath(binNIDir, niFileName).c_str());
}
}
}
std::string binDir = concatPath(pkgRoot, "bin");
std::string libDir = concatPath(pkgRoot, "lib");
std::string tacDir = concatPath(binDir, TAC_SYMLINK_SUB_DIR);
+ std::string binNIDir = concatPath(binDir, APP_NI_SUB_DIR);
std::string paths = binDir + ":" + libDir + ":" + tacDir;
if (bf::is_symlink(dllPath)) {
std::string originPath = bf::read_symlink(dllPath).string();
std::string originNiPath = originPath.substr(0, originPath.rfind(".dll")) + ".ni.dll";
if (!bf::exists(originNiPath)) {
- if(createNiDll(originPath, flags) != NI_ERROR_NONE) {
+ flags |= NI_FLAGS_APPNI;
+ if(crossgen(originPath, paths, flags) != NI_ERROR_NONE) {
fprintf(stderr, "Failed to create NI file [%s]\n", originPath.c_str());
return NI_ERROR_UNKNOWN;
}
fprintf(stderr, "%s symbolic link file generated successfully.\n", setNiPath.c_str());
copySmackAndOwnership(tacDir.c_str(), setNiPath.c_str(), true);
}
+ std::string niFileName = setNiPath.substr(setNiPath.rfind('/') + 1);
+ if (!removeFile(concatPath(binNIDir, niFileName))) {
+ fprintf(stderr, "Failed to remove of %s\n", concatPath(binNIDir, niFileName).c_str());
+ }
}
}
return NI_ERROR_NONE;