From: j-h.choi Date: Fri, 12 Jul 2024 06:53:01 +0000 (+0900) Subject: Remove unnecessary architecture library for lib folder of app X-Git-Tag: accepted/tizen/unified/20240723.101927~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=609f7ad405b8653da6ff001c79989b473862eec4;p=platform%2Fcore%2Fdotnet%2Flauncher.git Remove unnecessary architecture library for lib folder of app --- diff --git a/NativeLauncher/tool/multi_target_resolver.cc b/NativeLauncher/tool/multi_target_resolver.cc index 5c12aaa..9542a35 100644 --- a/NativeLauncher/tool/multi_target_resolver.cc +++ b/NativeLauncher/tool/multi_target_resolver.cc @@ -124,8 +124,27 @@ static bool moveAllFilesTo(const std::string& from, const std::string& to) int resolvePlatformSpecificFiles(const std::string& rootPath) { std::string appBinPath = concatPath(rootPath, "bin"); + std::string appLibPath = concatPath(rootPath, "lib"); std::string runtimesPath = concatPath(appBinPath, "runtimes"); + // remove unused arch directory + std::vector archList = {"x86", "x64", "arm", "armel", "arm64", "aarch64", "riscv32", "riscv64"}; + archList.erase(find(archList.begin(), archList.end(), ARCHITECTURE_IDENTIFIER)); + if (!strncmp(ARCHITECTURE_IDENTIFIER, "armel", 5)) { + archList.erase(find(archList.begin(), archList.end(), "arm")); + } else if (!strncmp(ARCHITECTURE_IDENTIFIER, "arm64", 5)) { + archList.erase(find(archList.begin(), archList.end(), "aarch64")); + } + + for (const auto &arch : archList) { + std::string archPath = concatPath(appLibPath, arch); + if (exist(archPath)) { + if (!removeAll(archPath)) { + _ERR("Failed to remove %s directory", archPath.c_str()); + } + } + } + // if runtimes directory doesnot exist, return 0 if (!isDirectory(runtimesPath)) { return 0; diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11.sln b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11.sln new file mode 100755 index 0000000..1d4f0dc --- /dev/null +++ b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31005.135 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Launcher_TC_PLUGIN_11", "Launcher_TC_PLUGIN_11\Launcher_TC_PLUGIN_11.csproj", "{3daa496e-195a-4708-8316-dd6207adbd9a}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{c9bd2802-b0a0-41c2-9453-e159261615bc}" + ProjectSection(SolutionItems) = preProject + tizen_workspace.yaml = tizen_workspace.yaml + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3daa496e-195a-4708-8316-dd6207adbd9a}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3daa496e-195a-4708-8316-dd6207adbd9a}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3daa496e-195a-4708-8316-dd6207adbd9a}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3daa496e-195a-4708-8316-dd6207adbd9a}.Release|Any CPU.Build.0 = Release|Any CPU + + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/Directory.Build.targets b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/Directory.Build.targets new file mode 100755 index 0000000..67fcf5d --- /dev/null +++ b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/Directory.Build.targets @@ -0,0 +1,21 @@ + + + + + + + + $([System.IO.Path]::GetDirectoryName($(MSBuildProjectDirectory))) + + + + + + diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11.cs b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11.cs new file mode 100755 index 0000000..9c6e1b8 --- /dev/null +++ b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11.cs @@ -0,0 +1,49 @@ +using System; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Launcher_TC_PLUGIN_11 +{ + class Program : NUIApplication + { + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + void Initialize() + { + Window.Instance.KeyEvent += OnKeyEvent; + + TextLabel text = new TextLabel("Hello Tizen NUI World"); + text.HorizontalAlignment = HorizontalAlignment.Center; + text.VerticalAlignment = VerticalAlignment.Center; + text.TextColor = Color.Blue; + text.PointSize = 12.0f; + text.HeightResizePolicy = ResizePolicyType.FillToParent; + text.WidthResizePolicy = ResizePolicyType.FillToParent; + Window.Instance.GetDefaultLayer().Add(text); + + Animation animation = new Animation(2000); + animation.AnimateTo(text, "Orientation", new Rotation(new Radian(new Degree(180.0f)), PositionAxis.X), 0, 500); + animation.AnimateTo(text, "Orientation", new Rotation(new Radian(new Degree(0.0f)), PositionAxis.X), 500, 1000); + animation.Looping = true; + animation.Play(); + } + + public void OnKeyEvent(object sender, Window.KeyEventArgs e) + { + if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape")) + { + Exit(); + } + } + + static void Main(string[] args) + { + var app = new Program(); + app.Run(args); + } + } +} diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11.csproj b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11.csproj new file mode 100755 index 0000000..4926595 --- /dev/null +++ b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11.csproj @@ -0,0 +1,19 @@ + + + + Exe + net6.0-tizen + + + + portable + + + None + + + + + + + diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/aarch64/test.so b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/aarch64/test.so new file mode 100755 index 0000000..e69de29 diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/arm/test.so b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/arm/test.so new file mode 100755 index 0000000..e69de29 diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/arm64/test.so b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/arm64/test.so new file mode 100755 index 0000000..e69de29 diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/armel/test.so b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/armel/test.so new file mode 100755 index 0000000..e69de29 diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/riscv64/test.so b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/riscv64/test.so new file mode 100755 index 0000000..e69de29 diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/x64/test.so b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/x64/test.so new file mode 100755 index 0000000..e69de29 diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/x86/test.so b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/lib/x86/test.so new file mode 100755 index 0000000..e69de29 diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/shared/res/Launcher_TC_PLUGIN_11.png b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/shared/res/Launcher_TC_PLUGIN_11.png new file mode 100755 index 0000000..9f3cb98 Binary files /dev/null and b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/shared/res/Launcher_TC_PLUGIN_11.png differ diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/tizen-manifest.xml b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/tizen-manifest.xml new file mode 100755 index 0000000..7f43df3 --- /dev/null +++ b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/tizen-manifest.xml @@ -0,0 +1,16 @@ + + + + + + Launcher_TC_PLUGIN_11.png + + + diff --git a/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/tizen_dotnet_project.yaml b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/tizen_dotnet_project.yaml new file mode 100755 index 0000000..d5eb080 --- /dev/null +++ b/tests/Apps/Launcher_TC_PLUGIN_11/Launcher_TC_PLUGIN_11/tizen_dotnet_project.yaml @@ -0,0 +1,9 @@ +# csproj file path +csproj_file: Launcher_TC_PLUGIN_11.csproj + +# files monitored for dirty/modified status +files: + - Launcher_TC_PLUGIN_11.csproj + - Launcher_TC_PLUGIN_11.cs + - tizen-manifest.xml + - shared/res/Launcher_TC_PLUGIN_11.png \ No newline at end of file diff --git a/tests/TCs/2_PLUGIN/PLUGIN.py b/tests/TCs/2_PLUGIN/PLUGIN.py index b6709fb..be55dce 100755 --- a/tests/TCs/2_PLUGIN/PLUGIN.py +++ b/tests/TCs/2_PLUGIN/PLUGIN.py @@ -303,6 +303,90 @@ def TC_10(): return "PASS" +# The `Launcher_TC_PLUGIN_11` application should not have a library of other architecture. +def TC_11(): + sln_name = "Launcher_TC_PLUGIN_11" + + tpk_path = get_tpk_path(tpk_list, f"{sln_name}") + if tpk_path == None: + return f"FAIL : Get the tpk path for {sln_name}" + + if "OK" not in app_install(f"{tpk_path}"): + return f"FAIL : Install the application for {tpk_path}" + + pkg_id = f"org.tizen.example.Launcher_TC_PLUGIN_11" + + root_path = get_root_path(f"{pkg_id}") + if root_path == "None": + return f"FAIL : Get the root path for {pkg_id}" + + device_abi = get_device_abi() + if "arm_32" == device_abi: + if not exist(f"{root_path}/lib/arm") or \ + not exist(f"{root_path}/lib/armel") or \ + exist(f"{root_path}/lib/aarch64") or \ + exist(f"{root_path}/lib/arm64") or \ + exist(f"{root_path}/lib/riscv32") or \ + exist(f"{root_path}/lib/riscv64") or \ + exist(f"{root_path}/lib/x64") or \ + exist(f"{root_path}/lib/x86"): + return "FAIL" + elif "arm_64" == device_abi: + if exist(f"{root_path}/lib/arm") or \ + exist(f"{root_path}/lib/armel") or \ + not exist(f"{root_path}/lib/aarch64") or \ + not exist(f"{root_path}/lib/arm64") or \ + exist(f"{root_path}/lib/riscv32") or \ + exist(f"{root_path}/lib/riscv64") or \ + exist(f"{root_path}/lib/x64") or \ + exist(f"{root_path}/lib/x86"): + return "FAIL" + elif "riscv_32" == device_abi: + if exist(f"{root_path}/lib/arm") or \ + exist(f"{root_path}/lib/armel") or \ + exist(f"{root_path}/lib/aarch64") or \ + exist(f"{root_path}/lib/arm64") or \ + not exist(f"{root_path}/lib/riscv32") or \ + exist(f"{root_path}/lib/riscv64") or \ + exist(f"{root_path}/lib/x64") or \ + exist(f"{root_path}/lib/x86"): + return "FAIL" + elif "riscv_64" == device_abi: + if exist(f"{root_path}/lib/arm") or \ + exist(f"{root_path}/lib/armel") or \ + exist(f"{root_path}/lib/aarch64") or \ + exist(f"{root_path}/lib/arm64") or \ + exist(f"{root_path}/lib/riscv32") or \ + not exist(f"{root_path}/lib/riscv64") or \ + exist(f"{root_path}/lib/x64") or \ + exist(f"{root_path}/lib/x86"): + return "FAIL" + elif "x86_64" == device_abi: + if exist(f"{root_path}/lib/arm") or \ + exist(f"{root_path}/lib/armel") or \ + exist(f"{root_path}/lib/aarch64") or \ + exist(f"{root_path}/lib/arm64") or \ + exist(f"{root_path}/lib/riscv32") or \ + exist(f"{root_path}/lib/riscv64") or \ + not exist(f"{root_path}/lib/x64") or \ + exist(f"{root_path}/lib/x86"): + return "FAIL" + elif "x86" == device_abi: + if exist(f"{root_path}/lib/arm") or \ + exist(f"{root_path}/lib/armel") or \ + exist(f"{root_path}/lib/aarch64") or \ + exist(f"{root_path}/lib/arm64") or \ + exist(f"{root_path}/lib/riscv32") or \ + exist(f"{root_path}/lib/riscv64") or \ + exist(f"{root_path}/lib/x64") or \ + not exist(f"{root_path}/lib/x86"): + return "FAIL" + else: + return "NONE - TC_11 is not supported on this platform" + + + return "PASS" + # Run the test def run(): cmd(f"root on") @@ -335,6 +419,7 @@ def clean(): cmd(f"uninstall org.tizen.example.Launcher_TC_PLUGIN_08.Tizen") cmd(f"uninstall org.tizen.example.Launcher_TC_PLUGIN_09.Tizen") cmd(f"uninstall org.tizen.example.Launcher_TC_PLUGIN_10.Tizen") + cmd(f"uninstall org.tizen.example.Launcher_TC_PLUGIN_11") # Main entry point def main(): @@ -352,7 +437,7 @@ def main(): else: tc_array.append(funcMap[tc_num]) else: - tc_array = [TC_01, TC_02, TC_03, TC_04, TC_05, TC_06, TC_07, TC_08, TC_09, TC_10] + tc_array = [TC_01, TC_02, TC_03, TC_04, TC_05, TC_06, TC_07, TC_08, TC_09, TC_10, TC_11] global serial if len(sys.argv) >= 2 and "TC_" not in sys.argv[1]: @@ -372,9 +457,10 @@ def main(): funcMap = { -'TC_01': TC_01, 'TC_02': TC_02, 'TC_03': TC_03, 'TC_04': TC_04, 'TC_05': TC_05, 'TC_06': TC_06, 'TC_07': TC_07, 'TC_08': TC_08, 'TC_09': TC_09, 'TC_10': TC_10, +'TC_01': TC_01, 'TC_02': TC_02, 'TC_03': TC_03, 'TC_04': TC_04, 'TC_05': TC_05, +'TC_06': TC_06, 'TC_07': TC_07, 'TC_08': TC_08, 'TC_09': TC_09, 'TC_10': TC_10, 'TC_11': TC_11, 'PLUGIN_TC_01': TC_01, 'PLUGIN_TC_02': TC_02, 'PLUGIN_TC_03': TC_03, 'PLUGIN_TC_04': TC_04, 'PLUGIN_TC_05': TC_05, -'PLUGIN_TC_06': TC_06, 'PLUGIN_TC_07': TC_07, 'PLUGIN_TC_08': TC_08, 'PLUGIN_TC_09': TC_09, 'PLUGIN_TC_10': TC_10 +'PLUGIN_TC_06': TC_06, 'PLUGIN_TC_07': TC_07, 'PLUGIN_TC_08': TC_08, 'PLUGIN_TC_09': TC_09, 'PLUGIN_TC_10': TC_10, 'PLUGIN_TC_11': TC_11 } diff --git a/tests/TCs/Utils.py b/tests/TCs/Utils.py index b5e4af3..e302854 100755 --- a/tests/TCs/Utils.py +++ b/tests/TCs/Utils.py @@ -164,6 +164,12 @@ def get_device_arch(): line = [l for l in raw.splitlines() if "cpu_arch" in l] return line[0].split(":")[1] +# Get the device abi +def get_device_abi(): + raw = cmd("capability") + line = [l for l in raw.splitlines() if "core_abi" in l] + return line[0].split(":")[1] + # Check the library type def check_library_arch(rootpath, library): raw = cmd(f"pull {rootpath}/bin/{library} {library}")