+ // remove duplicated pkg in the list.
+ // If one package has multiple apps, there can be duplicate values.
+ pkgList.erase(unique(pkgList.begin(), pkgList.end()), pkgList.end());
+
+ for (auto pkg : pkgList) {
+ if (isReadOnlyPkg(pkg) && opt->flags & NI_FLAGS_SKIP_RO_APP) {
+ continue;
+ }
+
+ if (removeNIUnderPkgRoot(pkg) != NI_ERROR_NONE) {
+ _SERR("Failed to remove previous dlls from [%s]", pkg.c_str());
+ return NI_ERROR_UNKNOWN;
+ }
+
+ if (createNIUnderPkgRoot(pkg, opt) != NI_ERROR_NONE) {
+ _SERR("Failed to generate NI file [%s]", pkg.c_str());
+ return NI_ERROR_UNKNOWN;
+ } else {
+ _SOUT("Complete make application to native image");
+ }
+ }
+