Skip to content

Commit 523edc1

Browse files
committed
build: 更新 kotlin 依赖, AGP 版本
1 parent e8d9c2d commit 523edc1

5 files changed

Lines changed: 29 additions & 34 deletions

File tree

app/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
plugins {
22
alias(libs.plugins.android.application)
3-
alias(libs.plugins.kotlin.android)
43
alias(libs.plugins.kotlin.compose)
54
alias(libs.plugins.ksp)
65
alias(libs.plugins.ktlint)
76
}
87

9-
val baseVersionName = "0.3.2"
8+
val baseVersionName = "0.3.3"
109
val Project.verName: String get() = "${baseVersionName}$versionNameSuffix.${exec("git rev-parse --short HEAD")}"
1110
val Project.verCode: Int get() = exec("git rev-list --count HEAD").toInt()
1211
val Project.isDevVersion: Boolean get() = exec("git tag -l v$baseVersionName").isEmpty()
@@ -27,11 +26,11 @@ android {
2726
val keystore = env("KEYSTORE_FILE")
2827

2928
namespace = "rs.clash.android"
30-
compileSdk = 36
29+
compileSdk = 37
3130
defaultConfig {
3231
applicationId = "rs.clash.android"
3332
minSdk = 23
34-
targetSdk = 36
33+
targetSdk = 37
3534
versionCode = verCode
3635
versionName = verName
3736

@@ -80,6 +79,7 @@ android {
8079
}
8180
buildFeatures {
8281
compose = true
82+
resValues = true
8383
}
8484
splits {
8585
abi {

core/build.gradle.kts

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ import groovy.json.JsonSlurper
22

33
plugins {
44
alias(libs.plugins.android.library)
5-
alias(libs.plugins.kotlin.android)
65
alias(libs.plugins.kotlin.compose)
76
alias(libs.plugins.rust.android)
87
}
98

109
android {
1110
namespace = "rs.clash.android.ffi"
12-
compileSdk = 36
11+
compileSdk = 37
1312

1413
ndkVersion = rootProject.extra["ndkVersion"] as String
14+
buildToolsVersion = rootProject.extra["buildToolsVersion"] as String
1515
defaultConfig {
1616
minSdk = 23
17-
17+
compileSdk = 37
1818
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1919
}
2020

@@ -28,6 +28,15 @@ android {
2828
}
2929
}
3030

31+
androidComponents {
32+
onVariants { variant ->
33+
val variantName = variant.name.replaceFirstChar(Char::titlecase)
34+
tasks
35+
.matching { it.name == "compile${variantName}Kotlin" || it.name == "compile${variantName}JavaWithJavac" }
36+
.configureEach { dependsOn("cargoBuild") }
37+
}
38+
}
39+
3140
kotlin {
3241
jvmToolchain(25)
3342
}
@@ -62,21 +71,3 @@ cargo {
6271
profile = "release"
6372
}
6473

65-
android {
66-
buildToolsVersion = rootProject.extra["buildToolsVersion"] as String
67-
compileOptions {
68-
sourceCompatibility = JavaVersion.VERSION_25
69-
targetCompatibility = JavaVersion.VERSION_25
70-
}
71-
libraryVariants.all {
72-
val variantName = name.replaceFirstChar(Char::titlecase)
73-
74-
// Make Java compilation depend on generating UniFFI bindings
75-
javaCompileProvider.get().dependsOn("cargoBuild")
76-
77-
// Also hook into Kotlin compilation
78-
tasks.named("compile${variantName}Kotlin").configure {
79-
dependsOn("cargoBuild")
80-
}
81-
}
82-
}

gradle.properties

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ org.gradle.parallel=true
55
android.useAndroidX=true
66
android.enableJetifier=false
77
android.nonTransitiveRClass=false
8-
android.nonFinalResIds=false
98
android.experimental.enableArtProfiles=true
109

1110
kotlin.code.style=official
11+
android.uniquePackageNames=false
12+
android.dependency.useConstraints=true
13+
android.r8.strictFullModeForKeepRules=false
14+
android.builtInKotlin=true
15+
android.newDsl=true

gradle/libs.versions.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[versions]
2-
agp = "8.13.2"
2+
agp = "9.2.0"
33
kotlin = "2.3.21"
44
rust-android-gradle = "0.10.1"
5-
coreKtx = "1.17.0"
5+
coreKtx = "1.18.0"
66
junit = "4.13.2"
77
junitVersion = "1.3.0"
88
espressoCore = "3.7.0"
99
lifecycleRuntimeKtx = "2.10.0"
10-
activityCompose = "1.12.2"
11-
composeBom = "2026.01.00"
10+
activityCompose = "1.13.0"
11+
composeBom = "2026.04.01"
1212
androidx-appcompat = "1.7.1"
13-
runtime = "1.10.1"
13+
runtime = "1.11.0"
1414
composeDestinations = "2.3.0"
1515
ksp-plugin = "2.3.4"
16-
ktlint = "14.0.1"
16+
ktlint = "14.2.0"
1717
compose = "1.7.8"
1818
material3 = "1.4.0"
19-
ktlint-compose = "0.5.3"
19+
ktlint-compose = "0.5.8"
2020

2121
[libraries]
2222
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)