Complete offline Android APK build for isolated LAN servers.
Bundle AndroidX, Kotlin Gradle plugin, and SDK patch scripts so Gradle no longer needs Google Maven at runtime. Bake Gradle wrapper into Docker image during build when network is available. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -14,11 +14,15 @@ val agpVersion: String = providers.gradleProperty("agpVersion").orElse("8.11.0")
|
||||
configurations {
|
||||
create("agp")
|
||||
create("androidDeps")
|
||||
create("buildPlugins")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
add("agp", "com.android.tools.build:gradle:$agpVersion")
|
||||
|
||||
add("buildPlugins", "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25")
|
||||
add("buildPlugins", "org.jetbrains.kotlin:kotlin-stdlib:1.9.25")
|
||||
|
||||
add("androidDeps", "androidx.webkit:webkit:1.14.0")
|
||||
add("androidDeps", "androidx.appcompat:appcompat:1.7.1")
|
||||
add("androidDeps", "androidx.activity:activity-ktx:1.10.1")
|
||||
@@ -26,6 +30,7 @@ dependencies {
|
||||
add("androidDeps", "androidx.lifecycle:lifecycle-process:2.10.0")
|
||||
add("androidDeps", "androidx.core:core-ktx:1.9.0")
|
||||
add("androidDeps", "androidx.browser:browser:1.8.0")
|
||||
add("androidDeps", "androidx.core:core:1.13.0")
|
||||
}
|
||||
|
||||
fun installArtifact(
|
||||
@@ -119,10 +124,13 @@ tasks.register("exportOfflineMaven") {
|
||||
}
|
||||
|
||||
tasks.register("exportAllOfflineMaven") {
|
||||
dependsOn(configurations.named("agp"), configurations.named("androidDeps"))
|
||||
dependsOn(configurations.named("agp"), configurations.named("androidDeps"), configurations.named("buildPlugins"))
|
||||
doLast {
|
||||
val offlineRoot = file("${rootProject.projectDir}/../offline-maven").apply { mkdirs() }
|
||||
val modules = exportConfiguration("agp", offlineRoot) + exportConfiguration("androidDeps", offlineRoot)
|
||||
val modules =
|
||||
exportConfiguration("agp", offlineRoot) +
|
||||
exportConfiguration("androidDeps", offlineRoot) +
|
||||
exportConfiguration("buildPlugins", offlineRoot)
|
||||
file("${offlineRoot.absolutePath}/.agp-offline-complete").writeText(
|
||||
"agpVersion=$agpVersion\nmodules=$modules\n",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user