Add --rm-origin-after-ni option
[platform/core/dotnet/launcher.git] / NativeLauncher / tool / dotnettool.cc
index 99bc00c..7844988 100644 (file)
@@ -73,6 +73,9 @@ void DisplayUsage() {
                "       --print-cmd               - Print command and options\n"
                "       --skip-ro-app             - Skip re-generate NI for apps installed RO area\n"
                "                                   (This option works with --ni-regen-all-app only)\n"
+               "       --rm-origin-after-ni      - Remove original dll after creating native image\n"
+               "                                   Note!: --ni-pkg option doesnot support --rm-origin-after-ni option.\n"
+               "                                   (Use only for assemblies that will not be AOTed again afterward.)"
                "\n"
                "Usage: dotnettool [options] [command] [arguments]\n"
                "\n"
@@ -131,6 +134,8 @@ int main(int argc, char* argv[])
                        opt->flags |= NI_FLAGS_PRINT_CMD;
                } else if (arg == "--skip-ro-app") {
                        opt->flags |= NI_FLAGS_SKIP_RO_APP;
+               }  else if (arg == "--rm-origin-after-ni") {
+                       opt->flags |= NI_FLAGS_RM_ORIGIN_AFTER_NI;
                } else if (arg == "--mibc") {
                        ++i;
                        if (i >= argc) {
@@ -236,6 +241,12 @@ int main(int argc, char* argv[])
        }
        //sh-3.2# dotnettool --ni-pkg [pkgId] [pkgId] ...
        else if (cmd == "--ni-pkg") {
+               if (opt->flags & NI_FLAGS_RM_ORIGIN_AFTER_NI) {
+                       _SERR("--ni-pkg option doesnot support --rm-origin-after-ni option");
+                       DisplayUsage();
+                       return -1;
+               }
+
                if (args.size() < 1) {
                        _SERR("Package name is missing");
                }