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
ed53c018
Commit
ed53c018
authored
Feb 22, 2026
by
dsq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kotlin oh-0.1.0-01
parent
c701b74a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
22 deletions
+12
-22
.gitignore
.gitignore
+1
-0
build.gradle.kts
composeApp/build.gradle.kts
+8
-13
resource.def
composeApp/src/ohosArm64Main/cinterop/resource.def
+1
-7
libs.versions.toml
gradle/libs.versions.toml
+2
-2
No files found.
.gitignore
View file @
ed53c018
...
@@ -13,3 +13,4 @@
...
@@ -13,3 +13,4 @@
.externalNativeBuild
.externalNativeBuild
.cxx
.cxx
local.properties
local.properties
.kotlin
composeApp/build.gradle.kts
View file @
ed53c018
...
@@ -76,22 +76,17 @@ kotlin {
...
@@ -76,22 +76,17 @@ kotlin {
// 配置OHOS(华为鸿蒙)arm64目标
// 配置OHOS(华为鸿蒙)arm64目标
ohosArm64
{
ohosArm64
{
binaries
.
sharedLib
{
binaries
.
sharedLib
{
baseName
=
"kn"
// 共享库名称为kn
baseName
=
"kn"
// 共享库名称为kn
freeCompilerArgs
+=
listOf
(
"-Xbinary=sanitizer=address"
)
export
(
libs
.
compose
.
multiplatform
.
export
)
// 导出compose多平台库的接口
export
(
libs
.
compose
.
multiplatform
.
export
)
// 导出compose多平台库的接口
}
}
val
main
by
compilations
.
getting
// 获取主编译内容
val
main
by
compilations
.
getting
// 获取主编译内容
val
resource
by
main
.
cinterops
.
creating
{
// 添加devices库依赖 - 使用正确的Kotlin 2.2.21语法
// 配置C interop(cinterop)资源
compilations
.
named
(
"main"
)
{
defFile
(
file
(
"src/ohosArm64Main/cinterop/resource.def"
))
// cinterop定义文件
compilerOptions
.
configure
{
includeDirs
(
file
(
"src/ohosArm64Main/cinterop/include"
))
// cinterop包含目录
freeCompilerArgs
.
addAll
(
listOf
(
"-Xinclude-library=org.jetbrains.kotlin.native.platform.kba_devices"
,
"-Xdisable-default-klib-resolution"
)
)
}
}
}
}
}
...
@@ -168,7 +163,7 @@ val cmpVersion = versionCatalog.findVersion("composeMultiplatform")
...
@@ -168,7 +163,7 @@ val cmpVersion = versionCatalog.findVersion("composeMultiplatform")
.
orElseThrow
{
IllegalStateException
(
"Missing version composeMultiplatform in version catalog"
)
}
.
orElseThrow
{
IllegalStateException
(
"Missing version composeMultiplatform in version catalog"
)
}
.
requiredVersion
.
requiredVersion
val
skikoOverrideByCmpVersion
=
mapOf
(
val
skikoOverrideByCmpVersion
=
mapOf
(
"1.9.2-
ez-001"
to
"0.9.22.2-ez-0
01"
,
"1.9.2-
OH.0.1.0-01"
to
"0.9.22.2-OH.0.1.0-
01"
,
// 仅在需要强制的 CMP 版本这里新增
// 仅在需要强制的 CMP 版本这里新增
)
)
val
skikoOhosOverride
=
skikoOverrideByCmpVersion
[
cmpVersion
]
val
skikoOhosOverride
=
skikoOverrideByCmpVersion
[
cmpVersion
]
...
...
composeApp/src/ohosArm64Main/cinterop/resource.def
View file @
ed53c018
package
=
platform
.
resource
package
=
platform
.
resource
headers
=
raw_file_manager
.
h
raw_file
.
h
headers
=
raw_file_manager
.
h
raw_file
.
h
depends
=
platform
.
kba_devices
---
package
=
platform
.
resource
headers
=
raw_file_manager
.
h
raw_file
.
h
depends
=
platform
.
kba_devices
compilerOpts
=
-
I
/
Users
/
dongsq
/.
konan
/
dependencies
/
sysroot
-
ohos
-
aarch64
-
15
/
usr
/
include
\ No newline at end of file
gradle/libs.versions.toml
View file @
ed53c018
...
@@ -13,9 +13,9 @@ androidx-material = "1.12.0"
...
@@ -13,9 +13,9 @@ androidx-material = "1.12.0"
androidx-testExt
=
"1.3.0"
androidx-testExt
=
"1.3.0"
androidx-collection
=
"1.4.5"
androidx-collection
=
"1.4.5"
compose
=
"1.9.4"
compose
=
"1.9.4"
composeMultiplatform
=
"1.9.2-
ez-0
01"
composeMultiplatform
=
"1.9.2-
OH.0.1.0-
01"
junit
=
"4.13.2"
junit
=
"4.13.2"
kotlin
=
"2.2.21-
ez-1
01"
kotlin
=
"2.2.21-
OH.0.1.0-
01"
kotlinx-coroutines
=
"1.8.0-KBA-001"
kotlinx-coroutines
=
"1.8.0-KBA-001"
atomicFu
=
"0.23.2-KBA-001"
atomicFu
=
"0.23.2-KBA-001"
...
...
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