Skip to content

ilmat192/kotlin-native-calculator-sample

Repository files navigation

Calculator sample

This example shows how to use Kotlin common module (located in parser/src) in different environments. Currently for

Android App

The common library may be used to build an Android application.

To build and run the Android sample do the following:

  1. Open the root project in Android Studio
  2. Create a new Android App configuration. Choose module android.
  3. Now build and run the configuration created.

iOS

The iOS project compile the common library to a framework (see ios). The framework can be easily included in an existing iOS project (e.g. written in Swift or Objective-C)

To build and run the iOS sample do the following:

  1. Open calculator.xcodeproj with Xcode.

  2. Open the project's target through project navigator, go to tab 'General'. In 'Identity' section change the bundle ID to the unique string in reverse-DNS format. Then select the team in 'Signing' section.

    See the Xcode documentation for more info.

  3. Now build and run the application with Xcode.

The sample consists of:

  1. Xcode iOS application project, written in Swift. It uses Kotlin library to parse simple arithmetic expressions.
  2. Kotlin library source code and build script. It is built into Objective-C framework by invoking Gradle from custom "Run Script" build phase, and this framework is imported into the Xcode project.

Plain JVM

The common library can also be compiled to a JVM-application by Kotlin/JVM compiler with Gradle. To build and run it, go to jvm directory and use

../gradlew run

To build the distribution:

../gradlew distZip

(the result will be available as jvm/build/distributions/KotlinCalculator.zip)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published