Overview
The Lumo UI Gradle Plugin provides a single tasklumo with multiple command-line options for different operations.
lumo Task
Task Name:lumo
Type: LumoTask
Registration: Automatically registered on the root project when the plugin is applied
Basic Usage
Task Options
—init
Initialize the Lumo UI Plugin in your project.- Creates a
lumo.propertiesconfiguration file in the project root - Displays required dependencies that need to be added to
build.gradle.kts - Exits with an error if the plugin is already initialized
- Success message with the path to the created configuration file
- List of required Compose dependencies
—setup
Setup the theme component and verify your configuration.- Validates the
lumo.propertiesconfiguration - Generates the Theme component files
- Creates the base theme structure (Color.kt, Typography.kt, Theme.kt)
- The plugin must be initialized (
--init) - The
lumo.propertiesfile must be properly configured - The components directory must exist
—required-deps
Display the required dependencies for your project.- Shows the list of Compose dependencies required by Lumo UI
- Adapts the output based on whether you’re using Kotlin Multiplatform
—add
Add a specific UI component to your project.<ComponentName>- Name of the component to generate (case-sensitive)
- Validates the component name
- Generates the component file(s)
- Generates all supporting files and dependencies
- Creates platform-specific files for Kotlin Multiplatform projects
- Skips existing files to prevent overwriting
—add-all
Add all available UI components to your project.- Generates all components from the
SupportedComponentsenum - Generates each component with its dependencies
- Provides a summary for each component generation
—available-components
List all available components that can be generated.—plugin-help
Display help information for the plugin.Task Behavior
Validation
All operations (except--init and --plugin-help) validate the configuration before execution:
- Configuration File Check: Verifies
lumo.propertiesexists - Required Properties Check: Ensures all required properties are set
- Directory Validation: Confirms the components directory exists
- Package Name Validation: Validates that the directory path matches the package name
File Generation
The plugin uses a template-based system:- Template Loading: Loads component templates from plugin resources
- Placeholder Replacement: Replaces
{{packageName}}and{{themeName}}with configured values - Dependency Resolution: Recursively resolves component dependencies
- File Writing: Writes generated files to the configured directory
- Collision Detection: Skips files that already exist
Platform-Specific Generation
For Kotlin Multiplatform projects (KotlinMultiplatform=true):
- Generates common files in the
commonMainsource set - Generates platform-specific files in appropriate source sets:
androidMainiosMaindesktopMainjsMainwasmJsMainmacosMain
commonMain/kotlin/.../Tooltip.ktandroidMain/kotlin/.../Tooltip.android.ktiosMain/kotlin/.../Tooltip.ios.ktdesktopMain/kotlin/.../Tooltip.desktop.kt- etc.
Output and Logging
The plugin uses colored console output:- Red: Errors and critical issues
- Yellow: Warnings (e.g., files already exist, skipped files)
- Green: Success messages
- Blue: Informational messages
- Cyan: Debug messages
Exit Codes
The task will fail (non-zero exit code) when:- No valid option is provided
- Configuration validation fails
- Invalid component name is provided
- Required files or directories don’t exist
- Template files are missing