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
9a010d13
Commit
9a010d13
authored
Apr 13, 2026
by
qq_38816927
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
清空
parent
9b517c53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
15 deletions
+26
-15
build.gradle.kts
composeApp/build.gradle.kts
+26
-15
No files found.
composeApp/build.gradle.kts
View file @
9a010d13
...
@@ -184,28 +184,39 @@ configurations.all {
...
@@ -184,28 +184,39 @@ configurations.all {
}
}
/** 仅清理 harmonyApp 下 entry 的中间目录,与 publish 无关时可单独执行:`:composeApp:cleanHarmonyAppEntryBuildsAndNativeLibs` */
/** 仅清理 harmonyApp 下 entry 的中间目录,与 publish 无关时可单独执行:`:composeApp:cleanHarmonyAppEntryBuildsAndNativeLibs` */
tasks
.
register
(
"cleanHarmonyAppEntryBuildsAndNativeLibs"
)
{
tasks
.
register
<
Delete
>
(
"cleanHarmonyAppEntryBuildsAndNativeLibs"
)
{
group
=
"harmony"
group
=
"harmony"
val
repoRoot
=
layout
.
rootDirectory
val
root
=
layout
.
rootDirectory
doLast
{
// delete(
val
root
=
repoRoot
.
get
().
asFile
// root.dir("harmonyApp/entry/build"),
listOf
(
// root.dir("harmonyApp/entry/libs/arm64-v8a"),
File
(
root
,
"harmonyApp/entry/build"
),
// root.dir("harmonyApp/entry/libs/x86_64"),
File
(
root
,
"harmonyApp/entry/libs/arm64-v8a"
),
// root.dir("harmonyApp/entry/src/main/cpp/include"),
File
(
root
,
"harmonyApp/entry/libs/x86_64"
),
// )
File
(
root
,
"harmonyApp/entry/src/main/cpp/include"
),
doFirst
{
).
forEach
{
f
->
getDelete
().
setFrom
(
project
.
files
())
if
(
f
.
exists
())
{
val
dBuild
=
root
.
dir
(
"harmonyApp/entry/build"
)
f
.
deleteRecursively
()
val
fBuild
:
File
=
dBuild
.
get
().
asFile
}
if
(
fBuild
.
exists
())
getDelete
().
from
(
dBuild
)
}
val
dArm64
=
root
.
dir
(
"harmonyApp/entry/libs/arm64-v8a"
)
val
fArm64
:
File
=
dArm64
.
get
().
asFile
if
(
fArm64
.
exists
())
getDelete
().
from
(
dArm64
)
val
dX86
=
root
.
dir
(
"harmonyApp/entry/libs/x86_64"
)
val
fX86
:
File
=
dX86
.
get
().
asFile
if
(
fX86
.
exists
())
getDelete
().
from
(
dX86
)
val
dInclude
=
root
.
dir
(
"harmonyApp/entry/src/main/cpp/include"
)
val
fInclude
:
File
=
dInclude
.
get
().
asFile
if
(
fInclude
.
exists
())
getDelete
().
from
(
dInclude
)
}
}
}
}
// 为不同类型(debug、release)OHOS构建注册Copy任务并发布到Harmony App目录
// 为不同类型(debug、release)OHOS构建注册Copy任务并发布到Harmony App目录
arrayOf
(
"debug"
,
"release"
).
forEach
{
type
->
arrayOf
(
"debug"
,
"release"
).
forEach
{
type
->
tasks
.
register
<
Copy
>(
"publish${type.capitalizeUS()}BinariesToHarmonyApp"
)
{
tasks
.
register
<
Copy
>(
"publish${type.capitalizeUS()}BinariesToHarmonyApp"
)
{
//
dependsOn("cleanHarmonyAppEntryBuildsAndNativeLibs")
dependsOn
(
"cleanHarmonyAppEntryBuildsAndNativeLibs"
)
group
=
"harmony"
// 归类到harmony任务组
group
=
"harmony"
// 归类到harmony任务组
dependsOn
(
"link${type.capitalizeUS()}SharedOhosArm64"
,
"link${type.capitalizeUS()}SharedOhosX64"
)
dependsOn
(
"link${type.capitalizeUS()}SharedOhosArm64"
,
"link${type.capitalizeUS()}SharedOhosX64"
)
duplicatesStrategy
=
DuplicatesStrategy
.
INCLUDE
duplicatesStrategy
=
DuplicatesStrategy
.
INCLUDE
...
...
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