android: update AGP and Gradle dependencies (#4245)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Bart Louwers
2026-04-22 13:01:58 +02:00
committed by GitHub
parent db984960c1
commit 9f8667cf44
24 changed files with 269 additions and 171 deletions

View File

@@ -9,7 +9,7 @@ plugins {
}
dependencies {
implementation("com.android.tools.build:gradle:8.6.1")
implementation("com.android.tools.build:gradle:9.1.1")
}
group = "org.maplibre"

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

View File

@@ -1,23 +1,40 @@
package org.maplibre
import com.android.build.gradle.BaseExtension
import com.android.build.api.dsl.ApplicationExtension
import com.android.build.api.dsl.LibraryExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.getByType
import java.io.File
private fun configureCcacheArguments(arguments: MutableList<String>) {
val cacheToolPath = findCacheToolPath()
if (cacheToolPath != null) {
arguments.add("-DCMAKE_CXX_COMPILER_LAUNCHER=$cacheToolPath")
println("ccache enabled at: $cacheToolPath")
} else {
println("ccache not found on the system, continuing without it.")
}
}
fun configureCcache(project: Project) {
project.extensions.getByType<BaseExtension>().run {
defaultConfig {
val appExtension = project.extensions.findByType(ApplicationExtension::class.java)
if (appExtension != null) {
appExtension.defaultConfig {
externalNativeBuild {
cmake {
val cacheToolPath = findCacheToolPath()
if (cacheToolPath != null) {
arguments.add("-DCMAKE_CXX_COMPILER_LAUNCHER=$cacheToolPath")
println("ccache enabled at: $cacheToolPath")
} else {
println("ccache not found on the system, continuing without it.")
}
configureCcacheArguments(arguments)
}
}
}
return
}
val libraryExtension = project.extensions.findByType(LibraryExtension::class.java)
if (libraryExtension != null) {
libraryExtension.defaultConfig {
externalNativeBuild {
cmake {
configureCcacheArguments(arguments)
}
}
}