std::string pkg = std::string(*it);
// if there is AOTed dlls under package root, that is skiped.
int ret = createNiUnderPkgRoot(pkg, flags);
- if (ret == NI_ERROR_INVALID_PACKAGE) {
- fprintf(stderr, "Failed to get root path from [%s]\n", pkg.c_str());
- break;
- } else if (ret != NI_ERROR_NONE) {
+ if (ret != NI_ERROR_NONE) {
fprintf(stderr, "Failed to generate NI file [%s]\n", pkg.c_str());
break;
}
ret = createTACPkgRoot(pkg, flags);
- if (ret == NI_ERROR_INVALID_PACKAGE) {
- fprintf(stderr, "Failed to get root path from [%s]\n", pkg.c_str());
- break;
- } else if (ret != NI_ERROR_NONE) {
+ if (ret != NI_ERROR_NONE) {
fprintf(stderr, "Failed to generate symbolic link file [%s]\n", pkg.c_str());
break;
}
while (it != args.end()) {
std::string dll = std::string(*it);
int ret = createNiDllUnderPkgRoot(pkg, dll, flags);
- if (ret == NI_ERROR_INVALID_PACKAGE) {
- fprintf(stderr, "Failed to get root path from [%s]\n", pkg.c_str());
- break;
- } else if (ret != NI_ERROR_NONE) {
+ if (ret != NI_ERROR_NONE) {
fprintf(stderr, "Failed to generate NI file [%s]\n", dll.c_str());
break;
}
while (it != args.end()) {
std::string pkg = std::string(*it);
int ret = removeNiUnderPkgRoot(pkg);
- if (ret == NI_ERROR_INVALID_PACKAGE) {
- fprintf(stderr, "Failed to get root path from [%s]\n", pkg.c_str());
- break;
- } else if (ret != NI_ERROR_NONE) {
+ if (ret != NI_ERROR_NONE) {
fprintf(stderr, "Failed to remove dlls for given package [%s]\n", pkg.c_str());
break;
}
ret = resetTACPackage(pkg);
- if (ret == TAC_ERROR_INVALID_PACKAGE) {
- fprintf(stderr, "Failed to get root path from [%s]\n", pkg.c_str());
- break;
- } else if (ret != TAC_ERROR_NONE) {
+ if (ret != TAC_ERROR_NONE) {
fprintf(stderr, "Failed to remove symlink for given package [%s]\n", pkg.c_str());
break;
}
while (it != args.end()) {
std::string pkg = std::string(*it);
int ret = enableTACPackage(pkg);
- if (ret == TAC_ERROR_INVALID_PACKAGE) {
- fprintf(stderr, "Failed to get root path from [%s]\n", pkg.c_str());
- break;
- } else if (ret != TAC_ERROR_NONE) {
+ if (ret != TAC_ERROR_NONE) {
fprintf(stderr, "Failed to enable tac [%s]\n", pkg.c_str());
break;
}
while (it != args.end()) {
std::string pkg = std::string(*it);
int ret = disableTACPackage(pkg);
- if (ret == TAC_ERROR_INVALID_PACKAGE) {
- fprintf(stderr, "Failed to get root path from [%s]\n", pkg.c_str());
- break;
- } else if (ret != TAC_ERROR_NONE) {
+ if (ret != TAC_ERROR_NONE) {
fprintf(stderr, "Failed to disable tac [%s]\n", pkg.c_str());
break;
}
}
}
-static void createCoreLibNI(DWORD flags)
+static ni_error_e createCoreLibNI(DWORD flags)
{
std::string coreLib = concatPath(getRuntimeDir(), "System.Private.CoreLib.dll");
std::string niCoreLib = concatPath(getRuntimeDir(), "System.Private.CoreLib.ni.dll");
if (!crossgen(coreLib, std::string(), flags)) {
if (rename(coreLib.c_str(), coreLibBackup.c_str())) {
fprintf(stderr, "Failed to rename System.Private.CoreLib.dll\n");
+ return NI_ERROR_CORE_NI_FILE;
}
if (rename(niCoreLib.c_str(), coreLib.c_str())) {
fprintf(stderr, "Failed to rename System.Private.CoreLib.ni.dll\n");
+ return NI_ERROR_CORE_NI_FILE;
}
} else {
fprintf(stderr, "Failed to create native image for %s\n", coreLib.c_str());
+ return NI_ERROR_CORE_NI_FILE;
}
}
+ return NI_ERROR_NONE;
}
ni_error_e initNICommon(NiCommonOption* option)
ni_error_e createNiPlatform(DWORD flags)
{
- createCoreLibNI(flags);
+ if (createCoreLibNI(flags) != NI_ERROR_NONE) {
+ return NI_ERROR_CORE_NI_FILE;
+ }
const std::string platformDirs[] = {getRuntimeDir(), getTizenFXDir()};
return createNiUnderDirs(platformDirs, 2, flags);
ni_error_e createNiDll(const std::string& dllPath, DWORD flags)
{
+ if (dllPath.find("System.Private.CoreLib.dll") != std::string::npos) {
+ return createCoreLibNI(flags);
+ }
+
if (!isCoreLibPrepared(flags)) {
return NI_ERROR_CORE_NI_FILE;
}
std::string pkgRoot;
if (getRootPath(pkgId, pkgRoot) < 0) {
+ fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
return NI_ERROR_INVALID_PACKAGE;
}
{
std::string pkgRoot;
if (getRootPath(pkgId, pkgRoot) < 0) {
+ fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
return NI_ERROR_INVALID_PACKAGE;
}
std::string pkgRoot;
if (getRootPath(pkgId, pkgRoot) < 0) {
+ fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
return NI_ERROR_INVALID_PACKAGE;
}
{
std::string pkgRoot;
if (getRootPath(pkgId, pkgRoot) < 0) {
+ fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
return NI_ERROR_INVALID_PACKAGE;
}
{
std::string pkgRoot;
if (getRootPath(pkgId, pkgRoot) < 0) {
+ fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
return TAC_ERROR_INVALID_PACKAGE;
}
{
std::string pkgRoot;
if (getRootPath(pkgId, pkgRoot) < 0) {
+ fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
return TAC_ERROR_INVALID_PACKAGE;
}
{
std::string rootPath;
if (getRootPath(pkgId, rootPath) < 0) {
+ fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
return TAC_ERROR_INVALID_PACKAGE;
}
std::string execName;
if (getExecName(pkgId, execName) < 0) {
+ fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
return TAC_ERROR_INVALID_PACKAGE;
}
std::string metaValue;
if (getMetadataValue(pkgId, TAC_METADATA_KEY, metaValue) < 0) {
+ fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
return TAC_ERROR_INVALID_PACKAGE;
}