42c14fae59
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5.1 KiB
5.1 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | |||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| init_kotlin_app | pipeline | bash | pipelines | 1.0.0 | impure | init_kotlin_app(name: string, [--project <p>] [--desc <s>] [--tags <csv>] [--package <id>]) -> void | Scaffolder canonico de app Android Kotlin Compose con FnTheme + Roborazzi tests + e2e_checks declarados. Mirror exacto del patron init_cpp_app para el stack Kotlin. |
|
|
false | error_go_core |
|
Stdout con pasos y archivos creados. Exit 0 = scaffold completo y ready para build. Exit !=0 si falla validacion (nombre invalido, destino existe, proyecto inexistente) o git init. | false | bash/functions/pipelines/init_kotlin_app.sh |
Ejemplo
# App suelta en apps/<name>/
fn run init_kotlin_app my_scanner --desc "Escaner de documentos" --package "com.aurgi.scanner"
# App dentro de un proyecto
fn run init_kotlin_app expense_tracker --project budget --desc "Tracker de gastos" --tags "finance,mobile"
# Con package id personalizado
fn run init_kotlin_app pos_terminal --package "com.aurgi.pos" --desc "Terminal de punto de venta"
Que genera
apps/<name>/ (o projects/<p>/apps/<name>/)
├── settings.gradle.kts # rootProject + include(:app) + composite build ui
├── build.gradle.kts # top-level (apply false)
├── app/build.gradle.kts # Compose + Material3 + Roborazzi + tests
├── gradle.properties
├── gradlew # stub ejecutable
├── gradle/wrapper/gradle-wrapper.properties # Gradle 8.6
├── app/
│ └── src/
│ ├── main/
│ │ ├── AndroidManifest.xml # activity con LAUNCHER intent
│ │ ├── kotlin/<pkg_path>/
│ │ │ └── MainActivity.kt # FnTheme + Surface + Text("<name> ready")
│ │ └── res/values/strings.xml
│ ├── test/kotlin/<pkg_path>/
│ │ └── ExampleScreenshotTest.kt # Roborazzi: captura FnTheme + Surface
│ └── androidTest/kotlin/<pkg_path>/
│ └── MainActivityTest.kt # Compose ui-test: assertIsDisplayed("<name> ready")
├── app.md # frontmatter registry (lang:kt, framework:compose)
├── .gitignore
└── README.md
Composite build
La app apunta via includeBuild a kotlin/functions/ui del registry (FnTheme + FnTokens).
El path relativo se calcula automaticamente:
| Ubicacion | Path al composite |
|---|---|
apps/<name>/ |
../../kotlin/functions/ui |
projects/<p>/apps/<name>/ |
../../../../kotlin/functions/ui |
La dependencia se declara como implementation("fn.compose:ui") en app/build.gradle.kts.
e2e_checks generados
| id | cmd | timeout |
|---|---|---|
unit |
fn run gradle_unit_test_bash_infra <dir> |
240s |
screenshot |
fn run gradle_screenshot_test_bash_infra <dir> |
240s |
build |
fn run gradle_assemble_debug_bash_infra <dir> |
360s |
emu_start |
fn run android_emulator_start_bash_infra Medium_Phone_API_35 |
240s |
instrumented |
fn run gradle_instrumented_test_bash_infra <dir> |
600s |
emu_stop |
fn run android_emulator_stop_bash_infra |
30s (warning) |
Despues de crear
- Completar
uses_functionsenapp.mdcuando la app consuma funciones adicionales del registry. - Para tests Roborazzi: los snapshots se generan en
app/src/test/snapshots/images/(gitignored). Para actualizar golden images:./gradlew recordRoborazziDebug. - Para tests instrumentados se necesita un AVD creado con
avdmanager create avd -n Medium_Phone_API_35 ....
Notas
fn_theme_kt_uiyfn_tokens_kt_uise referencian enuses_functionsdelapp.mdgenerado aunque todavia no esten indexados en registry.db — son los modulos del composite build.ensure_repo_synced_bash_infrarequiereGITEA_URLyGITEA_TOKEN. Sin ellos se hacegit init + git commitlocal y se avisa al usuario.- Si
--project <p>se especifica, se ejecutafn indexal final para registrar la nueva app.