Skip to content

funttastic/universal_kotlin

Repository files navigation

Universal Kotlin Logo

Universal Kotlin

One language to rule them all!


Status

AppVeyour (Windows)

CircleCI (Linux)

Travis (MacOS)

Overview

Universal Kotlin is a project that aims to run on the most popular platforms using just Kotlin. Also, one of its goals is to use shared code from the common modules and libraries in all other ones.

Architecture

  • buildSrc: Kotlin DSL module to help with the build scripts
  • common
  • library
  • application
    • backend
      • js
        • express: Express API application (not yet implemented)
      • jvm
    • browser
      • js
        • spa
          • react: React with Webpack application
        • vanilla: Vanilla JavaScript with Webpack application
      • native
        • wasm32: WebAssembly application
    • desktop
      • jvm
        • tornado_fx: TornadoFX application for Windows, Linux and Mac
    • mobile
    • script
      • jvm
        • script: Script application running through KScript (not using common modules yet)
    • television
      • native
        • apple
          • tvos
            • tvos_x64: tvOS X64 application (not yet implemented)
    • terminal
    • watch
      • native
        • apple
          • watchos
            • watchos_x64: watchOS X64 application (not yet implemented)
  • plugin
    • gradle: Gradle plugin (not using common modules)

This structure is also available in this diagram:

Modules Diagram

Other diagrams can be found in the diagrams folder.

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

The CIs configurations can be found at:

Prerequisites

The project prerequisites are:

Note that JavaFX support is needed for the TornadoFX module, if you are using OpenJDK, consider changing to Oracle or Zulu (FX) for a more straightforward configuration.

Specific prerequisites:

If you don't have Java or KScript installed yet, consider to use SDKMAN! to install these packages on a straightforward way.

If you don't have the Android SDK, go to this link and download the command line tools or Android Studio.

If you don't have XCode you can download it from the Apple Store.

Installing

  1. Clone:
git clone https://github.com/funttastic/universal_kotlin.git

cd universal_kotlin
  1. Configure:

If you are going to use the Android module, it is needed to configure ANDROID_HOME as system environment variable:

export ANDROID_HOME="/Users/<username>/Library/Android/sdk"

or create a local.properties file and configure it appropriately. A template is available at local.properties.template.

Also the Android module can be disabled directly in the com.company.team.project.dsl.model.enum_.ModuleEnum enum or exporting the disabledModules environment variable:

export disabledModules="application-mobile-jvm-android"
  1. Build:
./gradlew build

Obs.: since this build will be enabling all modules, this could take too long. But you can enable or disable modules going to this class inside the buildSrc module:

com.company.team.project.dsl.model.enum_.ModuleEnum

Also you can enable or disable modules using environment variables (enabledModules and disabledModules). Check the common-multiple_sources module for an example.

The buildSrc method responsible to define which modules will be enabled and which don't is this one:

com.company.team.project.dsl.Util.initialize

Running the tests

To run the tests/checks do:

./gradlew check

or

./gradlew test

Note that the check task depends on the test one (reference).

Running

Please refer to the readme of the correspondent module that you would like to run.

Built With

  • Kotlin (1.3.61): Multi-purpose programming language
  • Gradle (5.4.1): Dependency management

Note that the modules themselves have many other dependencies and you can find them in their build.gradle.kts files.

FAQ

Please take a look at this documentation file for the Frequently Asked Questions.

Authors

Contributors

All contributions are very welcome. Contribute!!!

Creator


Danilo Araújo Silva


Acknowledgments

We would like to thank all Kotlin's contributors, which are doing a very good job. Thanks a lot!

License

Licensed under the Apache License 2.0.

See license for more information.

About

One language to rule them all!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published