### Example recipe.yaml Configuration Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-geminio/docs/en/RECIPE_CONTENT.md A complete example of a `recipe.yaml` file, illustrating all major sections: `requiredParams`, `optionalParams`, `predefinedFeatures`, `widgets`, `globals`, and `recipe`. This file defines parameters for creating a fragment and specifies the steps for generating files and adding dependencies. ```yaml requiredParams: name: HeadHunter BaseFragment description: Creates HeadHunter BaseFragment # optional optionalParams: revision: 1 category: fragment formFactor: mobile constraints: - kotlin screens: - fragment_gallery - menu_entry minApi: 7 minBuildApi: 8 # required only for modules templates predefinedFeatures: - enableModuleCreationParams: defaultPackageNamePrefix: ru.hh.test # optional defaultSourceCodeFolderName: java # optional defaultSourceSetName: main widgets: - stringParameter: id: className name: Fragment Name help: The name of the fragment class to create constraints: - class - nonempty - unique default: BlankFragment - stringParameter: id: fragmentName name: Fragment Layout Name help: The name of the layout to create constraints: - layout - nonempty - unique default: fragment_blank suggest: ${className.classToResource()} - booleanParameter: id: includeFactory name: Include fragment factory method? help: Generate static fragment factory method for easy instantiation default: true - booleanParameter: id: includeModule name: Include Toothpick Module class? help: Generate fragment Toothpick Module for easy instantiation default: true - stringParameter: id: moduleName name: Fragment Toothpick Module help: The name of the Fragment Toothpick Module to create constraints: - class - nonempty - unique default: BlankModule visibility: ${includeModule} suggest: ${className.classToResource().underscoreToCamelCase()}Module globals: - stringParameter: id: reducerClassName value: ${moduleName}Reducer - booleanParameter: id: anotherBooleanFlag value: true recipe: - mkDirs: - ${srcOut}: - api - di: - modules - outer - domain: - interactors - repositories - ui - ${resOut}: - layout - drawables - values - instantiateAndOpen: from: root/src/app_package/BlankFragment.kt.ftl to: ${srcOut}/${className}.kt - instantiate: from: root/res/layout/fragment_blank.xml.ftl to: ${resOut}/layout/${fragmentName}.xml - instantiate: from: root/src/app_package/BlankViewModel.kt.ftl to: ${currentDirOut}/presentation/${className}ViewModel.kt - open: file: ${resOut}/layout/${fragmentName}.xml - predicate: validIf: ${includeModule} commands: - instantiate: from: root/src/app_package/BlankModule.kt.ftl to: ${srcOut}/di/${moduleName}.kt - open: file: ${srcOut}/di/${moduleName}.kt elseCommands: - instantiateAndOpen: from: root/src/app_package/AnotherModule.kt.ftl to: ${srcOut}/di/${moduleName}.kt - addDependencies: - implementation: Libs.jetpack.compose - kapt: Libs.di.toothpick - ksp: Libs.jetpack.room - compileOnly: com.github.stephanenicolas.toothpick:toothpick:3.1.0 - testImplementation: :shared-core-test - androidTestImplementation: Libs.uiTests.kaspresso - addGradlePlugins: - kotlinx.serialization - kotlin-kapt ``` -------------------------------- ### YAML Dependency Format Example Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-geminio/docs/en/recipe_content/recipe_commands/ADD_DEPENDENCIES.md Illustrates the basic YAML structure for defining a single dependency entry used by the `addDependencies` command. It consists of a configuration type and the dependency notation. ```YAML - : ``` -------------------------------- ### Geminio Plugin Configuration YAML Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-geminio/docs/en/PLUGIN_CONFIG.md Example configuration file for the Geminio plugin. It specifies the root directories for template and module template folders and defines custom names for the groups that appear in the 'New' menu in Android Studio. ```YAML templatesRootDirPath: /android-style-guide/geminio/templates modulesTemplatesRootDirPath: /android-style-guide/geminio/modules_templates groupsNames: forNewGroup: HH Templates forNewModulesGroup: HH Modules ``` -------------------------------- ### Example recipe.yaml Structure Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-geminio/docs/ru/RECIPE_CONTENT.md This YAML snippet illustrates the typical structure of a `recipe.yaml` file. It includes sections for mandatory and optional parameters, predefined features, UI widgets for user input, global variables, and the core recipe commands that define the template generation process. ```yaml requiredParams: name: HeadHunter BaseFragment description: Creates HeadHunter BaseFragment # optional optionalParams: revision: 1 category: fragment formFactor: mobile constraints: - kotlin screens: - fragment_gallery - menu_entry minApi: 7 minBuildApi: 8 # required only for modules templates predefinedFeatures: - enableModuleCreationParams: defaultPackageNamePrefix: ru.hh.test # optional defaultSourceCodeFolderName: java # optional defaultSourceSetName: main widgets: - stringParameter: id: className name: Fragment Name help: The name of the fragment class to create constraints: - class - nonempty - unique default: BlankFragment - stringParameter: id: fragmentName name: Fragment Layout Name help: The name of the layout to create constraints: - layout - nonempty - unique default: fragment_blank suggest: fragment_${className.classToResource()} - booleanParameter: id: includeFactory name: Include fragment factory method? help: Generate static fragment factory method for easy instantiation default: true - booleanParameter: id: includeModule name: Include Toothpick Module class? help: Generate fragment Toothpick Module for easy instantiation default: true - stringParameter: id: moduleName name: Fragment Toothpick Module help: The name of the Fragment Toothpick Module to create constraints: - class - nonempty - unique default: BlankModule visibility: ${includeModule} suggest: ${className.classToResource().underscoreToCamelCase()}Module globals: - stringParameter: id: reducerClassName value: ${moduleName}Reducer - booleanParameter: id: anotherBooleanFlag value: true recipe: - mkDirs: - ${srcOut}: - api - di: - modules - outer - domain: - interactors - repositories - ui - ${resOut}: - layout - drawables - values - instantiateAndOpen: from: root/src/app_package/BlankFragment.kt.ftl to: ${srcOut}/${className}.kt - instantiate: from: root/res/layout/fragment_blank.xml.ftl to: ${resOut}/layout/${fragmentName}.xml - instantiate: from: root/src/app_package/BlankViewModel.kt.ftl to: ${currentDirOut}/presentation/${className}ViewModel.kt - open: file: ${resOut}/layout/${fragmentName}.xml - predicate: validIf: ${includeModule} commands: - instantiate: from: root/src/app_package/BlankModule.kt.ftl to: ${srcOut}/di/${moduleName}.kt - open: file: ${srcOut}/di/${moduleName}.kt elseCommands: - instantiateAndOpen: from: root/src/app_package/AnotherModule.kt.ftl to: ${srcOut}/di/${moduleName}.kt - addDependencies: - implementation: Libs.jetpack.compose - kapt: Libs.di.toothpick - ksp: Libs.jetpack.room - compileOnly: com.github.stephanenicolas.toothpick:toothpick:3.1.0 - testImplementation: :shared-core-test - androidTestImplementation: Libs.uiTests.kaspresso - addGradlePlugins: - kotlinx.serialization - kotlin-kapt ``` -------------------------------- ### Defining Recipe Actions with Expressions in YAML Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-geminio/docs/en/EXPRESSIONS.md Examples illustrating how to use expressions within recipe actions like `open`, `instantiate`, and `instantiateAndOpen` in a YAML configuration. These expressions often use special output path parameters like `srcOut`, `rootOut`, `resOut`, and `manifestOut`. ```YAML - open: file: ${srcOut}/di/${moduleName}.kt - instantiate: from: root/build.gradle.ftl to: ${rootOut}/build.gradle - instantiateAndOpen: from: root/res/layout/fragment_container.xml.ftl to: ${resOut}/layout/${fragmentName}.xml - instantiateAndOpen: from: root/main/AndroidManifest.xml to: ${manifestOut}/AndroidManifest.xml ``` -------------------------------- ### Defining Widget Expressions in YAML Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-geminio/docs/en/EXPRESSIONS.md Examples demonstrating how to define expressions for widget settings in a YAML configuration. These expressions can evaluate to strings or booleans, using dynamic parameters enclosed in `${}` and potentially extension functions. ```YAML suggest: fragment_${className.classToResource().underscoreToCamelCase()} visibility: ${includeModule} availability: true ``` -------------------------------- ### YAML Format for Gradle Plugin ID Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-geminio/docs/en/recipe_content/recipe_commands/ADD_GRADLE_PLUGINS.md This snippet shows the required format for listing a single Gradle plugin identifier in the input list for the `addGradlePlugins` command. Each item in the list should start with a hyphen (`-`) followed by the plugin identifier without quotes. ```yaml - ``` -------------------------------- ### Defining Hidden Globals in Recipe YAML Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-geminio/docs/en/recipe_content/GLOBALS.md This YAML snippet demonstrates how to define hidden global parameters within the `globals` section of a `recipe.yaml` file. It shows examples of a `stringParameter` and a `booleanParameter`, each with an `id` and a `value` expression. These parameters are typically used internally by FTL templates. ```yaml globals: - stringParameter: id: diModuleClassName value: ${__formattedModuleName}Module - booleanParameter: id: someFlag value: ${anotherFlag} ``` -------------------------------- ### Configure Default Package Name, Source Folder, and Source Set (YAML) Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-geminio/docs/en/recipe_content/PREDEFINED_FEATURES.md This YAML snippet demonstrates how to enable the `enableModuleCreationParams` feature and configure default values for the package name prefix, source code folder name (e.g., 'java' or 'kotlin'), and the source set name (e.g., 'main') for new modules. ```YAML predefinedFeatures: - enableModuleCreationParams: defaultPackageNamePrefix: ru.hh.test defaultSourceCodeFolderName: java defaultSourceSetName: main ``` -------------------------------- ### Build Garcon Plugin Archive with Gradle Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-garcon/README.md This command executes the Gradle task `buildPlugin` to compile the Garcon plugin project and create a distributable zip archive. The resulting archive will be located in the `./build/distributions` directory. ```Shell ./gradlew buildPlugin ``` -------------------------------- ### Configure Default Package Name Prefix (YAML) Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-geminio/docs/en/recipe_content/PREDEFINED_FEATURES.md This YAML snippet shows how to enable the `enableModuleCreationParams` feature and set a default package name prefix for newly created modules. The specified prefix will be used unless overridden. ```YAML predefinedFeatures: enableModuleCreationParams: defaultPackageNamePrefix: ru.hh.test ``` -------------------------------- ### Initializing Yaml with CustomClassLoaderConstructor (Old) - Kotlin Source: https://github.com/hhru/android-multimodule-plugin/blob/master/docs/geminio/geminio_support_new_android_studio.md This snippet shows the previous method for initializing the `Yaml` object using `CustomClassLoaderConstructor` with only the class and class loader arguments. This approach became incompatible after the `snakeyaml` library was updated in Android Studio Iguana. ```Kotlin val yaml = Yaml( CustomClassLoaderConstructor( T::class.java, T::class.java.classLoader ) ) ``` -------------------------------- ### Initializing Yaml with CustomClassLoaderConstructor (New) - Kotlin Source: https://github.com/hhru/android-multimodule-plugin/blob/master/docs/geminio/geminio_support_new_android_studio.md This snippet demonstrates the updated method for initializing the `Yaml` object after the `snakeyaml` library version changed. It now requires an additional `LoaderOptions()` argument in the `CustomClassLoaderConstructor`. ```Kotlin val yaml = Yaml( CustomClassLoaderConstructor( T::class.java, T::class.java.classLoader, LoaderOptions(), ) ) ``` -------------------------------- ### YAML format for adding dependencies Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-geminio/docs/ru/recipe_content/recipe_commands/ADD_DEPENDENCIES.md Defines the YAML structure for specifying a dependency to be added by the `addDependencies` command. Each entry requires a configuration type (e.g., `implementation`, `api`) and the dependency notation (Maven artifact, project reference, or library constant). ```YAML - : ``` -------------------------------- ### Defining Module Directory Structure (YAML) Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-geminio/docs/en/recipe_content/recipe_commands/MK_DIRS.md This YAML snippet demonstrates the structure for the `mkDirs` command. It defines the desired folder hierarchy within a module, using placeholders like `${srcOut}` and `${resOut}` for base directories. Each list item represents a top-level directory under which nested folders can be specified. ```YAML mkDirs: - ${srcOut}: - api - di: - modules - outer - ui: - presenters - ${resOut}: - layout - drawables - values ``` -------------------------------- ### Adding Gradle Plugin ID in YAML Source: https://github.com/hhru/android-multimodule-plugin/blob/master/plugins/hh-geminio/docs/ru/recipe_content/recipe_commands/ADD_GRADLE_PLUGINS.md Specifies a single Gradle plugin ID to be added to the module's build.gradle file using the `addGradlePlugins` command. The plugin ID should be provided without quotes. ```YAML - ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.