Add limitation for -rm-origin-after-ni (#435) accepted/tizen/unified/20220923.052701
author조웅석/Common Platform Lab(SR)/삼성전자 <ws77.cho@samsung.com>
Wed, 21 Sep 2022 02:25:06 +0000 (11:25 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 21 Sep 2022 02:25:06 +0000 (11:25 +0900)
After upgrading platform, native image files for app should be regenerated.
In that case, original assembly is needed.
So, prohibits the use of "--rm-origin-after-ni" option in app related options.
(--ni-pkg, --ni-regen-all-app, --tac-regen-all)

NativeLauncher/tool/dotnettool.cc

index 7844988..24d5e48 100644 (file)
@@ -74,7 +74,7 @@ void DisplayUsage() {
                "       --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"
+               "                                   Note!: App ATOC options(--ni-pkg, --ni-regen-all-app, --tac-regen-all) cannot be used with --rm-origin-after-ni option.\n"
                "                                   (Use only for assemblies that will not be AOTed again afterward.)"
                "\n"
                "Usage: dotnettool [options] [command] [arguments]\n"
@@ -242,7 +242,7 @@ 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");
+                       _SERR("App AOTC options cannot be used with --rm-origin-after-ni option");
                        DisplayUsage();
                        return -1;
                }
@@ -309,6 +309,12 @@ int main(int argc, char* argv[])
        }
        //sh-3.2# dotnettool --ni-regen-all-app
        else if (cmd == "--ni-regen-all-app") {
+               if (opt->flags & NI_FLAGS_RM_ORIGIN_AFTER_NI) {
+                       _SERR("App AOTC options cannot be used with --rm-origin-after-ni option");
+                       DisplayUsage();
+                       return -1;
+               }
+
                int ret = regenerateAppNI(opt);
                if (ret != NI_ERROR_NONE) {
                        _SERR("Failed to regenerate all app NI");
@@ -316,6 +322,12 @@ int main(int argc, char* argv[])
        }
        //sh-3.2# dotnettool --tac-regen-all
        else if (cmd == "--tac-regen-all") {
+               if (opt->flags & NI_FLAGS_RM_ORIGIN_AFTER_NI) {
+                       _SERR("App AOTC options cannot be used with --rm-origin-after-ni option");
+                       DisplayUsage();
+                       return -1;
+               }
+
                int ret = regenerateTACNI(opt);
                if (ret != NI_ERROR_NONE) {
                        _SERR("Failed to regenerate all TAC");