2025-09-22 18:56:13 +08:00
|
|
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// build.gradle (Project-level)
|
|
|
|
|
buildscript {
|
|
|
|
|
ext.kotlin_version = '1.9.24' // 根据你使用的 Kotlin 版本调整
|
|
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
|
google()
|
|
|
|
|
mavenCentral()
|
|
|
|
|
jcenter() // 已废弃,仅限旧项目使用
|
|
|
|
|
gradlePluginPortal()
|
|
|
|
|
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
|
classpath libs.gradle // 或你使用的 Android Gradle 插件版本
|
|
|
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
|
|
|
|
|
|
|
|
// ✅ 添加 ARouter 插件依赖
|
|
|
|
|
classpath 'com.alibaba:arouter-register:1.0.2'
|
|
|
|
|
|
|
|
|
|
// classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-10-10 09:10:42 +08:00
|
|
|
|
2025-09-22 18:56:13 +08:00
|
|
|
plugins {
|
|
|
|
|
alias(libs.plugins.android.application) apply false
|
|
|
|
|
alias(libs.plugins.android.library) apply false
|
|
|
|
|
alias(libs.plugins.kotlin.android) apply false
|
|
|
|
|
}
|
2025-10-10 09:10:42 +08:00
|
|
|
|
|
|
|
|
subprojects {
|
|
|
|
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
|
|
|
|
kotlinOptions {
|
|
|
|
|
jvmTarget = "11"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-09-22 18:56:13 +08:00
|
|
|
task clean(type: Delete) {
|
|
|
|
|
delete rootProject.buildDir
|
|
|
|
|
}
|