Skip to main content
The --add-all command generates all available UI components and their dependencies in your project.

Syntax

./gradlew lumo --add-all

What It Does

The add-all command:
  1. Validates your lumo.properties configuration
  2. Iterates through all available components
  3. Generates each component file and its dependencies
  4. Creates platform-specific files for Kotlin Multiplatform projects
  5. Provides a summary for each component
This command is equivalent to running ./gradlew lumo --add <ComponentName> for every available component.

Components Generated

The command generates all 26 components:
  • Button
  • Checkbox
  • Chip
  • IconButton
  • OTPTextField
  • RadioButton
  • Slider
  • Switch
  • TextField
  • Card
  • Divider
  • ModalBottomSheet
  • Scaffold
  • Surface
  • SystemBars
  • AlertDialog
  • ProgressIndicators
  • Snackbar
  • Tooltip
  • Accordion
  • Badge
  • Icon
  • Text
  • Theme

Output Example

When successful, you’ll see output for each component:
Generating Accordion ...
Generated 'Accordion' files:
/path/to/project/app/src/main/java/com/example/ui/components/Accordion.kt
'Accordion' generated successfully.
Generated Files: 1

Generating AlertDialog ...
Generated 'AlertDialog' files:
/path/to/project/app/src/main/java/com/example/ui/components/AlertDialog.kt
'AlertDialog' generated successfully.
Generated Files: 1

Generating Badge ...
Generated supporting files:
/path/to/project/app/src/main/java/com/example/ui/components/Surface.kt
Generated 'Badge' files:
/path/to/project/app/src/main/java/com/example/ui/components/Badge.kt
'Badge' generated successfully.
Generated Files: 2

... (continues for all components)

Prerequisites

Ensure you have completed the initial setup before running this command.
Required steps:
  1. Run ./gradlew lumo --init
  2. Configure lumo.properties with your project details
  3. Add required dependencies to build.gradle.kts
  4. Run ./gradlew lumo --setup to generate theme files

File Structure

After running add-all, your components directory will contain:
ComponentsDir/
├── Accordion.kt
├── AlertDialog.kt
├── Badge.kt
├── Button.kt
├── Card.kt
├── Checkbox.kt
├── Chip.kt
├── Divider.kt
├── Icon.kt
├── IconButton.kt
├── ModalBottomSheet.kt
├── NavigationBar.kt
├── OTPTextField.kt
├── ProgressIndicators.kt
├── RadioButton.kt
├── Scaffold.kt
├── Slider.kt
├── Snackbar.kt
├── Surface.kt
├── Switch.kt
├── SystemBars.kt
├── Text.kt
├── TextField.kt
├── Tooltip.kt
├── TopBar.kt
└── theme/
    ├── Theme.kt
    ├── Color.kt
    └── Type.kt

Handling Existing Files

The command will skip files that already exist rather than overwriting them.
If components already exist:
Generating Button ...
Failed to generate some files as they already exist:
/path/to/Button.kt
'Button' generated successfully.
Generated Files: 0
Failed to Generate: 1
This prevents accidental overwrites of customized components.

Performance

Generating all components typically takes:
  • Android projects: 10-30 seconds
  • Kotlin Multiplatform projects: 20-60 seconds (due to platform-specific files)
The exact time depends on:
  • Number of components
  • Number of target platforms (for KMP)
  • File system performance

Error Cases

Configuration Not Found
The plugin is not setup. Run the plugin with --init to get started.
Solution: Complete initialization first.
Invalid Directory
Failed to create parent directory: /invalid/path
Possible reasons: existing file or any of the parent directory does not exists.
Solution: Verify ComponentsDir in lumo.properties is a valid path.
Missing Configuration Properties
Missing required configs in lumo.properties. Expected: [ThemeName, ComponentsDir, PackageName].
Solution: Ensure all required properties are set in lumo.properties.

Kotlin Multiplatform Projects

For Kotlin Multiplatform projects with KotlinMultiplatform=true:
  • Common components go to commonMain
  • Platform-specific implementations are generated when needed
  • The plugin automatically detects available source sets
Example output:
Generating SystemBars ...

Generated 'SystemBars' files:
/path/to/shared/src/commonMain/kotlin/com/example/ui/components/SystemBars.kt
/path/to/shared/src/androidMain/kotlin/com/example/ui/components/SystemBars.android.kt
/path/to/shared/src/iosMain/kotlin/com/example/ui/components/SystemBars.ios.kt

'SystemBars' generated successfully.
Generated Files: 3

Selective vs Complete Generation

  • Starting a new project
  • You want the complete component library
  • Building a comprehensive design system
  • You have unlimited bundle size

After Generation

Once all components are generated:
  1. Review the files - Check that all components were created successfully
  2. Customize as needed - Modify components to match your design system
  3. Build your project - Run ./gradlew build to ensure everything compiles
  4. Start using components - Import and use them in your UI code
import com.example.ui.components.*
import com.example.ui.components.theme.MyAppTheme

@Composable
fun App() {
    MyAppTheme {
        Scaffold(
            topBar = { TopBar(title = "My App") },
            bottomBar = { NavigationBar { /* nav items */ } }
        ) { padding ->
            Card(modifier = Modifier.padding(padding)) {
                Text("Welcome!")
                Button(onClick = { /* action */ }) {
                    Text("Get Started")
                }
            }
        }
    }
}

Cleaning Up

If you want to regenerate all components:
# Remove all generated components
rm -rf path/to/components/*

# Regenerate
./gradlew lumo --add-all
Be careful when deleting components if you’ve made customizations. Consider using version control to track changes.

Tips

Start with add-allFor new projects, it’s often easier to generate all components upfront, then delete the ones you don’t need.
Use version controlCommit generated components to git so you can track customizations and revert if needed.
Incremental approachIf unsure, start with --setup and specific --add commands, then use --add-all later if you need more components.

Next Steps

Build docs developers (and LLMs) love