" --ni-system - Create NI under System DLLs\n"
" --ni-dll - Create NI for DLL\n"
" --ni-pkg - Create NI for package\n"
+ " --ni-ro-pkg - Create NI for read-only package\n"
" --ni-dir - Create NI for directory\n"
" --ni-reset-system - Remove System NI files\n"
" --ni-reset-pkg - Remove App NI files\n"
}
while (it != args.end()) {
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_NONE) {
- fprintf(stderr, "Failed to generate NI file [%s]\n", pkg.c_str());
- break;
+ if (isReadOnlyApp(pkg)) {
+ fprintf(stderr, "Skip to generate app NI. Try to create NI for read-only package [%s]\n# dotnettool --ni-ro-pkg %s\n", pkg.c_str(), pkg.c_str());
+ } else {
+ // if there is AOTed dlls under package root, that is skiped.
+ int ret = createNIUnderPkgRoot(pkg, flags);
+ if (ret != NI_ERROR_NONE) {
+ fprintf(stderr, "Failed to generate app NI [%s]\n", pkg.c_str());
+ break;
+ }
+ }
+ it = args.erase(it);
+ }
+ }
+ //sh-3.2# dotnettool --ni-ro-pkg [pkgId] [pkgId] ...
+ else if (cmd == "--ni-ro-pkg") {
+ if (args.size() < 1) {
+ fprintf(stderr, "Package name is missing\n");
+ }
+ flags |= NI_FLAGS_READONLY_APP;
+ while (it != args.end()) {
+ std::string pkg = std::string(*it);
+ if (isReadOnlyApp(pkg)) {
+ // if there is AOTed dlls under package root, that is skiped.
+ int ret = createNIUnderPkgRoot(pkg, flags);
+ if (ret != NI_ERROR_NONE) {
+ fprintf(stderr, "Failed to generate read-only app NI [%s]\n", pkg.c_str());
+ break;
+ }
+ } else {
+ fprintf(stderr, "Skip to generate app NI. Try to create NI for package [%s]\n# dotnettool --ni-pkg %s\n", pkg.c_str(), pkg.c_str());
}
it = args.erase(it);
}
int ret = regenerateAppNI(flags);
if (ret != NI_ERROR_NONE) {
fprintf(stderr, "Failed to regenerate read-only app NI\n");
- }
+ }
}
//sh-3.2# dotnettool --tac-regen-all
else if (cmd == "--tac-regen-all") {
// read-only and readonly flag set
if (readOnlyApp && (*pFlags & NI_FLAGS_READONLY_APP)) {
fprintf(stderr, "try to regenerate read-only pkg [%s]\n", pkgId);
- }
- // not rad-only and readonly flag doesnot set
+ }
+ // not read-only and readonly flag does not set
else if (!readOnlyApp && !(*pFlags & NI_FLAGS_READONLY_APP)) {
if (removeNIUnderPkgRoot(pkgId) != NI_ERROR_NONE) {
fprintf(stderr, "Failed to remove previous dlls from [%s]\n", pkgId);
return -1;
- }
+ }
}
// skip regeneration
else {