Skip to main content

Overview

The Lumo UI Gradle Plugin provides a single task lumo 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

./gradlew lumo [--option]

Task Options

—init

Initialize the Lumo UI Plugin in your project.
./gradlew lumo --init
What it does:
  • Creates a lumo.properties configuration 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
Output:
  • Success message with the path to the created configuration file
  • List of required Compose dependencies
Example Output:
Default config file created at: /path/to/project/lumo.properties
Initialised successfully. List of required dependencies printed above.

The plugin requires the following dependencies to your build.gradle.kts file:
api(platform("androidx.compose:compose-bom:2024.12.01"))
api("androidx.compose.foundation:foundation")
...

—setup

Setup the theme component and verify your configuration.
./gradlew lumo --setup
What it does:
  • Validates the lumo.properties configuration
  • Generates the Theme component files
  • Creates the base theme structure (Color.kt, Typography.kt, Theme.kt)
Prerequisites:
  • The plugin must be initialized (--init)
  • The lumo.properties file must be properly configured
  • The components directory must exist
Example Output:
Generating Theme ...

Generated supporting files:
/path/to/project/ui-components/.../Color.kt
/path/to/project/ui-components/.../Typography.kt

Generated 'Theme' files:
/path/to/project/ui-components/.../Theme.kt

'Theme' generated successfully.
Generated Files: 3

—required-deps

Display the required dependencies for your project.
./gradlew lumo --required-deps
What it does:
  • Shows the list of Compose dependencies required by Lumo UI
  • Adapts the output based on whether you’re using Kotlin Multiplatform
Android Project Output:
The plugin requires the following dependencies to your build.gradle.kts file:
api(platform("androidx.compose:compose-bom:2024.12.01"))
api("androidx.compose.foundation:foundation")
api("androidx.compose.foundation:foundation-layout")
api("androidx.compose.ui:ui")
api("androidx.compose.ui:ui-tooling")
api("androidx.compose.ui:ui-tooling-preview")
api("androidx.compose.ui:ui-util")
api("androidx.compose.material:material-ripple:1.7.6")
Kotlin Multiplatform Project Output:
The plugin requires the following dependencies to your build.gradle.kts file:
api("compose.runtime")
api("compose.foundation")
api("compose.material3")
api("compose.ui")

—add

Add a specific UI component to your project.
./gradlew lumo --add <ComponentName>
Parameters:
  • <ComponentName> - Name of the component to generate (case-sensitive)
Examples:
# Add a Button component
./gradlew lumo --add Button

# Add a TextField component
./gradlew lumo --add TextField

# Add a Card component
./gradlew lumo --add Card
What it does:
  • 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
Example Output:
Generating Button ...

Generated supporting files:
/path/to/project/.../foundation/ButtonElevation.kt
/path/to/project/.../foundation/Elevation.kt
/path/to/project/.../foundation/Ripple.kt

Generated 'Button' files:
/path/to/project/.../Button.kt

'Button' generated successfully.
Generated Files: 4
Error Handling:
Lumo UI Plugin: Invalid component name InvalidName. 
Find supported components: https://lumoui.com

—add-all

Add all available UI components to your project.
./gradlew lumo --add-all
What it does:
  • Generates all components from the SupportedComponents enum
  • Generates each component with its dependencies
  • Provides a summary for each component generation
Warning: This will generate a large number of files. Use with caution in existing projects.

—available-components

List all available components that can be generated.
./gradlew lumo --available-components
Example Output:
Available components:
Accordion
AlertDialog
Badge
Button
Card
Checkbox
Chip
Divider
Icon
IconButton
ModalBottomSheet
NavigationBar
OTPTextField
ProgressIndicators
RadioButton
Scaffold
Slider
Surface
Snackbar
Switch
SystemBars
Text
TextField
Theme
Tooltip
TopBar

—plugin-help

Display help information for the plugin.
./gradlew lumo --plugin-help
Example Output:
Usage: ./gradlew lumo --option <value>

Options:
  --init                  Initialize Lumo UI Plugin
  --setup                 Setup theme to get started and verify the configs
  --required-deps         Returns the required dependencies to be added to the build.gradle.kts file
  --add <component>       Add a new Lumo UI Component
  --plugin-help           Display this help message

Task Behavior

Validation

All operations (except --init and --plugin-help) validate the configuration before execution:
  1. Configuration File Check: Verifies lumo.properties exists
  2. Required Properties Check: Ensures all required properties are set
  3. Directory Validation: Confirms the components directory exists
  4. Package Name Validation: Validates that the directory path matches the package name

File Generation

The plugin uses a template-based system:
  1. Template Loading: Loads component templates from plugin resources
  2. Placeholder Replacement: Replaces {{packageName}} and {{themeName}} with configured values
  3. Dependency Resolution: Recursively resolves component dependencies
  4. File Writing: Writes generated files to the configured directory
  5. Collision Detection: Skips files that already exist

Platform-Specific Generation

For Kotlin Multiplatform projects (KotlinMultiplatform=true):
  • Generates common files in the commonMain source set
  • Generates platform-specific files in appropriate source sets:
    • androidMain
    • iosMain
    • desktopMain
    • jsMain
    • wasmJsMain
    • macosMain
Example:
./gradlew lumo --add Tooltip
Generates:
  • commonMain/kotlin/.../Tooltip.kt
  • androidMain/kotlin/.../Tooltip.android.kt
  • iosMain/kotlin/.../Tooltip.ios.kt
  • desktopMain/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

Common Workflows

Initial Setup

# 1. Initialize the plugin
./gradlew lumo --init

# 2. Edit lumo.properties with your project details
vim lumo.properties

# 3. Add dependencies to build.gradle.kts
./gradlew lumo --required-deps

# 4. Setup theme
./gradlew lumo --setup

Adding Components

# List available components
./gradlew lumo --available-components

# Add specific components
./gradlew lumo --add Button
./gradlew lumo --add TextField
./gradlew lumo --add Card

Troubleshooting

# Verify configuration
./gradlew lumo --setup

# Check required dependencies
./gradlew lumo --required-deps

# Get help
./gradlew lumo --plugin-help

See Also

Build docs developers (and LLMs) love