Commit e695749c authored by dsq's avatar dsq

修复win上运行不了的问题

parent 0fefb338
...@@ -5,4 +5,6 @@ ...@@ -5,4 +5,6 @@
# For customization when using a Version Control System, please read the # For customization when using a Version Control System, please read the
# header note. # header note.
#Wed Mar 04 09:18:30 CST 2026 #Wed Mar 04 09:18:30 CST 2026
sdk.dir=/Users/dongsq/Library/Android/sdk sdk.dir=/Users/dongsq/Library/Android/sdk
\ No newline at end of file #local.ohos.path=/Users/dongsq/TestDemo/IR013/TestProject/Correct/Tab
local.deveco.path=/Applications/DevEco-Temp/601/DevEco-Studio.app
\ No newline at end of file
...@@ -175,25 +175,16 @@ arrayOf("debug", "release").forEach { type -> ...@@ -175,25 +175,16 @@ arrayOf("debug", "release").forEach { type ->
arrayOf("debug", "release").forEach { type -> arrayOf("debug", "release").forEach { type ->
val capitalizedType = type.replaceFirstChar { it.uppercase() } val capitalizedType = type.replaceFirstChar { it.uppercase() }
tasks.register<Copy>("publish${capitalizedType}BinariesToHarmonyAppX64") { tasks.register<Copy>("publish${capitalizedType}BinariesToHarmonyAppX64") {
group = "harmony" group = "harmony" // 归类到harmony任务组
description = "Publish ohosX64 libkn.so to harmonyapp/entry/libs/x86_64 for emulator" dependsOn("link${type.capitalizeUS()}SharedOhosX64") // 依赖于OHOS shared lib的链接任务
dependsOn("link${capitalizedType}SharedOhosX64") into(harmonyAppDir) // 输出目标目录
into(rootProject.file("harmonyapp")) from("build/bin/ohosX64/${type}Shared/libkn_api.h") { // 复制头文件
val binaryPath = "build/bin/ohosX64/${type}Shared" into("entry/src/main/cpp/include/") // 指定目录
from("$binaryPath/libkn_api.h") {
into("entry/src/main/cpp/include/")
}
from("$binaryPath/libkn.so") {
into("entry/libs/x86_64/")
}
from("native-libs/ohosX64/libsample.a") {
into("entry/src/main/cpp/libs/")
} }
doFirst { from(project.file("build/bin/ohosX64/${type}Shared/libkn.so")) { // 复制共享库文件
if (!file(binaryPath).exists()) { into("/entry/libs/x86_64/") // 指定目标目录
throw GradleException("未找到产物目录: $binaryPath")
}
} }
} }
} }
......
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