Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TestToolChainDemo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
dsq
TestToolChainDemo
Commits
b11479b8
Commit
b11479b8
authored
Mar 13, 2026
by
dsq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
release指令优化
parent
ff6b2712
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
31 deletions
+15
-31
build.gradle.kts
composeApp/build.gradle.kts
+6
-2
App.kt
composeApp/src/commonMain/kotlin/com.dong.demo013/App.kt
+9
-27
gradle.properties
gradle.properties
+0
-2
No files found.
composeApp/build.gradle.kts
View file @
b11479b8
...
@@ -44,11 +44,13 @@ kotlin {
...
@@ -44,11 +44,13 @@ kotlin {
export
(
libs
.
compose
.
multiplatform
.
export
)
// 导出compose多平台库的接口
export
(
libs
.
compose
.
multiplatform
.
export
)
// 导出compose多平台库的接口
// 确保链接系统 zlib,使 libkn.so 的 NEEDED 包含 libz.so
// 确保链接系统 zlib,使 libkn.so 的 NEEDED 包含 libz.so
linkerOpts
(
"-lz"
)
linkerOpts
(
"-lz"
)
// 避免 release 优化在模拟器上触发 SIGILL(非法指令)
optimized
=
false
}
}
// 禁用内联类可能有助于 NAPI
// 禁用内联类可能有助于 NAPI
val
main
by
compilations
.
getting
val
main
by
compilations
.
getting
main
.
compilerOptions
.
configure
{
main
.
compilerOptions
.
configure
{
freeCompilerArgs
.
add
(
"-Xbinary=sanitizer=address"
)
//
freeCompilerArgs.add("-Xbinary=sanitizer=address")
}
}
//val resource by main.cinterops.creating {
//val resource by main.cinterops.creating {
// defFile(file("src/ohosArm64Main/cinterop/resource.def"))
// defFile(file("src/ohosArm64Main/cinterop/resource.def"))
...
@@ -61,10 +63,12 @@ kotlin {
...
@@ -61,10 +63,12 @@ kotlin {
baseName
=
"kn"
baseName
=
"kn"
export
(
libs
.
compose
.
multiplatform
.
export
)
export
(
libs
.
compose
.
multiplatform
.
export
)
linkerOpts
(
"-lz"
)
linkerOpts
(
"-lz"
)
// 避免 release 优化在模拟器上触发 SIGILL(非法指令)
optimized
=
false
}
}
val
main
by
compilations
.
getting
val
main
by
compilations
.
getting
main
.
compilerOptions
.
configure
{
main
.
compilerOptions
.
configure
{
freeCompilerArgs
.
add
(
"-Xbinary=sanitizer=address"
)
//
freeCompilerArgs.add("-Xbinary=sanitizer=address")
}
}
// val resource by main.cinterops.creating {
// val resource by main.cinterops.creating {
// defFile(file("src/ohosX64Main/cinterop/resource.def"))
// defFile(file("src/ohosX64Main/cinterop/resource.def"))
...
...
composeApp/src/commonMain/kotlin/com.dong.demo013/App.kt
View file @
b11479b8
...
@@ -97,8 +97,11 @@ internal fun HomeScreen(
...
@@ -97,8 +97,11 @@ internal fun HomeScreen(
)
{
)
{
Button
(
Button
(
onClick
=
{
onClick
=
{
pirntSingleHiLog
();
try
{
// pirntAllLevelHiLog();
pirntSingleHiLog
()
}
catch
(
e
:
Exception
)
{
print
(
"printSingleLog error"
)
}
},
},
modifier
=
Modifier
.
fillMaxWidth
()
modifier
=
Modifier
.
fillMaxWidth
()
)
{
)
{
...
@@ -141,41 +144,20 @@ internal fun HomeScreen(
...
@@ -141,41 +144,20 @@ internal fun HomeScreen(
}
}
}
}
Column
(
modifier
=
Modifier
.
fillMaxWidth
(),
verticalArrangement
=
Arrangement
.
spacedBy
(
8
.
dp
)
)
{
Button
(
onClick
=
{
val
logDemo
=
ComponentDemo
(
id
=
"log_fault_demo"
,
title
=
"Fault日志"
,
group
=
ComposeGroup
.
Foundation
)
onSelect
(
logDemo
)
},
modifier
=
Modifier
.
fillMaxWidth
()
)
{
Text
(
"进入Fault日志测试"
)
}
}
Column
(
Column
(
modifier
=
Modifier
.
fillMaxWidth
(),
modifier
=
Modifier
.
fillMaxWidth
(),
verticalArrangement
=
Arrangement
.
spacedBy
(
8
.
dp
)
verticalArrangement
=
Arrangement
.
spacedBy
(
8
.
dp
)
)
{
)
{
Button
(
Button
(
onClick
=
{
onClick
=
{
val
logDemo
=
ComponentDemo
(
// 无限递归 - 栈溢出
id
=
"log_over_demo"
,
fun
infinite
():
Int
=
infinite
()
+
1
title
=
"越界日志"
,
infinite
()
// 触发 StackOverflowError
group
=
ComposeGroup
.
Foundation
)
onSelect
(
logDemo
)
},
},
modifier
=
Modifier
.
fillMaxWidth
()
modifier
=
Modifier
.
fillMaxWidth
()
)
{
)
{
Text
(
"
进入越界日志测试
"
)
Text
(
"
测试崩溃日志
"
)
}
}
}
}
...
...
gradle.properties
View file @
b11479b8
...
@@ -18,5 +18,3 @@ org.gradle.internal.http.connectionTimeout=100000
...
@@ -18,5 +18,3 @@ org.gradle.internal.http.connectionTimeout=100000
org.gradle.internal.http.socketTimeout
=
100000
org.gradle.internal.http.socketTimeout
=
100000
# kotlin.mpp.applyDefaultHierarchyTemplate=false
# kotlin.mpp.applyDefaultHierarchyTemplate=false
kotlin.native.optimizations.extraOpts
=
-Oz
kotlin.native.binary.alignment
=
8
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment