Thanks to visit codestin.com
Credit goes to github.com

Skip to content

๐Ÿ› Amper playground for Kotlin JVM & Multiplatform apps

Notifications You must be signed in to change notification settings

sureshg/kmp-amper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Kotlin Multiplatform CLI

A Kotlin Multiplatform command-line application targeting macOS, Windows, Linux, and JVM platforms, built with Amper build tools. This project demonstrates a pleasant cross-platform development experience with modern Kotlin tooling.

Usage

# Update the amper
$ ./amper update --dev

# Build the app and create an executable jar
$ ./amper build [-v release]
$ ./amper package

# Run the tests
$ ./amper test

# Run the app
$ ./amper run --jvm-args=--enable-preview -m jvm
$ ./amper run -m macos --platform macosArm64

# JDK Incubator modules
$ ./amper run -m jvm \
              --jvm-args="--enable-preview --add-modules=jdk.incubator.vector --enable-native-access=ALL-UNNAMED" \
              --main-class=AppKt

# Dependency insights
$ ./amper show dependencies -m jvm --scope=runtime --filter=org.jetbrains.kotlin:kotlin-stdlib

# Check version updates in amper version catalog
$ brew install deezer/repo/caupain
$ caupain -i libs.versions.toml

# Publish to mavenLocal
$ ./amper publish mavenLocal

# List all the binaries
$ find . \( -path "*/build/*" -type f -perm +111 -o -path "*/build/*executableJar*/*.jar" \) | grep -v -E "(test|debug|dSYM)" | xargs du -h | sort -hr

$ find . \( -path "*/build/*" -perm +111 -o -path "*/build/tasks/*executableJar*/*.jar" \) -type f -ls | awk '{printf "%.3fM %s\n",$7/1048576,$NF}' | sort -rn
  • Run on JVM
$ java --enable-preview \
       --add-modules=jdk.incubator.vector \
       --enable-native-access=ALL-UNNAMED \
       -jar build/tasks/_jvm_executableJarJvm/jvm-jvm-executable.jar
  • Run on MacOS:
# Run MacOS Binary
$ build/tasks/_macos_linkMacosArm64Release/macos.kexe

# Show the logs
$ log stream \
  --info \
  --style syslog \
  --predicate 'senderImagePath ENDSWITH "macos.kexe"'

$ log show \
  --info \
  --style syslog \
  --predicate 'senderImagePath ENDSWITH "macos.kexe"' \
  --last 5m
  
# Run Win Binary
$ docker run --rm --platform="linux/amd64" \
             -e DISPLAY=host.docker.internal:0 \
             -v "$PWD":/work \
             scottyhardy/docker-wine:latest wine /work/build/tasks/_windows_linkMingwX64Release/windows.exe  

Tip

You can find all the Amper CLI dev versions here

Amper Config Settings

Configuration ๐Ÿ“ Description ๐ŸŽฏ Applies To
settings.kotlin Settings for the Kotlin compiler, thus only apply to Kotlin sources ๐ŸŸฃ Kotlin sources
settings.java Settings for the Java compiler, thus only apply to Java sources โ˜• Java sources
settings.jvm Settings that apply to both Java and Kotlin sources (some common compiler options, settings related to the JDK in general, to the test JVM, etc.) ๐Ÿ”„ Both Java and Kotlin sources

About

๐Ÿ› Amper playground for Kotlin JVM & Multiplatform apps

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •