Add android-project-full-audit and local-worker-handoff skills; sync scaffold skill
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
216cf3478d
commit
59fc08fa5f
27 changed files with 1064 additions and 11 deletions
|
|
@ -22,11 +22,11 @@ It checks JDK (needs 17+), the Android SDK (ANDROID_HOME / ANDROID_SDK_ROOT / co
|
|||
|
||||
## Step 2 — Pick compatible versions
|
||||
|
||||
The single most common failure is an incompatible **AGP ↔ Gradle ↔ Kotlin** triple, or using APIs from the wrong AGP major. Before scaffolding:
|
||||
The single most common failure is an incompatible **AGP ↔ Gradle ↔ Kotlin** triple. Before scaffolding:
|
||||
|
||||
1. Note what's actually available: the doctor lists installed `platforms` (→ `compileSdk`) and any cached Gradle distributions.
|
||||
2. If the user specified versions, use them. Otherwise pick a known-good triple and confirm against the AGP release notes (AGP's "Compatible Gradle/Kotlin" table) — **check, don't guess from memory.**
|
||||
3. **Know the AGP major.** AGP 8.x: apply `org.jetbrains.kotlin.android`, use `kotlinOptions`, `packagingOptions`. AGP 9.x: Kotlin is **built in** (do NOT apply `kotlin.android`), use `kotlin { compilerOptions { … } }` and `packaging {}`. The default `scaffold.sh` template targets AGP 8.x — if the user wants AGP 9, adjust the generated `app/build.gradle.kts` accordingly and drop the `kotlin-android` plugin.
|
||||
3. The default `scaffold.sh` template targets **AGP 9** with Kotlin built in (no `kotlin-android` plugin needed). If the user explicitly asks for AGP 8.x instead, adjust accordingly: apply `org.jetbrains.kotlin.android`, use `kotlinOptions`, and downgrade Gradle to ≥8.10.
|
||||
4. Compose needs the Compose compiler plugin (`org.jetbrains.kotlin.plugin.compose`) for Kotlin 2.0+; the template already wires it.
|
||||
|
||||
## Step 3 — Generate the skeleton
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
# Usage:
|
||||
# scaffold.sh --dir <path> --package <com.foo.bar> [--name "App"] \
|
||||
# [--compile-sdk 34] [--min-sdk 24] [--target-sdk 34] \
|
||||
# [--gradle-version 9.4.1] [--agp 8.5.2] [--kotlin 2.0.20]
|
||||
# [--gradle-version 9.5] [--agp 9.0.0] [--kotlin 2.1.0]
|
||||
set -euo pipefail
|
||||
|
||||
DIR="" ; PKG="" ; NAME="My App"
|
||||
|
|
@ -30,10 +30,10 @@ esac; done
|
|||
[ -n "$TARGET_SDK" ] || TARGET_SDK="$COMPILE_SDK"
|
||||
|
||||
# --- version defaults: KEEP THIS TABLE CURRENT. AGP<->Gradle<->Kotlin must be compatible. ---
|
||||
# The caller (the model running the skill) should override these after checking release notes.
|
||||
[ -n "$GRADLE_VER" ] || GRADLE_VER="8.9"
|
||||
[ -n "$AGP" ] || AGP="8.5.2"
|
||||
[ -n "$KOTLIN" ] || KOTLIN="2.0.20"
|
||||
# AGP 9 has Kotlin built in — no kotlin-android plugin needed.
|
||||
[ -n "$GRADLE_VER" ] || GRADLE_VER="9.4.1"
|
||||
[ -n "$AGP" ] || AGP="9.2.1"
|
||||
[ -n "$KOTLIN" ] || KOTLIN="2.2.10"
|
||||
|
||||
echo ">> Scaffolding $PKG at $DIR (compileSdk=$COMPILE_SDK, AGP=$AGP, Gradle=$GRADLE_VER, Kotlin=$KOTLIN)"
|
||||
|
||||
|
|
@ -75,7 +75,6 @@ junit = { group = "junit", name = "junit", version.ref = "junit" }
|
|||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
||||
EOF
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ EOF
|
|||
cat > "$DIR/build.gradle.kts" <<EOF
|
||||
plugins {
|
||||
alias(libs.plugins.android.application) apply false
|
||||
alias(libs.plugins.kotlin.android) apply false
|
||||
alias(libs.plugins.kotlin.compose) apply false
|
||||
}
|
||||
EOF
|
||||
|
|
@ -92,7 +90,6 @@ EOF
|
|||
cat > "$DIR/app/build.gradle.kts" <<EOF
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +116,11 @@ android {
|
|||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
kotlinOptions { jvmTarget = "17" }
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
|
||||
}
|
||||
}
|
||||
buildFeatures { compose = true }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue