Skip to content

Repository files navigation

Compose Multiplatform Calculator

A Compose Multiplatform demo app with support for Windows and Android.

Compose Multiplatform Calculator Screenshot

Documentation available in the following Getting started with Compose Multiplatform article.

Desktop

To build and run the development version of the desktop app, use the run configuration from the run widget in your IDE's toolbar or run it directly from the terminal:

  • on macOS/Linux/Powershell
    ./gradlew :composeApp:hotRunJvm --auto
  • on Windows Batch
    .\gradlew.bat :composeApp:hotRunJvm --auto

To generate an installer for your current Operating System, run from the terminal:

  • on macOS/Linux/Powershell
    ./gradlew packageDistributionForCurrentOS
  • on Windows Batch
    .\gradlew.bat packageDistributionForCurrentOS

Android

  • Use IDE to run the project from the MainActivity (See the last paragraph of Getting started with Compose Multiplatform).
  • Use IDE to build and package your Android project (Build menu).

Common commands

macOS/Linux/Powershell

# Run application with hot reload
./gradlew :composeApp:hotRunJvm --auto
# Basic build (includes resources generation), without Android specific build
./gradlew :composeApp:jvmJar
# Full build, including Android
./gradlew build
# Generate lint report
./gradlew :composeApp:lint
# Generate installer
./gradlew packageDistributionForCurrentOS
# Package .jar that can be run with: java -jar <jarName>
./gradlew :composeApp:packageUberJarForCurrentOS
# Deletes the build directory
./gradlew :composeApp:clean
# Displays the tasks runnable from project ':composeApp'
./gradlew :composeApp:tasks

Windows batch

# Run application with hot reload
.\gradlew.bat :composeApp:hotRunJvm --auto
# Basic build (includes resources generation), without Android specific build
.\gradlew.bat :composeApp:jvmJar
# Full build, including Android
.\gradlew.bat build
# Generate lint report
.\gradlew.bat :composeApp:lint
# Generate installer
.\gradlew.bat packageDistributionForCurrentOS
# Package .jar that can be run with: java -jar <jarName>
.\gradlew.bat :composeApp:packageUberJarForCurrentOS
# Deletes the build directory
.\gradlew.bat :composeApp:clean
# Displays the tasks runnable from project ':composeApp'
.\gradlew.bat :composeApp:tasks

About

A simple desktop calculator implemented using Compose for Desktop

Resources

Stars

16 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages