Commit b939ff27 authored by qq_38816927's avatar qq_38816927

删除测试卡死的按钮

parent 153d2a59
......@@ -110,17 +110,17 @@ internal fun HomeScreen(
// ) {
// Text("测试debug调试时应用退出")
// }
Button(
onClick = {
// 触发卡死
val testInfinite: Boolean = true;
fun infinite(): Int = infinite() + 1
infinite() // 触发 StackOverflowError
},
modifier = Modifier.fillMaxWidth()
) {
Text("测试debug调试时应用卡死")
}
// Button(
// onClick = {
// // 触发卡死
// val testInfinite: Boolean = true;
// fun infinite(): Int = infinite() + 1
// infinite() // 触发 StackOverflowError
// },
// modifier = Modifier.fillMaxWidth()
// ) {
// Text("测试debug调试时应用卡死")
// }
}
......
......@@ -22,6 +22,39 @@ set -e
START_TIME=$(date +%s)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# 与 composeApp/build.gradle.kts 中 publish*BinariesToHarmonyApp 的 into 路径一致(Gradle: rootProject.name + "." + project.name.lowercase() + ".generated.resources")
harmony_publish_compose_resources_package() {
local _root_name
_root_name=$(grep -E '^\s*rootProject\.name\s*=' "$SCRIPT_DIR/settings.gradle.kts" 2>/dev/null | head -1 | sed -n 's/.*=\s*"\([^"]*\)".*/\1/p')
[ -z "$_root_name" ] && _root_name="TestToolChainDemo"
echo "${_root_name}.composeapp.generated.resources"
}
# 删除一次 Gradle publish 会拷入的 kn 头/so 与 composeResources 目录(由本脚本在 gradlew publish 前调用)
delete_harmony_publish_kn_outputs() {
local _base="$1"
_base="${_base%/}"
[ -d "$_base/entry" ] || return 0
local _pkg
_pkg=$(harmony_publish_compose_resources_package)
rm -f "$_base/entry/src/main/cpp/include/libkn_api.h" 2>/dev/null || true
rm -f "$_base/entry/libs/arm64-v8a/libkn.so" 2>/dev/null || true
rm -f "$_base/entry/libs/x86_64/libkn.so" 2>/dev/null || true
rm -rf "$_base/entry/src/main/resources/rawfile/composeResources/$_pkg" 2>/dev/null || true
}
delete_all_harmony_publish_targets_before_gradle() {
delete_harmony_publish_kn_outputs "$SCRIPT_DIR/harmonyApp"
if [ -n "${LOCAL_OHOS_PATH:-}" ]; then
if [[ "$LOCAL_OHOS_PATH" = /* ]]; then
delete_harmony_publish_kn_outputs "$LOCAL_OHOS_PATH"
else
delete_harmony_publish_kn_outputs "$SCRIPT_DIR/$LOCAL_OHOS_PATH"
fi
fi
echo -e "\033[35m已按 publish 目标清理 harmonyApp(libkn / libkn_api.h / composeResources 包目录)\033[0m"
}
# ====================== [1. Default Configuration and Parameter Parsing] ======================
DEFAULT_PLATFORM="ohosArm64"
DEFAULT_TARGET_ID="127.0.0.1:5555"
......@@ -262,6 +295,7 @@ done
GRADLE_OUT="/tmp/runOhos_gradle_$$.out"
GRADLE_RET=0
if [ "$PLATFORM" = "ohosArm64" ]; then
delete_all_harmony_publish_targets_before_gradle
if [ "$BUILD_MODE" = "release" ]; then
echo ">>> :composeApp:publishReleaseBinariesToHarmonyApp"
if [ -n "$LOCAL_OHOS_PATH" ]; then
......@@ -280,6 +314,7 @@ if [ "$PLATFORM" = "ohosArm64" ]; then
GRADLE_RET=${PIPESTATUS[0]}
fi
elif [ "$PLATFORM" = "ohosX86_64" ]; then
delete_all_harmony_publish_targets_before_gradle
if [ "$BUILD_MODE" = "release" ]; then
echo ">>> :composeApp:publishReleaseBinariesToHarmonyApp"
if [ -n "$LOCAL_OHOS_PATH" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment