|
@@ -26,9 +26,18 @@ subprojects {
|
|
|
options.incremental = true // 启用增量编译
|
|
|
}
|
|
|
|
|
|
- // 复制依赖任务,使用更现代的 `runtimeClasspath`
|
|
|
- task copyAllDependencies(type: Copy) {
|
|
|
- from configurations.runtimeClasspath
|
|
|
- into "${buildDir}/libs/lib"
|
|
|
+ // 任务:复制所有依赖到指定目录
|
|
|
+ tasks.register('copyAllDependencies', Copy) {
|
|
|
+ description = 'Copies all runtime dependencies to the libs directory'
|
|
|
+ group = 'build' // 将任务归类到构建任务组中
|
|
|
+ from(configurations.runtimeClasspath) // 使用 runtimeClasspath
|
|
|
+ into("${buildDir}/libs/lib")
|
|
|
+ }
|
|
|
+
|
|
|
+ // 可选:启用 Gradle 缓存和并行化构建
|
|
|
+ gradle.projectsEvaluated {
|
|
|
+ tasks.withType(JavaCompile).configureEach {
|
|
|
+ options.fork = true // 启用编译器分叉,提高性能
|
|
|
+ }
|
|
|
}
|
|
|
}
|