Skip to main content
The --setup command generates theme files for your project and validates your configuration.

Syntax

./gradlew lumo --setup

What It Does

The setup command performs the following actions:
  1. Validates the lumo.properties configuration file
  2. Checks that all required configuration properties are present
  3. Verifies the output directory structure
  4. Generates the Theme component with all necessary files
The setup command is essentially a shortcut for ./gradlew lumo --add Theme with configuration validation.

Prerequisites

You must run ./gradlew lumo --init and configure lumo.properties before using this command.
Required configuration in lumo.properties:
  • ThemeName - Your application theme name
  • ComponentsDir - Path to components directory
  • PackageName - Package name for generated files

Output

When successful, you’ll see output similar to:
Generating Theme ...

Generated supporting files:
/path/to/project/app/src/main/java/com/example/ui/components/theme/Color.kt
/path/to/project/app/src/main/java/com/example/ui/components/theme/Type.kt

Generated 'Theme' files:
/path/to/project/app/src/main/java/com/example/ui/components/theme/Theme.kt

'Theme' generated successfully.
Generated Files: 3
Scroll up to see the generated files.

Generated Files

The setup command generates theme-related files in your configured ComponentsDir:
Main theme file containing:
  • Material3 theme configuration
  • Color scheme setup
  • Typography configuration
  • Theme composable function
Color definitions including:
  • Light color scheme
  • Dark color scheme
  • Theme color palette
Typography configuration:
  • Font family definitions
  • Text style configurations
  • Material3 typography setup

Configuration Validation

The setup command validates:
Directory paths exist or can be created
Package names are valid
All required properties are configured
Theme name is specified

Error Cases

Plugin Not Initialized
The plugin is not setup. Run the plugin with --init to get started.
Solution: Run ./gradlew lumo --init first.
Missing Configuration
Missing required configs in lumo.properties. Expected: [ThemeName, ComponentsDir, PackageName].
Solution: Ensure all required properties are set in lumo.properties.
Files Already Exist
Failed to generate some files as they already exist:
/path/to/Theme.kt
Solution: The theme files already exist. Delete them if you want to regenerate, or skip this step.
Invalid Directory Path
Failed to create parent directory: /invalid/path
Possible reasons: existing file or any of the parent directory does not exists.
Solution: Check that ComponentsDir in lumo.properties is a valid, accessible path.

Using Generated Theme

After running setup, you can use the theme in your composable functions:
import com.example.ui.components.theme.MyAppTheme

@Composable
fun App() {
    MyAppTheme {
        // Your app content
        MainScreen()
    }
}

Kotlin Multiplatform Projects

For Kotlin Multiplatform projects:
  1. Set KotlinMultiplatform=true in lumo.properties
  2. Ensure ComponentsDir points to your commonMain source set
  3. The plugin will generate platform-specific files when needed
ThemeName=MyAppTheme
ComponentsDir=shared/src/commonMain/kotlin/com/example/ui/components
PackageName=com.example.ui.components
KotlinMultiplatform=true

Next Steps

After setup:
  1. Review generated files - Customize colors and typography as needed
  2. Add components - Use the add command to add UI components
  3. Build your app - Start using the theme and components in your application
# Add individual components
./gradlew lumo --add Button
./gradlew lumo --add Card

# Or add all components at once
./gradlew lumo --add-all
Run setup only once per project. If you need to regenerate theme files, delete the existing files first or customize them directly.

Build docs developers (and LLMs) love